lazer-slider 1.0.2 → 1.0.4

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.
package/dist/index.js CHANGED
@@ -1,8 +1,609 @@
1
- // src/index.ts
2
- function greet(name) {
3
- return `Hello, ${name}!`;
4
- }
1
+ // src/core/easing.ts
2
+ var easeOutExpo = (t) => t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
3
+ var easeOutCubic = (t) => 1 - Math.pow(1 - t, 3);
4
+ var easeInOutCubic = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
5
+ var easeOutQuad = (t) => 1 - (1 - t) * (1 - t);
6
+ var linear = (t) => t;
7
+
8
+ // src/core/accessibility.ts
9
+ var generateSliderId = () => `slider-${Math.random().toString(36).substring(2, 9)}`;
10
+ var initAria = (settings) => {
11
+ const { feed, prevSlideButton, nextSlideButton, thumbs, slides } = settings;
12
+ if (!feed.id) {
13
+ feed.id = generateSliderId();
14
+ }
15
+ feed.setAttribute("role", "region");
16
+ feed.setAttribute("aria-label", "Carousel");
17
+ feed.setAttribute("aria-roledescription", "carousel");
18
+ feed.removeAttribute("tabindex");
19
+ slides.forEach((slide, index) => {
20
+ slide.setAttribute("role", "group");
21
+ slide.setAttribute("aria-roledescription", "slide");
22
+ slide.setAttribute("aria-label", `Slide ${index + 1} of ${slides.length}`);
23
+ });
24
+ if (prevSlideButton) {
25
+ prevSlideButton.setAttribute("aria-label", "Previous slide");
26
+ prevSlideButton.setAttribute("aria-controls", feed.id);
27
+ prevSlideButton.setAttribute("tabindex", "0");
28
+ if (prevSlideButton.tagName !== "BUTTON") {
29
+ prevSlideButton.setAttribute("role", "button");
30
+ }
31
+ }
32
+ if (nextSlideButton) {
33
+ nextSlideButton.setAttribute("aria-label", "Next slide");
34
+ nextSlideButton.setAttribute("aria-controls", feed.id);
35
+ nextSlideButton.setAttribute("tabindex", "0");
36
+ if (nextSlideButton.tagName !== "BUTTON") {
37
+ nextSlideButton.setAttribute("role", "button");
38
+ }
39
+ }
40
+ if (thumbs?.length) {
41
+ thumbs.forEach((thumb, index) => {
42
+ if (thumb.tagName !== "BUTTON") {
43
+ thumb.setAttribute("role", "button");
44
+ }
45
+ thumb.setAttribute("aria-label", `Go to slide ${index + 1}`);
46
+ thumb.setAttribute("tabindex", "0");
47
+ thumb.setAttribute("aria-controls", feed.id);
48
+ });
49
+ }
50
+ };
51
+ var toggleControlVisibility = (button, shouldShow, feedElement) => {
52
+ if (!button) return;
53
+ if (!shouldShow && button === document.activeElement && feedElement) {
54
+ feedElement.focus();
55
+ }
56
+ const transition = "opacity 0.3s ease";
57
+ const opacity = shouldShow ? "1" : "0";
58
+ Object.assign(button.style, {
59
+ opacity,
60
+ transition,
61
+ pointerEvents: shouldShow ? "auto" : "none"
62
+ });
63
+ if (!shouldShow) {
64
+ button.setAttribute("aria-hidden", "true");
65
+ button.setAttribute("tabindex", "-1");
66
+ } else {
67
+ button.removeAttribute("aria-hidden");
68
+ button.setAttribute("tabindex", "0");
69
+ }
70
+ if (!shouldShow) {
71
+ setTimeout(() => {
72
+ if (button.style.opacity === "0") {
73
+ button.style.visibility = "hidden";
74
+ }
75
+ }, 300);
76
+ } else {
77
+ button.style.visibility = "visible";
78
+ }
79
+ };
80
+ var updateActiveThumb = (thumbs, currentIndex, activeClass = "active") => {
81
+ if (!thumbs?.length) return;
82
+ thumbs.forEach((thumb, index) => {
83
+ const isActive = index === currentIndex;
84
+ thumb.classList.toggle(activeClass, isActive);
85
+ thumb.setAttribute("aria-selected", isActive.toString());
86
+ });
87
+ };
88
+ var setupKeyboardNavigation = (feed, onPrev, onNext, abortSignal) => {
89
+ feed.addEventListener(
90
+ "keydown",
91
+ (event) => {
92
+ switch (event.key) {
93
+ case "ArrowLeft":
94
+ event.preventDefault();
95
+ onPrev();
96
+ break;
97
+ case "ArrowRight":
98
+ event.preventDefault();
99
+ onNext();
100
+ break;
101
+ }
102
+ },
103
+ { signal: abortSignal }
104
+ );
105
+ if (!feed.hasAttribute("tabindex")) {
106
+ feed.setAttribute("tabindex", "0");
107
+ }
108
+ };
109
+
110
+ // src/core/drag.ts
111
+ var createDragState = () => ({
112
+ isDragging: false,
113
+ startX: 0,
114
+ startScrollLeft: 0,
115
+ velocity: 0,
116
+ lastX: 0,
117
+ lastTime: 0,
118
+ momentumId: null
119
+ });
120
+ var findNearestSlide = (feed, slides) => {
121
+ const feedRect = feed.getBoundingClientRect();
122
+ const feedCenter = feedRect.left + feedRect.width / 2;
123
+ let nearestSlide = null;
124
+ let minDistance = Infinity;
125
+ for (const slide of slides) {
126
+ if (slide.offsetParent === null) continue;
127
+ const slideRect = slide.getBoundingClientRect();
128
+ const slideCenter = slideRect.left + slideRect.width / 2;
129
+ const distance = Math.abs(feedCenter - slideCenter);
130
+ if (distance < minDistance) {
131
+ minDistance = distance;
132
+ nearestSlide = slide;
133
+ }
134
+ }
135
+ return nearestSlide;
136
+ };
137
+ var applyMomentum = (state, feed, slides, smoothScrollTo, onDragEnd) => {
138
+ const friction = 0.95;
139
+ const minVelocity = 0.5;
140
+ const animate = () => {
141
+ if (Math.abs(state.velocity) < minVelocity) {
142
+ state.momentumId = null;
143
+ const nearestSlide = findNearestSlide(feed, slides);
144
+ if (nearestSlide) {
145
+ smoothScrollTo(nearestSlide.offsetLeft, easeOutCubic);
146
+ }
147
+ onDragEnd?.();
148
+ return;
149
+ }
150
+ feed.scrollLeft += state.velocity;
151
+ state.velocity *= friction;
152
+ state.momentumId = requestAnimationFrame(animate);
153
+ };
154
+ state.momentumId = requestAnimationFrame(animate);
155
+ };
156
+ var getEventX = (event) => {
157
+ if ("touches" in event) {
158
+ return event.touches[0]?.clientX ?? 0;
159
+ }
160
+ return event.clientX;
161
+ };
162
+ var setupDragToScroll = (config) => {
163
+ const { feed, slides, abortSignal, smoothScrollTo, onDragEnd } = config;
164
+ const state = createDragState();
165
+ const handleDragStart = (event) => {
166
+ if (state.momentumId !== null) {
167
+ cancelAnimationFrame(state.momentumId);
168
+ state.momentumId = null;
169
+ }
170
+ state.isDragging = true;
171
+ state.startX = getEventX(event);
172
+ state.startScrollLeft = feed.scrollLeft;
173
+ state.velocity = 0;
174
+ state.lastX = state.startX;
175
+ state.lastTime = performance.now();
176
+ feed.style.cursor = "grabbing";
177
+ feed.style.userSelect = "none";
178
+ if (event.type === "mousedown") {
179
+ event.preventDefault();
180
+ }
181
+ };
182
+ const handleDragMove = (event) => {
183
+ if (!state.isDragging) return;
184
+ const currentX = getEventX(event);
185
+ const currentTime = performance.now();
186
+ const deltaX = state.startX - currentX;
187
+ const deltaTime = currentTime - state.lastTime;
188
+ feed.scrollLeft = state.startScrollLeft + deltaX;
189
+ if (deltaTime > 0) {
190
+ state.velocity = (state.lastX - currentX) / deltaTime * 16;
191
+ }
192
+ state.lastX = currentX;
193
+ state.lastTime = currentTime;
194
+ if (event.type === "touchmove") {
195
+ event.preventDefault();
196
+ }
197
+ };
198
+ const handleDragEnd = () => {
199
+ if (!state.isDragging) return;
200
+ state.isDragging = false;
201
+ feed.style.cursor = "grab";
202
+ feed.style.userSelect = "";
203
+ if (Math.abs(state.velocity) > 1) {
204
+ applyMomentum(state, feed, slides, smoothScrollTo, onDragEnd);
205
+ } else {
206
+ const nearestSlide = findNearestSlide(feed, slides);
207
+ if (nearestSlide) {
208
+ smoothScrollTo(nearestSlide.offsetLeft, easeOutCubic);
209
+ }
210
+ onDragEnd?.();
211
+ }
212
+ };
213
+ feed.style.cursor = "grab";
214
+ feed.addEventListener("mousedown", handleDragStart, { signal: abortSignal });
215
+ document.addEventListener("mousemove", handleDragMove, { signal: abortSignal });
216
+ document.addEventListener("mouseup", handleDragEnd, { signal: abortSignal });
217
+ feed.addEventListener("touchstart", handleDragStart, {
218
+ passive: true,
219
+ signal: abortSignal
220
+ });
221
+ feed.addEventListener("touchmove", handleDragMove, {
222
+ passive: false,
223
+ // Need to prevent default
224
+ signal: abortSignal
225
+ });
226
+ feed.addEventListener("touchend", handleDragEnd, { signal: abortSignal });
227
+ document.addEventListener("mouseleave", handleDragEnd, { signal: abortSignal });
228
+ return state;
229
+ };
230
+ var cleanupDrag = (state) => {
231
+ if (state.momentumId !== null) {
232
+ cancelAnimationFrame(state.momentumId);
233
+ state.momentumId = null;
234
+ }
235
+ };
236
+
237
+ // src/core/slider.ts
238
+ var ANIMATION = {
239
+ MIN_DURATION: 400,
240
+ MAX_DURATION: 1e3,
241
+ SPEED_FACTOR: 1.5,
242
+ SCROLL_END_DELAY: 50,
243
+ THUMB_UPDATE_DELAY: 500
244
+ };
245
+ var DESKTOP_BREAKPOINT = "(min-width: 64rem)";
246
+ var createSlider = (settings) => {
247
+ if (!settings.feed) {
248
+ throw new Error("lazer-slider: feed element is required");
249
+ }
250
+ if (!settings.slides?.length) {
251
+ throw new Error("lazer-slider: slides array is required and must not be empty");
252
+ }
253
+ const state = {
254
+ currentSlideIndex: 0,
255
+ isScrolling: false,
256
+ ticking: false,
257
+ cachedFeedRect: null,
258
+ lastWidth: 0,
259
+ updateThumbTimeout: null,
260
+ scrollEndTimeout: null,
261
+ abortController: new AbortController(),
262
+ autoplayIntervalId: null,
263
+ autoplayPaused: false
264
+ };
265
+ let dragState = null;
266
+ const easing = settings.easing ?? easeOutExpo;
267
+ const getFeedRect = () => {
268
+ const currentWidth = settings.feed.clientWidth;
269
+ if (!state.cachedFeedRect || state.lastWidth !== currentWidth) {
270
+ state.cachedFeedRect = settings.feed.getBoundingClientRect();
271
+ state.lastWidth = currentWidth;
272
+ }
273
+ return state.cachedFeedRect;
274
+ };
275
+ const getVisibleSlides = () => {
276
+ return settings.slides.filter((slide) => slide.offsetParent !== null);
277
+ };
278
+ const isDesktop = () => {
279
+ return window.matchMedia(DESKTOP_BREAKPOINT).matches;
280
+ };
281
+ const applySlideWidths = () => {
282
+ const perView = isDesktop() ? settings.desktopSlidesPerView : settings.mobileSlidesPerView;
283
+ const gap = settings.slideGap ?? 0;
284
+ if (gap > 0) {
285
+ settings.feed.style.gap = `${gap}px`;
286
+ }
287
+ if (!perView || perView === "auto") {
288
+ settings.slides.forEach((slide) => {
289
+ slide.style.flex = "";
290
+ slide.style.minWidth = "";
291
+ });
292
+ return;
293
+ }
294
+ const totalGapWidth = gap * (perView - 1);
295
+ const slideWidth = `calc((100% - ${totalGapWidth}px) / ${perView})`;
296
+ settings.slides.forEach((slide) => {
297
+ slide.style.flex = `0 0 ${slideWidth}`;
298
+ slide.style.minWidth = slideWidth;
299
+ });
300
+ };
301
+ const updateScrollbar = () => {
302
+ if (!settings.scrollbarThumb) return;
303
+ const feedRect = getFeedRect();
304
+ const thumbWidth = feedRect.width / settings.feed.scrollWidth * 100;
305
+ settings.scrollbarThumb.style.width = `${thumbWidth}%`;
306
+ };
307
+ const updateScrollbarPosition = () => {
308
+ if (!settings.scrollbarThumb || !settings.scrollbarTrack) return;
309
+ const trackWidth = settings.scrollbarTrack.getBoundingClientRect().width;
310
+ const thumbWidth = settings.scrollbarThumb.getBoundingClientRect().width;
311
+ const totalTransform = trackWidth - thumbWidth;
312
+ const maxScroll = settings.feed.scrollWidth - settings.feed.clientWidth;
313
+ const scrollProgress = maxScroll > 0 ? settings.feed.scrollLeft / maxScroll : 0;
314
+ settings.scrollbarThumb.style.transform = `translateX(${totalTransform * scrollProgress}px)`;
315
+ };
316
+ const updateControlsVisibility = () => {
317
+ const feedRect = getFeedRect();
318
+ const isAtStart = settings.feed.scrollLeft <= 1;
319
+ const isAtEnd = settings.feed.scrollLeft + feedRect.width >= settings.feed.scrollWidth - 1;
320
+ const shouldHideScrollbar = settings.feed.scrollWidth <= feedRect.width;
321
+ if (settings.scrollbarTrack) {
322
+ settings.scrollbarTrack.style.display = shouldHideScrollbar ? "none" : "block";
323
+ }
324
+ if (settings.loop) {
325
+ toggleControlVisibility(
326
+ settings.prevSlideButton,
327
+ !shouldHideScrollbar,
328
+ settings.feed
329
+ );
330
+ toggleControlVisibility(
331
+ settings.nextSlideButton,
332
+ !shouldHideScrollbar,
333
+ settings.feed
334
+ );
335
+ return;
336
+ }
337
+ toggleControlVisibility(
338
+ settings.prevSlideButton,
339
+ !isAtStart && !shouldHideScrollbar,
340
+ settings.feed
341
+ );
342
+ toggleControlVisibility(
343
+ settings.nextSlideButton,
344
+ !isAtEnd && !shouldHideScrollbar,
345
+ settings.feed
346
+ );
347
+ };
348
+ const updateCurrentSlideIndex = () => {
349
+ const feedRect = getFeedRect();
350
+ const allVisibleSlides = getVisibleSlides();
351
+ const viewportVisibleSlides = settings.slides.filter((slide) => {
352
+ const slideRect = slide.getBoundingClientRect();
353
+ const tolerance = 20;
354
+ return slideRect.right > feedRect.left + tolerance && slideRect.left < feedRect.right - tolerance;
355
+ });
356
+ if (viewportVisibleSlides.length && viewportVisibleSlides[0]) {
357
+ const newIndex = allVisibleSlides.indexOf(viewportVisibleSlides[0]);
358
+ if (newIndex !== -1) {
359
+ state.currentSlideIndex = newIndex;
360
+ settings.onScroll?.({
361
+ currentScroll: settings.feed.scrollLeft,
362
+ currentSlideIndex: state.currentSlideIndex
363
+ });
364
+ }
365
+ }
366
+ };
367
+ const smoothScrollTo = (target, customEasing = easing) => {
368
+ const start = settings.feed.scrollLeft;
369
+ const distance = Math.abs(target - start);
370
+ const duration = Math.min(
371
+ ANIMATION.MAX_DURATION,
372
+ Math.max(ANIMATION.MIN_DURATION, distance / ANIMATION.SPEED_FACTOR)
373
+ );
374
+ const startTime = performance.now();
375
+ const animateScroll = (currentTime) => {
376
+ const elapsed = (currentTime - startTime) / duration;
377
+ const progress = Math.min(elapsed, 1);
378
+ const ease = customEasing(progress);
379
+ settings.feed.scrollLeft = start + (target - start) * ease;
380
+ if (progress < 1) {
381
+ requestAnimationFrame(animateScroll);
382
+ } else {
383
+ settings.feed.scrollLeft = target;
384
+ }
385
+ };
386
+ requestAnimationFrame(animateScroll);
387
+ };
388
+ const handleThumbClick = (thumb) => {
389
+ if (!settings.thumbs) return;
390
+ const index = settings.thumbs.indexOf(thumb);
391
+ if (index === -1 || !settings.slides[index]) return;
392
+ state.currentSlideIndex = index;
393
+ updateActiveThumb(settings.thumbs, index);
394
+ state.isScrolling = true;
395
+ if (state.updateThumbTimeout) {
396
+ clearTimeout(state.updateThumbTimeout);
397
+ }
398
+ state.updateThumbTimeout = setTimeout(() => {
399
+ state.isScrolling = false;
400
+ }, ANIMATION.THUMB_UPDATE_DELAY);
401
+ smoothScrollTo(settings.slides[index].offsetLeft);
402
+ };
403
+ const handleNavButtonClick = (direction) => {
404
+ const visibleSlides = getVisibleSlides();
405
+ const slidesToScroll = isDesktop() ? settings.desktopSlidesPerScroll ?? 1 : settings.mobileSlidesPerScroll ?? 1;
406
+ const totalSlides = visibleSlides.length;
407
+ updateCurrentSlideIndex();
408
+ if (direction === "prev") {
409
+ if (settings.loop && state.currentSlideIndex === 0) {
410
+ state.currentSlideIndex = totalSlides - 1;
411
+ } else {
412
+ state.currentSlideIndex = Math.max(0, state.currentSlideIndex - slidesToScroll);
413
+ }
414
+ } else {
415
+ if (settings.loop && state.currentSlideIndex >= totalSlides - 1) {
416
+ state.currentSlideIndex = 0;
417
+ } else {
418
+ state.currentSlideIndex = Math.min(
419
+ totalSlides - 1,
420
+ state.currentSlideIndex + slidesToScroll
421
+ );
422
+ }
423
+ }
424
+ const targetSlide = visibleSlides[state.currentSlideIndex];
425
+ if (!targetSlide) return;
426
+ settings.onScrollStart?.({
427
+ currentScroll: settings.feed.scrollLeft,
428
+ target: targetSlide,
429
+ direction
430
+ });
431
+ smoothScrollTo(targetSlide.offsetLeft);
432
+ };
433
+ const updateScrollPosition = () => {
434
+ updateScrollbarPosition();
435
+ updateControlsVisibility();
436
+ updateCurrentSlideIndex();
437
+ if (!state.isScrolling) {
438
+ updateActiveThumb(settings.thumbs, state.currentSlideIndex);
439
+ }
440
+ if (state.scrollEndTimeout) {
441
+ clearTimeout(state.scrollEndTimeout);
442
+ }
443
+ state.scrollEndTimeout = setTimeout(() => {
444
+ state.isScrolling = false;
445
+ settings.onScrollEnd?.({
446
+ currentScroll: settings.feed.scrollLeft,
447
+ currentSlideIndex: state.currentSlideIndex
448
+ });
449
+ }, ANIMATION.SCROLL_END_DELAY);
450
+ };
451
+ const handleFeedScroll = () => {
452
+ if (!state.ticking) {
453
+ requestAnimationFrame(() => {
454
+ updateScrollPosition();
455
+ state.ticking = false;
456
+ });
457
+ state.ticking = true;
458
+ }
459
+ };
460
+ const handleWindowResize = () => {
461
+ state.cachedFeedRect = null;
462
+ refresh();
463
+ };
464
+ const attachEventListeners = () => {
465
+ const { signal } = state.abortController;
466
+ window.addEventListener("resize", handleWindowResize);
467
+ settings.feed.addEventListener("scroll", handleFeedScroll, {
468
+ passive: true,
469
+ signal
470
+ });
471
+ if (settings.prevSlideButton) {
472
+ settings.prevSlideButton.addEventListener(
473
+ "click",
474
+ () => handleNavButtonClick("prev"),
475
+ { signal }
476
+ );
477
+ }
478
+ if (settings.nextSlideButton) {
479
+ settings.nextSlideButton.addEventListener(
480
+ "click",
481
+ () => handleNavButtonClick("next"),
482
+ { signal }
483
+ );
484
+ }
485
+ if (settings.thumbs?.length) {
486
+ settings.thumbs[0]?.classList.add("active");
487
+ settings.thumbs.forEach((thumb) => {
488
+ thumb.addEventListener("click", () => handleThumbClick(thumb), { signal });
489
+ });
490
+ }
491
+ setupKeyboardNavigation(
492
+ settings.feed,
493
+ () => handleNavButtonClick("prev"),
494
+ () => handleNavButtonClick("next"),
495
+ signal
496
+ );
497
+ if (settings.enableDragToScroll) {
498
+ dragState = setupDragToScroll({
499
+ feed: settings.feed,
500
+ slides: settings.slides,
501
+ abortSignal: signal,
502
+ smoothScrollTo,
503
+ onDragEnd: () => {
504
+ updateCurrentSlideIndex();
505
+ updateActiveThumb(settings.thumbs, state.currentSlideIndex);
506
+ }
507
+ });
508
+ }
509
+ if (settings.autoplay && settings.pauseOnHover !== false) {
510
+ settings.feed.addEventListener(
511
+ "mouseenter",
512
+ pauseAutoplay,
513
+ { signal }
514
+ );
515
+ settings.feed.addEventListener(
516
+ "mouseleave",
517
+ resumeAutoplay,
518
+ { signal }
519
+ );
520
+ settings.feed.addEventListener(
521
+ "touchstart",
522
+ pauseAutoplay,
523
+ { passive: true, signal }
524
+ );
525
+ settings.feed.addEventListener(
526
+ "touchend",
527
+ resumeAutoplay,
528
+ { signal }
529
+ );
530
+ }
531
+ };
532
+ const startAutoplay = () => {
533
+ if (state.autoplayIntervalId) return;
534
+ const interval = settings.autoplayInterval ?? 3e3;
535
+ state.autoplayIntervalId = setInterval(() => {
536
+ if (!state.autoplayPaused) {
537
+ handleNavButtonClick("next");
538
+ }
539
+ }, interval);
540
+ };
541
+ const stopAutoplay = () => {
542
+ if (state.autoplayIntervalId) {
543
+ clearInterval(state.autoplayIntervalId);
544
+ state.autoplayIntervalId = null;
545
+ }
546
+ };
547
+ const pauseAutoplay = () => {
548
+ state.autoplayPaused = true;
549
+ };
550
+ const resumeAutoplay = () => {
551
+ state.autoplayPaused = false;
552
+ };
553
+ const goToIndex = (index) => {
554
+ const visibleSlides = getVisibleSlides();
555
+ const safeIndex = Math.max(0, Math.min(index, visibleSlides.length - 1));
556
+ const targetSlide = visibleSlides[safeIndex];
557
+ if (!targetSlide) return;
558
+ state.currentSlideIndex = safeIndex;
559
+ updateActiveThumb(settings.thumbs, safeIndex);
560
+ smoothScrollTo(targetSlide.offsetLeft);
561
+ };
562
+ const refresh = () => {
563
+ state.cachedFeedRect = null;
564
+ applySlideWidths();
565
+ updateScrollbar();
566
+ updateControlsVisibility();
567
+ };
568
+ const unload = () => {
569
+ stopAutoplay();
570
+ state.abortController.abort();
571
+ window.removeEventListener("resize", handleWindowResize);
572
+ if (state.updateThumbTimeout) {
573
+ clearTimeout(state.updateThumbTimeout);
574
+ }
575
+ if (state.scrollEndTimeout) {
576
+ clearTimeout(state.scrollEndTimeout);
577
+ }
578
+ if (dragState) {
579
+ cleanupDrag(dragState);
580
+ }
581
+ state.cachedFeedRect = null;
582
+ };
583
+ initAria(settings);
584
+ applySlideWidths();
585
+ updateControlsVisibility();
586
+ attachEventListeners();
587
+ updateScrollbar();
588
+ if (settings.autoplay) {
589
+ startAutoplay();
590
+ }
591
+ return {
592
+ goToIndex,
593
+ refresh,
594
+ unload,
595
+ play: startAutoplay,
596
+ pause: stopAutoplay,
597
+ next: () => handleNavButtonClick("next"),
598
+ prev: () => handleNavButtonClick("prev")
599
+ };
600
+ };
5
601
  export {
6
- greet
602
+ createSlider,
603
+ easeInOutCubic,
604
+ easeOutCubic,
605
+ easeOutExpo,
606
+ easeOutQuad,
607
+ linear
7
608
  };
8
609
  //# sourceMappingURL=index.js.map