bulma-extensions
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -39,2 +39,9 @@ class Carousel { | ||
} | ||
if (!newValue || newValue !== 2) { | ||
item.style['z-index'] = '0'; | ||
item.classList.remove('is-active'); | ||
} else { | ||
item.style['z-index'] = '1'; | ||
item.classList.add('is-active'); | ||
} | ||
item.style.order = newValue ? newValue : nbItems; | ||
@@ -53,2 +60,3 @@ }); | ||
this.setOrder('previous'); | ||
// Enable transition to animate order 1 to order 2 | ||
@@ -77,3 +85,3 @@ setTimeout(() => { | ||
window.onload = function() { | ||
let carousels = document.querySelectorAll('.carousel'); | ||
let carousels = document.querySelectorAll('.carousel, .hero-carousel'); | ||
if (carousels) { | ||
@@ -80,0 +88,0 @@ carousels.forEach(element => { |
var Carousel=function(a){this.element=a;this.init()};Carousel.prototype.init=function(){var a=this;this.carouselContent=this.element.querySelector(".carousel-content");this.items=this.carouselContent.querySelectorAll(".carousel-item");this.element.querySelector(".carousel-nav-left").addEventListener("click",function(b){a.prevSlide()},!1);this.element.querySelector(".carousel-nav-right").addEventListener("click",function(b){a.nextSlide()},!1);this.setOrder()}; | ||
Carousel.prototype.setOrder=function(a){"previous"===a?a=1:"next"===a&&(a=-1);var b=this.items.length;b&&this.items.forEach(function(c,e){var d;d=c.style.order?(parseInt(c.style.order,10)+a)%b:(e+2)%b;c.style.order=d?d:b})};Carousel.prototype.prevSlide=function(a){var b=this;this.carouselContent.classList.add("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("previous");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)}; | ||
Carousel.prototype.nextSlide=function(a){var b=this;this.carouselContent.classList.remove("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("next");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)};window.onload=function(){var a=document.querySelectorAll(".carousel");a&&a.forEach(function(a){new Carousel(a)})}; | ||
Carousel.prototype.setOrder=function(a){"previous"===a?a=1:"next"===a&&(a=-1);var b=this.items.length;b&&this.items.forEach(function(c,e){var d;(d=c.style.order?(parseInt(c.style.order,10)+a)%b:(e+2)%b)&&2===d?(c.style["z-index"]="1",c.classList.add("is-active")):(c.style["z-index"]="0",c.classList.remove("is-active"));c.style.order=d?d:b})}; | ||
Carousel.prototype.prevSlide=function(a){var b=this;this.carouselContent.classList.add("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("previous");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)}; | ||
Carousel.prototype.nextSlide=function(a){var b=this;this.carouselContent.classList.remove("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("next");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)};window.onload=function(){var a=document.querySelectorAll(".carousel, .hero-carousel");a&&a.forEach(function(a){new Carousel(a)})}; |
{ | ||
"name": "bulma-carousel", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Display a Image / Content carousel", | ||
@@ -5,0 +5,0 @@ "main": "carousel.sass", |
{ | ||
"name": "bulma-extensions", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Set of extensions for Bulma.io CSS Framework", | ||
@@ -5,0 +5,0 @@ "main": "extensions.sass", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
612703
1434