@jocampo3/slider 1.0.3 → 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/README.md +25 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,12 +36,35 @@ const slides = document.querySelectorAll('.slideshow');
|
|
|
36
36
|
slides.forEach(s => new Slider(s, interval));
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
## Example
|
|
40
|
+
```html
|
|
41
|
+
<div class="slideshow">
|
|
42
|
+
<figure>
|
|
43
|
+
<!-- self-referenced link -->
|
|
44
|
+
<a id="a-classic" href="#a-classic">
|
|
45
|
+
<img loading="lazy" src="https://cadars.github.io/photosheet/img/john-margolies/A classic.jpg" alt="A classic" title="A classic" />
|
|
46
|
+
</a>
|
|
47
|
+
</figure>
|
|
48
|
+
|
|
49
|
+
<div>
|
|
50
|
+
<a id="hello-world" href="#hello-world">
|
|
51
|
+
<h1>Hello World</h1>
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## How it works
|
|
59
|
+
|
|
60
|
+
Slider uses native CSS scroll snap for positioning and smooth scrolling transitions. The slider auto-advances through slides based on the interval, pauses on hover, and syncs with manual scrolling.
|
|
61
|
+
|
|
39
62
|
## Features
|
|
40
63
|
|
|
41
64
|
- Lightweight (~1KB gzipped)
|
|
42
65
|
- Zero dependencies
|
|
43
|
-
-
|
|
44
|
-
-
|
|
66
|
+
- Native scroll snap positioning
|
|
67
|
+
- Smooth scroll transitions
|
|
45
68
|
|
|
46
69
|
## License
|
|
47
70
|
|