gallery-gen 1.0.1 → 1.0.3

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/assets/gallery.css +14 -2
  3. data/assets/gallery.js +15 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f25b670c71ab9254005520cad1af88946bac47ed5b5b4294a3e9b127877421a
4
- data.tar.gz: a6b07097cb22ef128f022ea62290d4353d9e8d76f216302a9a7bfd9d2808034a
3
+ metadata.gz: 03f2c8ed4c0507ea65bfb1d1db054d2530e0cbfee524242c3d4bc8f9cbfecdb8
4
+ data.tar.gz: f3946b038d8b0f328cba527470449da27e0116b237d2fbda7b71e3240420ed03
5
5
  SHA512:
6
- metadata.gz: 5053afc204339f4b2ce5fd97cb85c3393fb44f1a7795334979a600999364a124c50649f53fc173dcc0f9e5a6eea757c775eda6212e92b568afbb171ae8ac1019
7
- data.tar.gz: 3cabe8f0a2e45c519576285af69553b50354ec879c7d4dee4426c203d1247ad2503121f9ec71005d5bc6ec130248a2ac6e5390db4904b7134d2cbf31cbece70e
6
+ metadata.gz: 82660649f839b9277046f9b0f7700c6d4e391ab519106f0840e052517158c45f3a0dce0e75ee774f7082aa08ee651db94c496ca7dc23cc1ee4b38a01e1b3a640
7
+ data.tar.gz: d89f9d1f47d9cf7a1877a4431d2e8a98c09ed8131b27d132d636428b1b92d23544757d972d5151605ac304a546d31c2b114a1ccf0352af840b68333f2d499d54
data/assets/gallery.css CHANGED
@@ -23,11 +23,23 @@
23
23
  }
24
24
 
25
25
  .gallery-image-id {
26
- color: white;
27
- opacity: 0.85;
28
26
  height: 30px;
29
27
  line-height: 30px;
30
28
  margin: 15px 0 0 9px;
29
+
30
+ color: white;
31
+ opacity: 0.85;
31
32
  font-size: 14px; /* smaller, as image seq nr. */
32
33
  text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
33
34
  }
35
+
36
+ .gallery-image-caption {
37
+ position: absolute;
38
+ left: 50%;
39
+ bottom: 16px;
40
+ transform: translateX(-50%);
41
+
42
+ color: white;
43
+ font-size: 141%;
44
+ text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
45
+ }
data/assets/gallery.js CHANGED
@@ -34,6 +34,21 @@ lightbox.on('uiRegister', function () {
34
34
  });
35
35
  }
36
36
  });
37
+ lightbox.pswp.ui.registerElement({
38
+ name: 'image-caption',
39
+ className: 'gallery-image-caption',
40
+ order: 9,
41
+ isButton: false,
42
+ appendTo: 'root',
43
+ onInit: (el, pswp) => {
44
+ lightbox.pswp.on('change', () => {
45
+ const currSlide = lightbox.pswp.currSlide.data.element;
46
+ if (currSlide) {
47
+ el.innerHTML = currSlide.getAttribute('data-gallery-image-name');
48
+ }
49
+ });
50
+ }
51
+ });
37
52
  });
38
53
  lightbox.on('close', () => {
39
54
  pswpContainer.style.display = 'none';
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gallery-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Pfeifer