react-image-gallery 1.4.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.
@@ -0,0 +1,683 @@
1
+ /**
2
+ * React Image Gallery - Styles
3
+ *
4
+ * Design System: Base-4 spacing scale
5
+ * Spacing: 2, 4, 8, 12, 16, 20, 24, 32, 48, 64, 80, 96, 120px
6
+ *
7
+ * CSS Custom Properties for theming:
8
+ * --ig-primary-color: Primary/accent color (default: #337ab7)
9
+ * --ig-white: Icon and text color (default: #fff)
10
+ * --ig-black: Background color in fullscreen (default: #000)
11
+ * --ig-background-overlay: Overlay background (default: rgba(0, 0, 0, 0.4))
12
+ * --ig-thumbnail-size: Thumbnail dimensions (default: 96px)
13
+ * --ig-thumbnail-size-small: Thumbnail size on small screens (default: 80px)
14
+ * --ig-thumbnail-border-width: Thumbnail border width (default: 4px)
15
+ * --ig-thumbnail-border-width-small: Thumbnail border on small screens (default: 3px)
16
+ * --ig-bullet-size: Bullet size (default: 4px)
17
+ * --ig-bullet-size-small: Bullet size on small screens (default: 3px)
18
+ */
19
+
20
+ :root {
21
+ --ig-primary-color: #337ab7;
22
+ --ig-white: #fff;
23
+ --ig-black: #000;
24
+ --ig-background-overlay: rgba(0, 0, 0, 0.4);
25
+ --ig-thumbnail-size: 96px;
26
+ --ig-thumbnail-size-small: 80px;
27
+ --ig-thumbnail-border-width: 4px;
28
+ --ig-thumbnail-border-width-small: 3px;
29
+ --ig-bullet-size: 4px;
30
+ --ig-bullet-size-small: 3px;
31
+ }
32
+
33
+ /* ==========================================================================
34
+ SVG Icon Styles
35
+ ========================================================================== */
36
+
37
+ .image-gallery-icon {
38
+ color: var(--ig-white, #fff);
39
+ transition: all 0.3s ease-out;
40
+ appearance: none;
41
+ background-color: transparent;
42
+ border: 0;
43
+ cursor: pointer;
44
+ outline: none;
45
+ position: absolute;
46
+ z-index: 4;
47
+ filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
48
+ }
49
+
50
+ @media (hover: hover) and (pointer: fine) {
51
+ .image-gallery-icon:hover {
52
+ color: var(--ig-primary-color, #337ab7);
53
+ }
54
+ .image-gallery-icon:hover .image-gallery-svg {
55
+ transform: scale(1.1);
56
+ }
57
+ }
58
+
59
+ .image-gallery-icon:focus {
60
+ outline: 2px solid var(--ig-primary-color, #337ab7);
61
+ }
62
+
63
+ .image-gallery-using-mouse .image-gallery-icon:focus {
64
+ outline: none;
65
+ }
66
+
67
+ /* Fullscreen & Play buttons */
68
+ .image-gallery-fullscreen-button,
69
+ .image-gallery-play-button {
70
+ bottom: 0;
71
+ padding: 20px;
72
+ }
73
+
74
+ .image-gallery-fullscreen-button .image-gallery-svg,
75
+ .image-gallery-play-button .image-gallery-svg {
76
+ height: 32px;
77
+ width: 32px;
78
+ }
79
+
80
+ @media (max-width: 768px) {
81
+ .image-gallery-fullscreen-button,
82
+ .image-gallery-play-button {
83
+ padding: 16px;
84
+ }
85
+ .image-gallery-fullscreen-button .image-gallery-svg,
86
+ .image-gallery-play-button .image-gallery-svg {
87
+ height: 24px;
88
+ width: 24px;
89
+ }
90
+ }
91
+
92
+ @media (max-width: 480px) {
93
+ .image-gallery-fullscreen-button,
94
+ .image-gallery-play-button {
95
+ padding: 12px;
96
+ }
97
+ .image-gallery-fullscreen-button .image-gallery-svg,
98
+ .image-gallery-play-button .image-gallery-svg {
99
+ height: 16px;
100
+ width: 16px;
101
+ }
102
+ }
103
+
104
+ .image-gallery-fullscreen-button {
105
+ right: 0;
106
+ }
107
+
108
+ .image-gallery-play-button {
109
+ left: 0;
110
+ }
111
+
112
+ /* Top & Bottom navigation */
113
+ .image-gallery-top-nav,
114
+ .image-gallery-bottom-nav {
115
+ padding: 12px;
116
+ left: 50%;
117
+ transform: translateX(-50%);
118
+ }
119
+
120
+ .image-gallery-top-nav .image-gallery-svg,
121
+ .image-gallery-bottom-nav .image-gallery-svg {
122
+ height: 120px;
123
+ width: 96px;
124
+ }
125
+
126
+ @media (max-width: 768px) {
127
+ .image-gallery-top-nav .image-gallery-svg,
128
+ .image-gallery-bottom-nav .image-gallery-svg {
129
+ height: 72px;
130
+ width: 48px;
131
+ }
132
+ }
133
+
134
+ @media (max-width: 480px) {
135
+ .image-gallery-top-nav .image-gallery-svg,
136
+ .image-gallery-bottom-nav .image-gallery-svg {
137
+ height: 48px;
138
+ width: 32px;
139
+ }
140
+ }
141
+
142
+ .image-gallery-top-nav[disabled],
143
+ .image-gallery-bottom-nav[disabled] {
144
+ cursor: not-allowed;
145
+ opacity: 0.6;
146
+ pointer-events: none;
147
+ }
148
+
149
+ .image-gallery-top-nav {
150
+ top: 0;
151
+ }
152
+
153
+ .image-gallery-bottom-nav {
154
+ bottom: 0;
155
+ }
156
+
157
+ /* Left & Right navigation */
158
+ .image-gallery-left-nav,
159
+ .image-gallery-right-nav {
160
+ padding: 48px 12px;
161
+ top: 50%;
162
+ transform: translateY(-50%);
163
+ }
164
+
165
+ .image-gallery-left-nav .image-gallery-svg,
166
+ .image-gallery-right-nav .image-gallery-svg {
167
+ height: 120px;
168
+ width: 64px;
169
+ }
170
+
171
+ @media (max-width: 768px) {
172
+ .image-gallery-left-nav .image-gallery-svg,
173
+ .image-gallery-right-nav .image-gallery-svg {
174
+ height: 72px;
175
+ width: 32px;
176
+ }
177
+ }
178
+
179
+ @media (max-width: 480px) {
180
+ .image-gallery-left-nav .image-gallery-svg,
181
+ .image-gallery-right-nav .image-gallery-svg {
182
+ height: 48px;
183
+ width: 24px;
184
+ }
185
+ }
186
+
187
+ .image-gallery-left-nav[disabled],
188
+ .image-gallery-right-nav[disabled] {
189
+ cursor: not-allowed;
190
+ opacity: 0.6;
191
+ pointer-events: none;
192
+ }
193
+
194
+ .image-gallery-left-nav {
195
+ left: 0;
196
+ }
197
+
198
+ .image-gallery-right-nav {
199
+ right: 0;
200
+ }
201
+
202
+ /* ==========================================================================
203
+ Gallery Container
204
+ ========================================================================== */
205
+
206
+ .image-gallery {
207
+ -webkit-user-select: none;
208
+ -moz-user-select: none;
209
+ -ms-user-select: none;
210
+ user-select: none;
211
+ -webkit-tap-highlight-color: transparent;
212
+ position: relative;
213
+ /* Prevent mobile overscroll/pull-to-refresh */
214
+ overscroll-behavior: none;
215
+ -webkit-overflow-scrolling: touch;
216
+ }
217
+
218
+ .image-gallery.fullscreen-modal {
219
+ background: var(--ig-black, #000);
220
+ bottom: 0;
221
+ height: 100%;
222
+ left: 0;
223
+ position: fixed;
224
+ right: 0;
225
+ top: 0;
226
+ width: 100%;
227
+ z-index: 5;
228
+ }
229
+
230
+ .image-gallery.fullscreen-modal .image-gallery-content {
231
+ top: 50%;
232
+ transform: translateY(-50%);
233
+ }
234
+
235
+ /* ==========================================================================
236
+ Gallery Content
237
+ ========================================================================== */
238
+
239
+ .image-gallery-content {
240
+ position: relative;
241
+ line-height: 0;
242
+ top: 0;
243
+ }
244
+
245
+ .image-gallery-content.fullscreen {
246
+ background: var(--ig-black, #000);
247
+ }
248
+
249
+ .image-gallery-content .image-gallery-slide .image-gallery-image {
250
+ max-height: calc(100vh - 80px);
251
+ }
252
+
253
+ .image-gallery-content.image-gallery-thumbnails-left
254
+ .image-gallery-slide
255
+ .image-gallery-image,
256
+ .image-gallery-content.image-gallery-thumbnails-right
257
+ .image-gallery-slide
258
+ .image-gallery-image {
259
+ max-height: 100vh;
260
+ }
261
+
262
+ /* ==========================================================================
263
+ Slide Wrapper
264
+ ========================================================================== */
265
+
266
+ .image-gallery-slide-wrapper {
267
+ position: relative;
268
+ }
269
+
270
+ .image-gallery-slide-wrapper.image-gallery-thumbnails-left,
271
+ .image-gallery-slide-wrapper.image-gallery-thumbnails-right {
272
+ display: inline-block;
273
+ width: calc(100% - 112px);
274
+ }
275
+
276
+ @media (max-width: 768px) {
277
+ .image-gallery-slide-wrapper.image-gallery-thumbnails-left,
278
+ .image-gallery-slide-wrapper.image-gallery-thumbnails-right {
279
+ width: calc(100% - 88px);
280
+ }
281
+ }
282
+
283
+ .image-gallery-slide-wrapper.image-gallery-rtl {
284
+ direction: rtl;
285
+ }
286
+
287
+ .image-gallery-swipe {
288
+ overflow: hidden;
289
+ /* GPU acceleration */
290
+ -webkit-backface-visibility: hidden;
291
+ backface-visibility: hidden;
292
+ -webkit-transform: translateZ(0);
293
+ transform: translateZ(0);
294
+ /* Prevent overscroll during swipe */
295
+ overscroll-behavior: contain;
296
+ touch-action: pan-y pinch-zoom;
297
+ }
298
+
299
+ /* ==========================================================================
300
+ Slides
301
+ ========================================================================== */
302
+
303
+ .image-gallery-slides {
304
+ overflow: hidden;
305
+ position: relative;
306
+ touch-action: none;
307
+ /* GPU acceleration for smooth swiping */
308
+ -webkit-backface-visibility: hidden;
309
+ backface-visibility: hidden;
310
+ contain: layout style paint;
311
+ isolation: isolate;
312
+ overscroll-behavior: none;
313
+ }
314
+
315
+ /* Flex container that holds all slides and gets transformed */
316
+ .image-gallery-slides-container {
317
+ display: flex;
318
+ /* GPU acceleration for smooth swiping */
319
+ -webkit-backface-visibility: hidden;
320
+ backface-visibility: hidden;
321
+ -webkit-transform-style: preserve-3d;
322
+ transform-style: preserve-3d;
323
+ will-change: transform;
324
+ }
325
+
326
+ .image-gallery-slides-container.vertical {
327
+ flex-direction: column;
328
+ height: 100%;
329
+ }
330
+
331
+ .image-gallery-slides-container.vertical .image-gallery-slide {
332
+ flex: 0 0 100%;
333
+ height: 100%;
334
+ min-height: 0;
335
+ }
336
+
337
+ .image-gallery-slides-container.vertical
338
+ .image-gallery-slide
339
+ .image-gallery-image {
340
+ height: 100%;
341
+ width: auto;
342
+ max-width: 100%;
343
+ }
344
+
345
+ .image-gallery-slide {
346
+ flex: 0 0 100%;
347
+ min-width: 0;
348
+ /* GPU acceleration for smooth swiping */
349
+ -webkit-backface-visibility: hidden;
350
+ backface-visibility: hidden;
351
+ }
352
+
353
+ .image-gallery-slide .image-gallery-image {
354
+ width: 100%;
355
+ object-fit: contain;
356
+ }
357
+
358
+ .image-gallery-slide .image-gallery-description {
359
+ background: var(--ig-background-overlay, rgba(0, 0, 0, 0.4));
360
+ bottom: 72px;
361
+ color: var(--ig-white, #fff);
362
+ left: 0;
363
+ line-height: 1;
364
+ padding: 12px 20px;
365
+ position: absolute;
366
+ white-space: normal;
367
+ }
368
+
369
+ @media (max-width: 768px) {
370
+ .image-gallery-slide .image-gallery-description {
371
+ bottom: 48px;
372
+ font-size: 0.8em;
373
+ padding: 8px 16px;
374
+ }
375
+ }
376
+
377
+ /* ==========================================================================
378
+ Bullets
379
+ ========================================================================== */
380
+
381
+ .image-gallery-bullets {
382
+ bottom: 20px;
383
+ left: 0;
384
+ margin: 0 auto;
385
+ position: absolute;
386
+ right: 0;
387
+ width: 80%;
388
+ z-index: 4;
389
+ }
390
+
391
+ .image-gallery-bullets .image-gallery-bullets-container {
392
+ margin: 0;
393
+ padding: 0;
394
+ text-align: center;
395
+ }
396
+
397
+ .image-gallery-bullets .image-gallery-bullet {
398
+ appearance: none;
399
+ background-color: transparent;
400
+ border: 1px solid var(--ig-white, #fff);
401
+ border-radius: 50%;
402
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
403
+ cursor: pointer;
404
+ display: inline-block;
405
+ margin: 0 4px;
406
+ outline: none;
407
+ padding: var(--ig-bullet-size, 4px);
408
+ transition: all 0.2s ease-out;
409
+ }
410
+
411
+ @media (max-width: 768px) {
412
+ .image-gallery-bullets .image-gallery-bullet {
413
+ margin: 0 3px;
414
+ padding: var(--ig-bullet-size-small, 3px);
415
+ }
416
+ }
417
+
418
+ @media (max-width: 480px) {
419
+ .image-gallery-bullets .image-gallery-bullet {
420
+ padding: 3px;
421
+ }
422
+ }
423
+
424
+ .image-gallery-bullets .image-gallery-bullet:focus {
425
+ transform: scale(1.2);
426
+ background: var(--ig-primary-color, #337ab7);
427
+ border: 1px solid var(--ig-primary-color, #337ab7);
428
+ }
429
+
430
+ .image-gallery-bullets .image-gallery-bullet.active {
431
+ transform: scale(1.2);
432
+ border: 1px solid var(--ig-white, #fff);
433
+ background: var(--ig-white, #fff);
434
+ }
435
+
436
+ @media (hover: hover) and (pointer: fine) {
437
+ .image-gallery-bullets .image-gallery-bullet:hover {
438
+ background: var(--ig-primary-color, #337ab7);
439
+ border: 1px solid var(--ig-primary-color, #337ab7);
440
+ }
441
+ .image-gallery-bullets .image-gallery-bullet.active:hover {
442
+ background: var(--ig-primary-color, #337ab7);
443
+ }
444
+ }
445
+
446
+ /* Vertical bullets */
447
+ .image-gallery-bullets.image-gallery-bullets-vertical {
448
+ left: 20px;
449
+ right: auto;
450
+ bottom: auto;
451
+ width: auto;
452
+ top: 50%;
453
+ transform: translateY(-50%);
454
+ }
455
+
456
+ .image-gallery-bullets.image-gallery-bullets-vertical .image-gallery-bullet {
457
+ display: block;
458
+ margin: 12px 0;
459
+ }
460
+
461
+ @media (max-width: 768px) {
462
+ .image-gallery-bullets.image-gallery-bullets-vertical .image-gallery-bullet {
463
+ margin: 8px 0;
464
+ padding: var(--ig-bullet-size-small, 3px);
465
+ }
466
+ }
467
+
468
+ @media (max-width: 480px) {
469
+ .image-gallery-bullets.image-gallery-bullets-vertical .image-gallery-bullet {
470
+ padding: 3px;
471
+ }
472
+ }
473
+
474
+ /* ==========================================================================
475
+ Thumbnails Wrapper
476
+ ========================================================================== */
477
+
478
+ .image-gallery-thumbnails-wrapper {
479
+ position: relative;
480
+ }
481
+
482
+ .image-gallery-thumbnails-wrapper.thumbnails-swipe-horizontal {
483
+ touch-action: pan-y;
484
+ }
485
+
486
+ .image-gallery-thumbnails-wrapper.thumbnails-swipe-vertical {
487
+ touch-action: pan-x;
488
+ }
489
+
490
+ .image-gallery-thumbnails-wrapper.thumbnails-wrapper-rtl {
491
+ direction: rtl;
492
+ }
493
+
494
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
495
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
496
+ display: inline-block;
497
+ vertical-align: top;
498
+ width: var(--ig-thumbnail-size, 96px);
499
+ }
500
+
501
+ @media (max-width: 768px) {
502
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
503
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
504
+ width: var(--ig-thumbnail-size-small, 80px);
505
+ }
506
+ }
507
+
508
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left
509
+ .image-gallery-thumbnails,
510
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right
511
+ .image-gallery-thumbnails {
512
+ height: 100%;
513
+ width: 100%;
514
+ left: 0;
515
+ padding: 0;
516
+ position: absolute;
517
+ top: 0;
518
+ }
519
+
520
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left
521
+ .image-gallery-thumbnails
522
+ .image-gallery-thumbnail,
523
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right
524
+ .image-gallery-thumbnails
525
+ .image-gallery-thumbnail {
526
+ display: block;
527
+ margin-right: 0;
528
+ padding: 0;
529
+ }
530
+
531
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left
532
+ .image-gallery-thumbnails
533
+ .image-gallery-thumbnail
534
+ + .image-gallery-thumbnail,
535
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right
536
+ .image-gallery-thumbnails
537
+ .image-gallery-thumbnail
538
+ + .image-gallery-thumbnail {
539
+ margin-left: 0;
540
+ margin-top: 2px;
541
+ }
542
+
543
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
544
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
545
+ margin: 0 4px;
546
+ }
547
+
548
+ @media (max-width: 768px) {
549
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
550
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
551
+ margin: 0 4px;
552
+ }
553
+ }
554
+
555
+ /* ==========================================================================
556
+ Thumbnails
557
+ ========================================================================== */
558
+
559
+ .image-gallery-thumbnails {
560
+ overflow: hidden;
561
+ padding: 4px 0;
562
+ }
563
+
564
+ @media (max-width: 768px) {
565
+ .image-gallery-thumbnails {
566
+ padding: 4px 0;
567
+ }
568
+ }
569
+
570
+ .image-gallery-thumbnails .image-gallery-thumbnails-container {
571
+ cursor: pointer;
572
+ text-align: center;
573
+ white-space: nowrap;
574
+ }
575
+
576
+ .image-gallery-thumbnail {
577
+ display: inline-block;
578
+ border: var(--ig-thumbnail-border-width, 4px) solid transparent;
579
+ transition: border 0.3s ease-out;
580
+ width: var(--ig-thumbnail-size, 96px);
581
+ background: transparent;
582
+ padding: 0;
583
+ }
584
+
585
+ @media (max-width: 768px) {
586
+ .image-gallery-thumbnail {
587
+ border: var(--ig-thumbnail-border-width-small, 3px) solid transparent;
588
+ width: var(--ig-thumbnail-size-small, 80px);
589
+ }
590
+ }
591
+
592
+ .image-gallery-thumbnail + .image-gallery-thumbnail {
593
+ margin-left: 2px;
594
+ }
595
+
596
+ .image-gallery-thumbnail .image-gallery-thumbnail-inner {
597
+ display: block;
598
+ position: relative;
599
+ }
600
+
601
+ .image-gallery-thumbnail .image-gallery-thumbnail-image {
602
+ vertical-align: middle;
603
+ width: 100%;
604
+ line-height: 0;
605
+ }
606
+
607
+ .image-gallery-thumbnail.active,
608
+ .image-gallery-thumbnail:focus {
609
+ outline: none;
610
+ border: var(--ig-thumbnail-border-width, 4px) solid
611
+ var(--ig-primary-color, #337ab7);
612
+ }
613
+
614
+ @media (max-width: 768px) {
615
+ .image-gallery-thumbnail.active,
616
+ .image-gallery-thumbnail:focus {
617
+ border: var(--ig-thumbnail-border-width-small, 3px) solid
618
+ var(--ig-primary-color, #337ab7);
619
+ }
620
+ }
621
+
622
+ @media (hover: hover) and (pointer: fine) {
623
+ .image-gallery-thumbnail:hover {
624
+ outline: none;
625
+ border: var(--ig-thumbnail-border-width, 4px) solid
626
+ var(--ig-primary-color, #337ab7);
627
+ }
628
+ }
629
+
630
+ @media (hover: hover) and (pointer: fine) and (max-width: 768px) {
631
+ .image-gallery-thumbnail:hover {
632
+ border: var(--ig-thumbnail-border-width-small, 3px) solid
633
+ var(--ig-primary-color, #337ab7);
634
+ }
635
+ }
636
+
637
+ /* ==========================================================================
638
+ Thumbnail Label
639
+ ========================================================================== */
640
+
641
+ .image-gallery-thumbnail-label {
642
+ box-sizing: border-box;
643
+ color: var(--ig-white, #fff);
644
+ font-size: 1em;
645
+ left: 0;
646
+ line-height: 1em;
647
+ padding: 5%;
648
+ position: absolute;
649
+ top: 50%;
650
+ text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
651
+ transform: translateY(-50%);
652
+ white-space: normal;
653
+ width: 100%;
654
+ }
655
+
656
+ @media (max-width: 768px) {
657
+ .image-gallery-thumbnail-label {
658
+ font-size: 0.8em;
659
+ line-height: 0.8em;
660
+ }
661
+ }
662
+
663
+ /* ==========================================================================
664
+ Index Display
665
+ ========================================================================== */
666
+
667
+ .image-gallery-index {
668
+ background: var(--ig-background-overlay, rgba(0, 0, 0, 0.4));
669
+ color: var(--ig-white, #fff);
670
+ line-height: 1;
671
+ padding: 10px 20px;
672
+ position: absolute;
673
+ right: 0;
674
+ top: 0;
675
+ z-index: 4;
676
+ }
677
+
678
+ @media (max-width: 768px) {
679
+ .image-gallery-index {
680
+ font-size: 0.8em;
681
+ padding: 5px 10px;
682
+ }
683
+ }