diff --git a/51-css-scroll-based-animation/images/image1.jpg b/51-css-scroll-based-animation/images/image1.jpg new file mode 100644 index 0000000..178cca3 Binary files /dev/null and b/51-css-scroll-based-animation/images/image1.jpg differ diff --git a/51-css-scroll-based-animation/images/image2.jpg b/51-css-scroll-based-animation/images/image2.jpg new file mode 100644 index 0000000..f7c4b65 Binary files /dev/null and b/51-css-scroll-based-animation/images/image2.jpg differ diff --git a/51-css-scroll-based-animation/index.html b/51-css-scroll-based-animation/scroll.html similarity index 60% rename from 51-css-scroll-based-animation/index.html rename to 51-css-scroll-based-animation/scroll.html index bd8cd60..5c721bb 100644 --- a/51-css-scroll-based-animation/index.html +++ b/51-css-scroll-based-animation/scroll.html @@ -13,47 +13,42 @@ } main { - background-color: hsl(209, 100%, 50%); + /* background-color: hsl(209, 100%, 50%); */ width: 100vw; height: calc(100vh * 3); display: grid; grid-template-columns: 1fr 1fr; justify-items: center; - perspective: 1000px; + /* perspective: 1000px; */ } - .box { - margin-top: 50vh; - background-color: hsl(40, 100%, 50%); + img { width: 300px; height: 300px; - animation: scaleAndFlip linear; - animation-timeline: scroll(root block); - transform-style: preserve-3d; + object-fit: cover; + margin-top: 50vh; } - .box2 { - background-color: hsl(60, 100%, 50%); + img:nth-of-type(1) { + animation: move200 linear; + animation-timeline: scroll(root block); } - @keyframes scaleAndFlip { + @keyframes move200 { 0% { - scale: 1; - rotate: x 0deg; + translate: 0 0; } 100% { - scale: 4; - rotate: x 360deg; - opacity: 0.1; + translate: 0 -200px; } }