Added animation for slide show. (#381)

* Added animation for slide show.
This commit is contained in:
rakesh-saride 2020-07-08 01:30:53 -04:00 committed by GitHub
parent 97f9bd2f20
commit 2d72dc7c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -116,6 +116,9 @@
if (this.interval) { if (this.interval) {
clearInterval(this.interval); clearInterval(this.interval);
this.interval = false; this.interval = false;
const psp = this.$viewer.gallery;
psp.framework.removeClass(psp.container, "slide_show");
} }
}, },
onSlideshow() { onSlideshow() {
@ -129,6 +132,8 @@
psp.next(); psp.next();
psp.framework.addClass(psp.container, "slide_show");
self.interval = setInterval(() => { self.interval = setInterval(() => {
if (psp && typeof psp.next === "function") { if (psp && typeof psp.next === "function") {
psp.next(); psp.next();

View file

@ -54,3 +54,20 @@
-webkit-box-shadow: none; -webkit-box-shadow: none;
box-shadow: none; box-shadow: none;
} }
@keyframes fadeInOut {
0% {
opacity:0;
}
30% {
opacity:1;
}
}
.slide_show {
animation-name: fadeInOut;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 2s;
animation-direction: alternate;
}