I am searching for a method to add animation effects (using @keyframes
, transform
...) to certain elements as the user scrolls down the page. For instance:
- When the offset is 0: the
div
will have a height of100px
. - When the offset is between 0 and 100: the
div
changes to a height of50px
and becomesblue
. - And so forth...
Is it possible to achieve this using only CSS? If not, what are the most effective ways to accomplish this with HTML or JavaScript?