neiki-gallery 1.0.0 → 2.0.0
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 +116 -46
- package/dist/neiki-gallery.css +728 -137
- package/dist/neiki-gallery.js +596 -226
- package/dist/neiki-gallery.min.css +1 -1
- package/dist/neiki-gallery.min.js +2 -2
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<img src="https://img.shields.io/badge/css-%23663399.svg?style=for-the-badge&logo=css&logoColor=white" alt="CSS">
|
|
11
11
|
<br>
|
|
12
12
|
<img src="https://img.shields.io/badge/License-MIT-2563EB?style=for-the-badge&logo=open-source-initiative&logoColor=white&labelColor=000F15&logoWidth=20" alt="License">
|
|
13
|
-
<img src="https://img.shields.io/badge/Version-
|
|
13
|
+
<img src="https://img.shields.io/badge/Version-2.0.0-2563EB?style=for-the-badge&logo=semantic-release&logoColor=white&labelColor=000F15&logoWidth=20" alt="Version">
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
21
|
<p align="center">
|
|
22
|
-
<img src="https://img.shields.io/badge/Layouts-Masonry%20%
|
|
22
|
+
<img src="https://img.shields.io/badge/Layouts-Masonry%20·%20Grid%20·%20Mosaic%20·%20Filmstrip-3b82f6?style=flat&labelColor=383C43" />
|
|
23
23
|
<img src="https://img.shields.io/badge/Themes-Light%20%26%20Dark-8b5cf6?style=flat&labelColor=383C43" />
|
|
24
24
|
<img src="https://img.shields.io/badge/Setup-Zero%20Config-22c55e?style=flat&labelColor=383C43" />
|
|
25
25
|
<img src="https://img.shields.io/badge/Size-Lightweight-f97316?style=flat&labelColor=383C43" />
|
|
@@ -33,26 +33,30 @@
|
|
|
33
33
|
|
|
34
34
|
## ✨ Features
|
|
35
35
|
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
36
|
+
- **4 Layouts** — Masonry, Grid, Mosaic (`data-size`), and Filmstrip (horizontal scroll)
|
|
37
|
+
- **Glassmorphism lightbox** — backdrop-blur overlay with floating toolbar
|
|
38
|
+
- **Slideshow / Autoplay** — animated progress bar, play/pause, configurable interval
|
|
39
|
+
- **Comparison slider** — `NeikiGallery.compare()` for before/after image comparison
|
|
40
|
+
- **Share popup** — copy link to clipboard or download image from lightbox
|
|
41
|
+
- **Contextual zoom** — zoom to clicked point with pan support
|
|
42
|
+
- **Batch select** — Shift+click multi-select with checkmark overlays
|
|
43
|
+
- **Tag filtering** — auto-generated pill filter bar from `data-tags`
|
|
44
|
+
- **Staggered entrance** — sequential fade-in animation on load
|
|
45
|
+
- **Keyboard navigation** — arrows, Escape, Home/End, F (fullscreen), Space (slideshow)
|
|
46
|
+
- **Touch / swipe** — mobile-friendly left/right swipe navigation
|
|
47
|
+
- **Lazy loading** — IntersectionObserver with shimmer placeholders
|
|
48
|
+
- **Image captions** — bottom-sheet style on mobile
|
|
49
|
+
- **Thumbnail strip** — scrollable thumbnails with scale hover effect
|
|
50
|
+
- **Zoom** — click to toggle zoom, or contextual zoom to cursor point
|
|
51
|
+
- **Fullscreen** — native Fullscreen API
|
|
52
|
+
- **Pill counter** — glassmorphism pill-shaped counter badge
|
|
53
|
+
- **Toast notifications** — for share/copy actions
|
|
54
|
+
- **Deep linking** — URL hash navigation
|
|
48
55
|
- **Multiple instances** — independent galleries on one page
|
|
49
|
-
- **Dark & light themes** —
|
|
56
|
+
- **Dark & light themes** — CSS custom properties + accent color system (`--neiki-accent`)
|
|
50
57
|
- **Accessibility** — ARIA attributes, focus management, `prefers-reduced-motion`
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
53
|
-
- **Event system** — `open`, `close`, `change` events
|
|
54
|
-
- **Clean destroy** — full cleanup of DOM nodes and event listeners
|
|
55
|
-
- **Cross-browser** — Chrome, Firefox, Safari, Edge
|
|
58
|
+
- **Event system** — `open`, `close`, `change`, `filter`, `select`, `slideshowStart`, `slideshowStop`
|
|
59
|
+
- **Cross-browser** — Chrome 60+, Firefox 55+, Safari 12+, Edge 79+
|
|
56
60
|
|
|
57
61
|
## 🚀 Quick Start
|
|
58
62
|
|
|
@@ -88,8 +92,8 @@ That's it — galleries with `data-neiki-gallery` auto-initialize on page load.
|
|
|
88
92
|
|
|
89
93
|
> **Pin a specific version** to avoid unexpected changes:
|
|
90
94
|
> ```
|
|
91
|
-
> http://cdn.neiki.eu/neiki-gallery/
|
|
92
|
-
> http://cdn.neiki.eu/neiki-gallery/
|
|
95
|
+
> http://cdn.neiki.eu/neiki-gallery/2.0.0/neiki-gallery.min.js
|
|
96
|
+
> http://cdn.neiki.eu/neiki-gallery/2.0.0/neiki-gallery.min.css
|
|
93
97
|
> ```
|
|
94
98
|
|
|
95
99
|
### Self-Hosting (Local)
|
|
@@ -120,14 +124,21 @@ The `dist/` folder contains both minified and unminified versions:
|
|
|
120
124
|
|
|
121
125
|
```js
|
|
122
126
|
const gallery = new NeikiGallery('#my-gallery', {
|
|
123
|
-
layout: 'masonry',
|
|
127
|
+
layout: 'masonry', // 'masonry' | 'grid' | 'mosaic' | 'filmstrip'
|
|
124
128
|
loop: true,
|
|
125
129
|
thumbnails: true,
|
|
126
130
|
zoom: true,
|
|
131
|
+
contextualZoom: false, // zoom to click point
|
|
127
132
|
fullscreen: true,
|
|
128
|
-
transition: 'fade',
|
|
129
|
-
theme: 'dark',
|
|
133
|
+
transition: 'fade', // 'fade' | 'slide'
|
|
134
|
+
theme: 'dark', // 'dark' | 'light'
|
|
130
135
|
hashNavigation: true,
|
|
136
|
+
stagger: true, // entrance animation
|
|
137
|
+
slideshow: false, // auto-start slideshow on open
|
|
138
|
+
slideshowInterval: 4000, // ms between slides
|
|
139
|
+
share: true, // share/download popup
|
|
140
|
+
filter: false, // tag filtering
|
|
141
|
+
batchSelect: false, // Shift+click multi-select
|
|
131
142
|
});
|
|
132
143
|
```
|
|
133
144
|
|
|
@@ -136,11 +147,33 @@ const gallery = new NeikiGallery('#my-gallery', {
|
|
|
136
147
|
### Methods
|
|
137
148
|
|
|
138
149
|
```js
|
|
139
|
-
gallery.open(index);
|
|
140
|
-
gallery.close();
|
|
141
|
-
gallery.next();
|
|
142
|
-
gallery.prev();
|
|
143
|
-
gallery.
|
|
150
|
+
gallery.open(index); // Open lightbox at image index
|
|
151
|
+
gallery.close(); // Close lightbox
|
|
152
|
+
gallery.next(); // Go to next image
|
|
153
|
+
gallery.prev(); // Go to previous image
|
|
154
|
+
gallery.startSlideshow(); // Start autoplay
|
|
155
|
+
gallery.stopSlideshow(); // Stop autoplay
|
|
156
|
+
gallery.toggleSlideshow(); // Toggle autoplay
|
|
157
|
+
gallery.filter('landscape'); // Filter by tag (null = show all)
|
|
158
|
+
gallery.getSelected(); // Get batch-selected items
|
|
159
|
+
gallery.clearSelection(); // Clear batch selection
|
|
160
|
+
gallery.destroy(); // Remove gallery, clean up all listeners & DOM
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Static Utilities
|
|
164
|
+
|
|
165
|
+
```js
|
|
166
|
+
// Comparison slider
|
|
167
|
+
const slider = NeikiGallery.compare('#compare-container', {
|
|
168
|
+
before: 'before.jpg',
|
|
169
|
+
after: 'after.jpg',
|
|
170
|
+
labelBefore: 'Before',
|
|
171
|
+
labelAfter: 'After',
|
|
172
|
+
startPosition: 50
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
slider.setPosition(30); // Move handle to 30%
|
|
176
|
+
slider.destroy(); // Clean up
|
|
144
177
|
```
|
|
145
178
|
|
|
146
179
|
### Events
|
|
@@ -157,24 +190,43 @@ gallery.on('close', () => {
|
|
|
157
190
|
gallery.on('change', (index) => {
|
|
158
191
|
console.log('Now showing image', index);
|
|
159
192
|
});
|
|
193
|
+
|
|
194
|
+
gallery.on('filter', (tag) => {
|
|
195
|
+
console.log('Filtered by:', tag);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
gallery.on('select', (indices) => {
|
|
199
|
+
console.log('Selected:', indices);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
gallery.on('slideshowStart', () => {
|
|
203
|
+
console.log('Slideshow started');
|
|
204
|
+
});
|
|
160
205
|
```
|
|
161
206
|
|
|
162
207
|
### Options
|
|
163
208
|
|
|
164
209
|
| Option | Type | Default | Description |
|
|
165
210
|
|--------|------|---------|-------------|
|
|
166
|
-
| `layout` | `string` | `'masonry'` |
|
|
211
|
+
| `layout` | `string` | `'masonry'` | `'masonry'` · `'grid'` · `'mosaic'` · `'filmstrip'` |
|
|
167
212
|
| `loop` | `boolean` | `false` | Enable infinite loop navigation |
|
|
168
213
|
| `thumbnails` | `boolean` | `true` | Show thumbnail strip in lightbox |
|
|
169
214
|
| `zoom` | `boolean` | `true` | Enable zoom on image click |
|
|
215
|
+
| `contextualZoom` | `boolean` | `false` | Zoom to cursor point instead of center |
|
|
170
216
|
| `fullscreen` | `boolean` | `true` | Show fullscreen button |
|
|
171
|
-
| `transition` | `string` | `'fade'` |
|
|
172
|
-
| `theme` | `string` | `'dark'` |
|
|
173
|
-
| `hashNavigation` | `boolean` | `true` |
|
|
217
|
+
| `transition` | `string` | `'fade'` | `'fade'` or `'slide'` |
|
|
218
|
+
| `theme` | `string` | `'dark'` | `'dark'` or `'light'` |
|
|
219
|
+
| `hashNavigation` | `boolean` | `true` | URL hash deep linking |
|
|
174
220
|
| `counter` | `boolean` | `true` | Show image counter |
|
|
175
221
|
| `captions` | `boolean` | `true` | Show image captions |
|
|
176
|
-
| `preload` | `number` | `1` |
|
|
222
|
+
| `preload` | `number` | `1` | Adjacent images to preload |
|
|
177
223
|
| `lazyLoad` | `boolean` | `true` | Lazy load grid thumbnails |
|
|
224
|
+
| `stagger` | `boolean` | `true` | Staggered entrance animation |
|
|
225
|
+
| `slideshow` | `boolean` | `false` | Auto-start slideshow on open |
|
|
226
|
+
| `slideshowInterval` | `number` | `4000` | Slideshow interval in ms |
|
|
227
|
+
| `share` | `boolean` | `true` | Show share button in lightbox |
|
|
228
|
+
| `filter` | `boolean` | `false` | Enable tag filtering bar |
|
|
229
|
+
| `batchSelect` | `boolean` | `false` | Enable Shift+click multi-select |
|
|
178
230
|
|
|
179
231
|
### Data Attributes
|
|
180
232
|
|
|
@@ -182,14 +234,21 @@ All options can also be set via `data-` attributes on the container:
|
|
|
182
234
|
|
|
183
235
|
```html
|
|
184
236
|
<div data-neiki-gallery
|
|
185
|
-
data-layout="
|
|
237
|
+
data-layout="mosaic"
|
|
186
238
|
data-theme="light"
|
|
187
239
|
data-transition="slide"
|
|
188
240
|
data-loop="true"
|
|
189
|
-
data-
|
|
190
|
-
data-
|
|
191
|
-
data-
|
|
192
|
-
data-
|
|
241
|
+
data-stagger="true"
|
|
242
|
+
data-slideshow="false"
|
|
243
|
+
data-slideshow-interval="5000"
|
|
244
|
+
data-share="true"
|
|
245
|
+
data-filter="true"
|
|
246
|
+
data-batch-select="false"
|
|
247
|
+
data-contextual-zoom="true">
|
|
248
|
+
<a href="full.jpg" data-tags="landscape,nature" data-size="large">
|
|
249
|
+
<img src="thumb.jpg" alt="Photo">
|
|
250
|
+
</a>
|
|
251
|
+
</div>
|
|
193
252
|
```
|
|
194
253
|
|
|
195
254
|
## 🎨 Theming
|
|
@@ -199,15 +258,20 @@ Neiki Gallery uses CSS custom properties for full theming control:
|
|
|
199
258
|
```css
|
|
200
259
|
:root {
|
|
201
260
|
--neiki-columns: 4;
|
|
202
|
-
--neiki-gap:
|
|
203
|
-
--neiki-border-radius:
|
|
204
|
-
--neiki-
|
|
205
|
-
--neiki-
|
|
261
|
+
--neiki-gap: 14px;
|
|
262
|
+
--neiki-border-radius: 14px;
|
|
263
|
+
--neiki-accent: #3b82f6;
|
|
264
|
+
--neiki-overlay-bg: rgba(8, 8, 12, 0.85);
|
|
265
|
+
--neiki-overlay-backdrop: blur(24px) saturate(1.2);
|
|
266
|
+
--neiki-btn-bg: rgba(255, 255, 255, 0.1);
|
|
206
267
|
--neiki-btn-color: #fff;
|
|
207
268
|
--neiki-caption-color: #fff;
|
|
208
|
-
--neiki-spinner-color:
|
|
209
|
-
--neiki-thumb-size:
|
|
269
|
+
--neiki-spinner-color: var(--neiki-accent);
|
|
270
|
+
--neiki-thumb-size: 52px;
|
|
210
271
|
--neiki-zoom-scale: 2;
|
|
272
|
+
--neiki-stagger-delay: 0.04s;
|
|
273
|
+
--neiki-hover-lift: -4px;
|
|
274
|
+
--neiki-hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
|
|
211
275
|
--neiki-transition-duration: 0.3s;
|
|
212
276
|
/* ... and more */
|
|
213
277
|
}
|
|
@@ -231,3 +295,9 @@ This project is licensed under the MIT License — see the [LICENSE](LICENSE) fi
|
|
|
231
295
|
## 📬 Contact
|
|
232
296
|
|
|
233
297
|
- **Email:** [dev@neiki.eu](mailto:dev@neiki.eu)
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
<p align="center">
|
|
302
|
+
Made with ❤️ for the web community
|
|
303
|
+
</p>
|