From 1488bfe7ad7c05eb4aa6aee5c3d45ca11afced80 Mon Sep 17 00:00:00 2001 From: ligebit <31742363+ligebit@users.noreply.github.com> Date: Mon, 17 Feb 2025 20:21:48 +0200 Subject: [PATCH] fix: prevent recursive animation application in styles Fixed an issue where the animation was applied recursively to all nested div elements inside .scroll, causing unintended behavior. Now, the animation is restricted to direct child elements using the > selector --- styles.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/styles.css b/styles.css index 95ae74f..4354d12 100644 --- a/styles.css +++ b/styles.css @@ -22,14 +22,13 @@ body { -webkit-mask-image: linear-gradient(90deg, transparent, #fff 20%, #fff 80%, transparent) } -.scroll div { +.scroll > div { white-space: nowrap; animation: scroll var(--time) linear infinite; animation-delay: calc(var(--time)*-1); - } -.scroll div:nth-child(2) { +.scroll > div:nth-child(2) { animation: scroll2 var(--time) linear infinite; animation-delay: calc(var(--time)/-2); } @@ -79,4 +78,4 @@ body { .imgBox img { max-width: 100px; scale: 0.8; -} \ No newline at end of file +}