Commit e01f9b8
committed
perf: Optimize carousel animation for mobile
Refactored the checkPos function that calculates the 3D scroll effect. The new implementation filters out off-screen elements and only performs expensive calculations (like getBoundingClientRect) for visible items. This drastically reduces CPU load during scrolling, fixing performance issues and janky animations on mobile devices while preserving the real-time visual effect.1 parent 6aa83ac commit e01f9b8
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
0 commit comments