test
parent
78caab93d2
commit
5539f957b8
|
@ -57,23 +57,36 @@
|
||||||
let videoElement = this.querySelector('.shx-video');
|
let videoElement = this.querySelector('.shx-video');
|
||||||
videoElement.classList.add('shx-video-for-desc');
|
videoElement.classList.add('shx-video-for-desc');
|
||||||
|
|
||||||
if(openAnimation) {
|
// pause all video
|
||||||
|
this.videoClones.keys().forEach((key) => {
|
||||||
|
if (key !== this.currentVariant) {
|
||||||
|
this.videoClones[key].pause();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
videoClone.play();
|
||||||
|
|
||||||
|
if(openAnimation) {
|
||||||
videoElement.style.height = '0px';
|
videoElement.style.height = '0px';
|
||||||
|
|
||||||
//animejs fade in
|
function animate() {
|
||||||
//dom ready
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
anime({
|
anime({
|
||||||
targets: videoElement,
|
targets: videoElement,
|
||||||
height: '400px',
|
height: '400px',
|
||||||
duration: 500,
|
duration: 500,
|
||||||
easing: 'cubicBezier(0.590, 0.190, 0.050, 0.990)'
|
easing: 'cubicBezier(0.590, 0.190, 0.050, 0.990)'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
console.log('open animation');
|
//animejs fade in
|
||||||
});
|
//dom ready
|
||||||
|
if (document.readyState !== 'loading') {
|
||||||
|
animate();
|
||||||
|
} else {
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
animate();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue