File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11---
2- const { count = 20 } = Astro .props ;
2+ const { count = 40 } = Astro .props ;
33---
44
55<div class =" leaves-container" aria-hidden =" true" >
@@ -41,8 +41,11 @@ const { count = 20 } = Astro.props;
4141 }
4242
4343 @keyframes fall {
44- to {
45- transform: translateY(100vh);
44+ 0% {
45+ transform: translateY(0) rotate(0deg);
46+ }
47+ 100% {
48+ transform: translateY(100vh) rotate(var(--rotation));
4649 }
4750 }
4851
@@ -94,9 +97,12 @@ const { count = 20 } = Astro.props;
9497 const initialRotation = Math.random() * 60 - 30;
9598 htmlLeaf.style.transform = `rotate(${initialRotation}deg)`;
9699
100+ const rotationSpeed = Math.random() * 360;
101+ htmlLeaf.style.setProperty('--rotation', `${rotationSpeed}deg`);
102+
97103 const img = htmlLeaf.querySelector('img');
98104 if (img) {
99- img.style.filter = `brightness(${Math.random() * 0.5 + 0.7})`;
105+ img.style.filter = `brightness(${Math.random() * 0.7 + 0.7})`;
100106 let transformStyle = '';
101107 if (Math.random() > 0.5) {
102108 transformStyle += 'scaleX(-1)';
You can’t perform that action at this time.
0 commit comments