Created
July 14, 2024 20:11
-
-
Save colinfwren/9962705f3107a2e2d3848f14d06f6bc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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