Skip to content

Commit 9269a63

Browse files
✨ Improve motion handling in navigation indicator for reduced motion support
1 parent 66b0279 commit 9269a63

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

resources/views/components/nav/indicator.blade.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<div
33
x-init="
44
() => {
5+
if (reducedMotion) return
6+
57
motion.inView($el, (element) => {
68
motion.animate(
79
$el,
@@ -22,8 +24,27 @@
2224
"
2325
:class="{'opacity-0': !reducedMotion}"
2426
>
25-
<x-icons.nexus-flower
26-
class="size-[10px] transition duration-300 group-hover:rotate-90 motion-reduce:transition-none"
27-
/>
27+
<div
28+
x-init="
29+
() => {
30+
if (reducedMotion) return
31+
32+
motion.animate(
33+
$el,
34+
{
35+
rotate: [0, 360],
36+
},
37+
{
38+
duration: 3,
39+
repeat: Infinity,
40+
repeatType: 'loop',
41+
ease: 'linear',
42+
},
43+
)
44+
}
45+
"
46+
>
47+
<x-icons.nexus-flower class="size-[10px]" />
48+
</div>
2849
</div>
2950
</div>

0 commit comments

Comments
 (0)