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

Can't get working in firefox/safari. Am I missing something? #262

Open
tettoffensive opened this issue Apr 16, 2024 · 1 comment
Open

Can't get working in firefox/safari. Am I missing something? #262

tettoffensive opened this issue Apr 16, 2024 · 1 comment

Comments

@tettoffensive
Copy link

Am I missing something about how this is supposed to work? I have the following setup which is working in Chrome natively, but I have yet to get either of these to work with the polyfill in Firefox/Safari

index.html:

<head>
...
<script src="https://flackr.github.io/scroll-timeline/dist/scroll-timeline.js"></script>
<style>
      header {
        animation: scroll-shadow linear both;
        animation-timeline: scroll();
        animation-range: 0rem 4rem;
      }

      @keyframes scroll-shadow {
        from {
          box-shadow: none;
        }

        to {
          box-shadow: var(--shadow);
        }
      }

      .sub-header {
        --distance: 10rem;
        --animation-range:
          entry calc(100cqh - var(--scroll-margin, 0px))
          entry calc(100cqh - var(--scroll-margin, 0px) + var(--distance));
        animation: fade-in linear both;
        animation-timeline: view();
        animation-range: var(--animation-range);                  
      }

      @keyframes fade-in {
        from {
          opacity: 0;
          height: 1px;
        }

        to {
          opacity: 1;
          height: auto;
        }
      }
</style>
</head>
@tettoffensive
Copy link
Author

Looks like it's related to some of the parsing. It looks like if I change "rem" to "px" the top one works.

I'm not quite sure the best way to do the other one as I'm guessing cqh isn't supported.

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

1 participant