Code Monkey home page Code Monkey logo

Comments (7)

mrspence avatar mrspence commented on June 14, 2024 7

Perhaps worth noting how to adjust timing: you can manually create animation keyframes and adjust their timing like below (change ease 0.2s to your preferred timing)

// Using SASS

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.slide {
    opacity: 0 !important;

    &:not(.is-selected){
        animation: fadeOut ease 0.2s;
    }

    &.is-selected {
        z-index: 99;
        opacity: 1 !important;
        animation: fadeIn ease 0.2s;
    }
}

(I needed z-index, may not be neccessary for you - I haven't had time to see if this is from my own conflicts or not)

from flickity-fade.

RitchieVincent avatar RitchieVincent commented on June 14, 2024 5

For now if you want to set it yourself using CSS, set
opacity: 0 !important; on all slides and
opacity: 1 !important; on the selected slide.
You can then use CSS transition timing to adjust it to how you want.

from flickity-fade.

desandro avatar desandro commented on June 14, 2024 3

Funny you should ask because this exactly how fade transition speed works: with selectedAttraction and friction options. Flickity is hard-wired for sliding interaction, so there is no option to set a transition speed to a time duration though.

from flickity-fade.

tedw avatar tedw commented on June 14, 2024 2

FWIW, while adjusting selectedAttraction and friction works, I think using CSS for the fade effect would make it easier and more intuitive for people to adjust the timing and easing, and potentially more performant. If I ever get some free time at work I can try to submit a PR (unfortunately, that might be a little while).

Anyway, thanks for adding the fade functionality! 🎉

from flickity-fade.

mentiondev avatar mentiondev commented on June 14, 2024 1

I use the following css with the fade option to make it smoother. As can adjust the speed and transition style then.

.carousel-cell {
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 0;
    width: 100vw;
    height: 100%;
}

from flickity-fade.

skillmatic-co avatar skillmatic-co commented on June 14, 2024

I tried those, but they didn't seem to do anything for fade speed.

from flickity-fade.

richgcook avatar richgcook commented on June 14, 2024

@skillmatic-co If you set the selectedAttraction to something like 0.001 you can see the difference. I'm unsure what friction would do for a fade but selectedAttraction definitely works 👍🏻

from flickity-fade.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.