Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to disable the reversed order of revealing when using interval #575

Open
alaaeddin2p opened this issue Dec 26, 2024 · 3 comments
Open

Comments

@alaaeddin2p
Copy link

alaaeddin2p commented Dec 26, 2024

const fadeUp = {
    distance: '50px',
    origin: 'bottom',
    opacity: 0,
}

const fadeDown = {
    distance: '50px',
    origin: 'top',
    opacity: 0,
}

function scrollReveal_loader(_selector=null, _interval=200, _delay=200, _duration=750, _animationType=fadeUp, _reset=false) {
    if (_selector !== null) {
        const animationType = _animationType;
        
        ScrollReveal().reveal(_selector, {
            interval: _interval,
            delay: _delay, 
            duration: _duration,
            reset: _reset,
            easing: 'ease-out',
            ...animationType,
            viewFactor: 0.1,
        });
    }
}

 scrollReveal_loader('.detailed-why-us-holder .card-style-2');

I am using version: 4.0.9

When I use interval: 100 for example and starting the page from bottom, I mean go to the bottom of the page refresh the page the browser will and you at the same scroll value now try to go up to reveal the animation will be revealed from bottom to top, I mean from element index 5 then 4 then 3 then 2 ... instead of 0,1,2,3,4,5, I don't want this behavior.

I tried default options without customize anything except adding interval time and same issue were faced.

Any solution or option to turn off reversed reveal with interval?

@alaaeddin2p
Copy link
Author

Thanks for the information, why not adding an option to turn on/off this behavior?

@alaaeddin2p
Copy link
Author

Hello, we tried to solve the issue.

This is what we did:

Update the sequence function to always reveal elements in the order they appear in the DOM, regardless of scroll position or direction. This fixes the issue of reversed reveal with interval when scrolling from bottom to top.

You can review changes in this commit: jack-samo10000@a69412e.

Caution

Disclaimer: The concept of solution was created by AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.

Latta AI seeks to solve problems in open source projects as part of its mission to support developers around the world. Learn more about our mission at https://latta.ai/ourmission . If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.

Could you please give me the final result of the built file after that modification?

@alaaeddin2p
Copy link
Author

@jlmakes kindly, could you provide some support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@alaaeddin2p and others