November 2017
Beginner to intermediate
398 pages
8h 42m
English
Now, let's move on to the animation itself. Like we did for the castle banners, we will use the TWEEN.js library:
methods: { // ... startAnimation (delay = 0) { const vm = this // Element width const width = this.$el.clientWidth // Random animation duration const { min, max } = cloudAnimationDurations const animationDuration = Math.random() * (max - min) + min // Bing faster clouds forward this.style.zIndex = Math.round(max - animationDuration) // Animation will be there }, }
Read now
Unlock full access