react-image-gallery 1.4.0 → 2.0.1

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,701 @@
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
+ text-align: center;
390
+ }
391
+
392
+ .image-gallery-bullets .image-gallery-bullets-container {
393
+ margin: 0 auto;
394
+ padding: 0;
395
+ display: inline-block;
396
+ }
397
+
398
+ .image-gallery-bullets .image-gallery-bullets-inner {
399
+ display: flex;
400
+ align-items: center;
401
+ justify-content: flex-start;
402
+ white-space: nowrap;
403
+ padding: 2px 0;
404
+ }
405
+
406
+ .image-gallery-bullets-vertical .image-gallery-bullets-inner {
407
+ flex-direction: column;
408
+ padding: 0 2px;
409
+ }
410
+
411
+ .image-gallery-bullets .image-gallery-bullet {
412
+ appearance: none;
413
+ background-color: transparent;
414
+ border: 1px solid var(--ig-white, #fff);
415
+ border-radius: 50%;
416
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
417
+ cursor: pointer;
418
+ margin: 0 4px;
419
+ outline: none;
420
+ width: calc(var(--ig-bullet-size, 4px) * 2 + 2px);
421
+ height: calc(var(--ig-bullet-size, 4px) * 2 + 2px);
422
+ padding: 0;
423
+ flex-shrink: 0;
424
+ transition: all 0.2s ease-out;
425
+ }
426
+
427
+ @media (max-width: 768px) {
428
+ .image-gallery-bullets .image-gallery-bullet {
429
+ margin: 0 3px;
430
+ width: calc(var(--ig-bullet-size-small, 3px) * 2 + 2px);
431
+ height: calc(var(--ig-bullet-size-small, 3px) * 2 + 2px);
432
+ }
433
+ }
434
+
435
+ @media (max-width: 480px) {
436
+ .image-gallery-bullets .image-gallery-bullet {
437
+ width: 8px;
438
+ height: 8px;
439
+ }
440
+ }
441
+
442
+ .image-gallery-bullets .image-gallery-bullet:focus {
443
+ transform: scale(1.2);
444
+ background: var(--ig-primary-color, #337ab7);
445
+ border: 1px solid var(--ig-primary-color, #337ab7);
446
+ }
447
+
448
+ .image-gallery-bullets .image-gallery-bullet.active {
449
+ transform: scale(1.2);
450
+ border: 1px solid var(--ig-white, #fff);
451
+ background: var(--ig-white, #fff);
452
+ }
453
+
454
+ @media (hover: hover) and (pointer: fine) {
455
+ .image-gallery-bullets .image-gallery-bullet:hover {
456
+ background: var(--ig-primary-color, #337ab7);
457
+ border: 1px solid var(--ig-primary-color, #337ab7);
458
+ }
459
+ .image-gallery-bullets .image-gallery-bullet.active:hover {
460
+ background: var(--ig-primary-color, #337ab7);
461
+ }
462
+ }
463
+
464
+ /* Vertical bullets */
465
+ .image-gallery-bullets.image-gallery-bullets-vertical {
466
+ left: 20px;
467
+ right: auto;
468
+ bottom: auto;
469
+ width: auto;
470
+ top: 50%;
471
+ transform: translateY(-50%);
472
+ }
473
+
474
+ .image-gallery-bullets.image-gallery-bullets-vertical .image-gallery-bullet {
475
+ display: block;
476
+ margin: 12px 0;
477
+ }
478
+
479
+ @media (max-width: 768px) {
480
+ .image-gallery-bullets.image-gallery-bullets-vertical .image-gallery-bullet {
481
+ margin: 8px 0;
482
+ padding: var(--ig-bullet-size-small, 3px);
483
+ }
484
+ }
485
+
486
+ @media (max-width: 480px) {
487
+ .image-gallery-bullets.image-gallery-bullets-vertical .image-gallery-bullet {
488
+ padding: 3px;
489
+ }
490
+ }
491
+
492
+ /* ==========================================================================
493
+ Thumbnails Wrapper
494
+ ========================================================================== */
495
+
496
+ .image-gallery-thumbnails-wrapper {
497
+ position: relative;
498
+ }
499
+
500
+ .image-gallery-thumbnails-wrapper.thumbnails-swipe-horizontal {
501
+ touch-action: pan-y;
502
+ }
503
+
504
+ .image-gallery-thumbnails-wrapper.thumbnails-swipe-vertical {
505
+ touch-action: pan-x;
506
+ }
507
+
508
+ .image-gallery-thumbnails-wrapper.thumbnails-wrapper-rtl {
509
+ direction: rtl;
510
+ }
511
+
512
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
513
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
514
+ display: inline-block;
515
+ vertical-align: top;
516
+ width: var(--ig-thumbnail-size, 96px);
517
+ }
518
+
519
+ @media (max-width: 768px) {
520
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
521
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
522
+ width: var(--ig-thumbnail-size-small, 80px);
523
+ }
524
+ }
525
+
526
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left
527
+ .image-gallery-thumbnails,
528
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right
529
+ .image-gallery-thumbnails {
530
+ height: 100%;
531
+ width: 100%;
532
+ left: 0;
533
+ padding: 0;
534
+ position: absolute;
535
+ top: 0;
536
+ }
537
+
538
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left
539
+ .image-gallery-thumbnails
540
+ .image-gallery-thumbnail,
541
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right
542
+ .image-gallery-thumbnails
543
+ .image-gallery-thumbnail {
544
+ display: block;
545
+ margin-right: 0;
546
+ padding: 0;
547
+ }
548
+
549
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left
550
+ .image-gallery-thumbnails
551
+ .image-gallery-thumbnail
552
+ + .image-gallery-thumbnail,
553
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right
554
+ .image-gallery-thumbnails
555
+ .image-gallery-thumbnail
556
+ + .image-gallery-thumbnail {
557
+ margin-left: 0;
558
+ margin-top: 2px;
559
+ }
560
+
561
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
562
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
563
+ margin: 0 4px;
564
+ }
565
+
566
+ @media (max-width: 768px) {
567
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,
568
+ .image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right {
569
+ margin: 0 4px;
570
+ }
571
+ }
572
+
573
+ /* ==========================================================================
574
+ Thumbnails
575
+ ========================================================================== */
576
+
577
+ .image-gallery-thumbnails {
578
+ overflow: hidden;
579
+ padding: 4px 0;
580
+ }
581
+
582
+ @media (max-width: 768px) {
583
+ .image-gallery-thumbnails {
584
+ padding: 4px 0;
585
+ }
586
+ }
587
+
588
+ .image-gallery-thumbnails .image-gallery-thumbnails-container {
589
+ cursor: pointer;
590
+ text-align: center;
591
+ white-space: nowrap;
592
+ }
593
+
594
+ .image-gallery-thumbnail {
595
+ display: inline-block;
596
+ border: var(--ig-thumbnail-border-width, 4px) solid transparent;
597
+ transition: border 0.3s ease-out;
598
+ width: var(--ig-thumbnail-size, 96px);
599
+ background: transparent;
600
+ padding: 0;
601
+ }
602
+
603
+ @media (max-width: 768px) {
604
+ .image-gallery-thumbnail {
605
+ border: var(--ig-thumbnail-border-width-small, 3px) solid transparent;
606
+ width: var(--ig-thumbnail-size-small, 80px);
607
+ }
608
+ }
609
+
610
+ .image-gallery-thumbnail + .image-gallery-thumbnail {
611
+ margin-left: 2px;
612
+ }
613
+
614
+ .image-gallery-thumbnail .image-gallery-thumbnail-inner {
615
+ display: block;
616
+ position: relative;
617
+ }
618
+
619
+ .image-gallery-thumbnail .image-gallery-thumbnail-image {
620
+ vertical-align: middle;
621
+ width: 100%;
622
+ line-height: 0;
623
+ }
624
+
625
+ .image-gallery-thumbnail.active,
626
+ .image-gallery-thumbnail:focus {
627
+ outline: none;
628
+ border: var(--ig-thumbnail-border-width, 4px) solid
629
+ var(--ig-primary-color, #337ab7);
630
+ }
631
+
632
+ @media (max-width: 768px) {
633
+ .image-gallery-thumbnail.active,
634
+ .image-gallery-thumbnail:focus {
635
+ border: var(--ig-thumbnail-border-width-small, 3px) solid
636
+ var(--ig-primary-color, #337ab7);
637
+ }
638
+ }
639
+
640
+ @media (hover: hover) and (pointer: fine) {
641
+ .image-gallery-thumbnail:hover {
642
+ outline: none;
643
+ border: var(--ig-thumbnail-border-width, 4px) solid
644
+ var(--ig-primary-color, #337ab7);
645
+ }
646
+ }
647
+
648
+ @media (hover: hover) and (pointer: fine) and (max-width: 768px) {
649
+ .image-gallery-thumbnail:hover {
650
+ border: var(--ig-thumbnail-border-width-small, 3px) solid
651
+ var(--ig-primary-color, #337ab7);
652
+ }
653
+ }
654
+
655
+ /* ==========================================================================
656
+ Thumbnail Label
657
+ ========================================================================== */
658
+
659
+ .image-gallery-thumbnail-label {
660
+ box-sizing: border-box;
661
+ color: var(--ig-white, #fff);
662
+ font-size: 1em;
663
+ left: 0;
664
+ line-height: 1em;
665
+ padding: 5%;
666
+ position: absolute;
667
+ top: 50%;
668
+ text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
669
+ transform: translateY(-50%);
670
+ white-space: normal;
671
+ width: 100%;
672
+ }
673
+
674
+ @media (max-width: 768px) {
675
+ .image-gallery-thumbnail-label {
676
+ font-size: 0.8em;
677
+ line-height: 0.8em;
678
+ }
679
+ }
680
+
681
+ /* ==========================================================================
682
+ Index Display
683
+ ========================================================================== */
684
+
685
+ .image-gallery-index {
686
+ background: var(--ig-background-overlay, rgba(0, 0, 0, 0.4));
687
+ color: var(--ig-white, #fff);
688
+ line-height: 1;
689
+ padding: 10px 20px;
690
+ position: absolute;
691
+ right: 0;
692
+ top: 0;
693
+ z-index: 4;
694
+ }
695
+
696
+ @media (max-width: 768px) {
697
+ .image-gallery-index {
698
+ font-size: 0.8em;
699
+ padding: 5px 10px;
700
+ }
701
+ }