@jocampo3/slider 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +5 -0
  2. package/package.json +1 -1
  3. package/styles.css +1 -1
package/index.js CHANGED
@@ -36,10 +36,15 @@ export default class Slider {
36
36
  this.slider.addEventListener('scroll', () => {
37
37
  this.index = this.getCurrentIndex();
38
38
  })
39
+
39
40
  this.slider.addEventListener('mouseenter', () => {
40
41
  clearInterval(this.timer);
41
42
  });
42
43
 
44
+ this.slider.addEventListener('touchstart', () => {
45
+ clearInterval(this.timer);
46
+ })
47
+
43
48
  this.slider.addEventListener('mouseleave', () => {
44
49
  this.restartTimer();
45
50
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jocampo3/slider",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Simple, reusable content carousel. Built with CSS and minimal JavaScript.",
5
5
  "keywords": [
6
6
  "slider"
package/styles.css CHANGED
@@ -1 +1 @@
1
- .slideshow :first-child a:before,.slideshow :last-child a:after,.slideshow:after,.slideshow:before{display:none}.slideshow,.slideshow>* a{width:100%;height:100%;display:flex}.slideshow.js-buttons::after,.slideshow.js-buttons::before{display:block;font-size:2em;color:#333;background:hsla(0,0%,100%,0.75);opacity:0.8;padding:8px 15px;border-radius:100%;position:absolute;top:50%;transform:translateY(-50%);cursor:pointer;z-index:5;pointer-events:none;}.slideshow.js-buttons::before{content:'<';left:10px}.slideshow.js-buttons::after{content:'>';right:10px}a{text-decoration:none}.slideshow{overflow-x:scroll;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;}.slideshow::-webkit-scrollbar{display:none}.slideshow:hover{scroll-behavior:smooth}.slideshow>*{position:relative;scroll-snap-align:center;flex-shrink:0;width:100%;height:100%;margin:0 15%}.slideshow>* a{align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent}.slideshow a>*{max-width:100%;max-height:100%;object-fit:contain;z-index:1}.slideshow a:focus-visible{outline:0}.slideshow a:after,.slideshow a:before{z-index:2;content:"";display:block;position:absolute;top:0;bottom:0;width:calc(50% + 4vw)}.slideshow a:before{left:calc(-1 * calc(50% + 4vw))}.slideshow a:after{right:calc(-1 * calc(50% + 4vw))}
1
+ .slideshow :first-child a:before,.slideshow :last-child a:after,.slideshow:after,.slideshow:before{display:none}.slideshow,.slideshow>* a{width:100%;height:100%;display:flex}.slideshow.js-buttons::after,.slideshow.js-buttons::before{display:block;font-size:2em;font-weight:bold;color:#333;background:hsla(0,0%,100%,0.75);opacity:0.8;padding:8px 15px;border-radius:100%;position:absolute;top:50%;transform:translateY(-50%);cursor:pointer;z-index:5;pointer-events:none;}.slideshow.js-buttons::before{content:'<';left:10px}.slideshow.js-buttons::after{content:'>';right:10px}a{text-decoration:none}.slideshow{overflow-x:scroll;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;}.slideshow::-webkit-scrollbar{display:none}.slideshow:hover{scroll-behavior:smooth}.slideshow>*{position:relative;scroll-snap-align:center;flex-shrink:0;width:100%;height:100%;margin:0 15%}.slideshow>* a{align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent}.slideshow a>*{max-width:100%;max-height:100%;object-fit:contain;z-index:1}.slideshow a:focus-visible{outline:0}.slideshow a:after,.slideshow a:before{z-index:2;content:"";display:block;position:absolute;top:0;bottom:0;width:calc(50% + 4vw)}.slideshow a:before{left:calc(-1 * calc(50% + 4vw))}.slideshow a:after{right:calc(-1 * calc(50% + 4vw))}