Last active
February 8, 2022 12:01
-
-
Save cp-sumi-k/7e75f4d82bc04fc46c9650900fa734cb to your computer and use it in GitHub Desktop.
https://blog.canopas.com/animations-with-css-and-vue-transitions-fdb53dbb21e7 - slider-animation-3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style lang="scss" scoped> | |
// translate image to 120% to right when image is entering to transition | |
.image-next-enter-active { | |
transform: translate(120%); | |
} | |
//stop transform when image has entered from right | |
.image-next-enter-to { | |
transform: translate(0%); | |
} | |
// hide image when it is leaving from transition | |
.image-next-leave-active { | |
display: none; | |
} | |
// translate image to -120% to left when image is entering to transition | |
.image-prev-enter-active { | |
transform: translate(-120%); | |
} | |
//stop transform when image has entered from left | |
.image-prev-enter-to { | |
transform: translate(0%); | |
} | |
// hide image when it is leaving from transition | |
.image-prev-leave-active { | |
display: none; | |
} | |
</style> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment