Skip to content

Instantly share code, notes, and snippets.

@colinfwren
Created July 14, 2024 20:11
Show Gist options
  • Save colinfwren/9962705f3107a2e2d3848f14d06f6bc7 to your computer and use it in GitHub Desktop.
Save colinfwren/9962705f3107a2e2d3848f14d06f6bc7 to your computer and use it in GitHub Desktop.
.item-list {
/* make the item lists y-axis scroll progress available as a variable */
scroll-timeline: --item-list-scroll-timeline y;
}
.bag-section-image {
/* The animation(s) to drive using the scroll progress */
animation: item-bag-image linear;
/* Hook up the item lists scroll progress to drive the animation */
animation-timeline: --item-list-scroll-timeline;
}
@keyframes item-bag-image {
/* control the changing of the image based on scroll progress */
0% {
background-image: url('img/items.png');
}
46% {
background-image: url('img/pokeballs.png');
}
53% {
background-image: url('img/key-items.png');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment