Skip to content

Commit

Permalink
Add animation-range support for ScrollTimeline (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramus authored Jan 31, 2024
1 parent 4229714 commit b2f44df
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 394 deletions.
43 changes: 43 additions & 0 deletions demo/scroll-timeline-css/anonymous-scroll-timeline-with-range.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<title>Anonymous Scroll Progress Timeline</title>

<style>
@keyframes move {
to { transform: translateX(350px) translateY(600px); }
}

#box_one {
width: 100px;
height: 100px;
background-color: green;
animation: move linear both;
animation-timeline: scroll(y nearest);
animation-range: 100px 500px;
}

.spacer {
width: 100%;
height: 2000px;
}

#container {
width: 500px;
height: 500px;
background-color:beige;
overflow: auto;
}

body {
height: 3000px;
}
</style>

<body>

<div id="container">
<div id="box_one"></div>
<div class="spacer"></div>
</div>

<script src="../../dist/scroll-timeline.js"></script>
</body>
224 changes: 0 additions & 224 deletions src/intersection-based-offset.js

This file was deleted.

Loading

0 comments on commit b2f44df

Please sign in to comment.