mirror of
https://github.com/RealKai42/qwerty-learner.git
synced 2026-04-05 06:19:08 +08:00
Merge pull request #989 from JayMeDotDot/fix-mobile-page-animation
fix mobilePage carousel animation bug
This commit is contained in:
@@ -52,13 +52,13 @@ const MobilePage: React.FC = () => {
|
|||||||
const slideWidth = container.offsetWidth
|
const slideWidth = container.offsetWidth
|
||||||
|
|
||||||
if (currentSlide === 0) {
|
if (currentSlide === 0) {
|
||||||
container.style.transition = 'none'
|
container.style.transform = `translateX(-${totalSlides * slideWidth}px)`
|
||||||
container.style.transform = `translateX(0)`
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
container.style.transition = 'transform 0.5s ease'
|
container.style.transition = 'none'
|
||||||
container.style.transform = `translateX(-${slideWidth}px)`
|
container.style.transform = `translateX(0)`
|
||||||
}, 50)
|
}, 500)
|
||||||
} else {
|
} else {
|
||||||
|
container.style.transition = 'transform 0.5s ease'
|
||||||
container.style.transform = `translateX(-${currentSlide * slideWidth}px)`
|
container.style.transform = `translateX(-${currentSlide * slideWidth}px)`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user