Skip to content
Snippets Groups Projects
Commit b37dcd8c authored by alexisben's avatar alexisben
Browse files

Merge branch 'main' of github.com:noesya/osuny-hugo-theme-aaa

parents b9086e51 7c7acd0d
No related branches found
No related tags found
No related merge requests found
...@@ -33,39 +33,39 @@ class Carousel { ...@@ -33,39 +33,39 @@ class Carousel {
stepButton.innerHTML = '<i></i>'; stepButton.innerHTML = '<i></i>';
}); });
this.splide.on('autoplay:play', function () { this.splide.on('autoplay:play', () => {
toggleButton.classList.add('is-active'); toggleButton.classList.add('is-active');
}); });
this.splide.on('autoplay:playing', function (rate) { this.splide.on('autoplay:playing', (rate) => {
var activeStepButton = this.splide.root.querySelector('.splide__pagination .is-active i'); var activeStepButton = this.splide.root.querySelector('.splide__pagination .is-active i');
activeStepButton.style.width = rate * 100 + '%'; activeStepButton.style.width = rate * 100 + '%';
}); });
this.splide.on('autoplay:pause', function () { this.splide.on('autoplay:pause', () => {
toggleButton.classList.remove('is-active'); toggleButton.classList.remove('is-active');
}); });
elements.forEach(function(element) { elements.forEach(element => {
element.addEventListener('click', () => { element.addEventListener('click', () => {
autoplay.pause(); autoplay.pause();
}) })
}); });
this.splide.on('drag', function() { this.splide.on('drag', () => {
autoplay.pause(); autoplay.pause();
}); });
} }
} }
listen() { listen() {
this.splide.on('move', function() { this.splide.on('move', () => {
this.splide.root.classList.add('is-moving') this.splide.root.classList.add('is-moving')
}.bind(this)); });
this.splide.on('moved', function() { this.splide.on('moved', () => {
this.splide.root.classList.remove('is-moving') this.splide.root.classList.remove('is-moving')
}.bind(this)); });
} }
} }
......
...@@ -57,6 +57,10 @@ ...@@ -57,6 +57,10 @@
width: 42px width: 42px
&::before &::before
color: $color-accent color: $color-accent
&:not(.is-active)
+ .splide__pagination
.is-active i
width: 100% !important
.splide__play .splide__play
&::before &::before
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment