Gathering detailed insights and metrics for @sitelintcode/accessible-gallery
Gathering detailed insights and metrics for @sitelintcode/accessible-gallery
Gathering detailed insights and metrics for @sitelintcode/accessible-gallery
Gathering detailed insights and metrics for @sitelintcode/accessible-gallery
Simple images gallery that is accessible, responsive and with preloading
npm install @sitelintcode/accessible-gallery
Typescript
Module System
Node Version
NPM Version
TypeScript (72.84%)
SCSS (20.79%)
JavaScript (6.22%)
Shell (0.15%)
Total Downloads
4,878
Last Day
2
Last Week
18
Last Month
151
Last Year
1,375
MIT License
79 Commits
1 Watchers
3 Branches
1 Contributors
Updated on May 01, 2025
Minified
Minified + Gzipped
Latest Version
1.2.17
Package Id
@sitelintcode/accessible-gallery@1.2.17
Unpacked Size
33.00 kB
Size
9.25 kB
File Count
4
NPM Version
11.3.0
Node Version
23.11.0
Published on
May 01, 2025
Cumulative downloads
Total Downloads
Last Day
-96.7%
2
Compared to previous day
Last Week
-73.9%
18
Compared to previous week
Last Month
-19.7%
151
Compared to previous month
Last Year
-49.6%
1,375
Compared to previous year
3
35
Accessible Gallery allows you to create an image gallery automatically directly from the HTML.
1npm install @sitelintcode/accessible-gallery --save
1 <ul class="accessible-gallery" data-accessible-gallery 2 data-accessible-gallery-config='{"galleryTitle":"Gallery of images in a modal dialog","loadingMessage":"The image is being loaded","closeButtonMessage":"Close gallery", "previousImage":"Previous","nextImage":"Next", "closeButton":"Close dialog"}'> 3 4 <li class="accessible-gallery__item" data-accessible-gallery-item> 5 <a href="#no_image" data-accessible-gallery-link> 6 <img loading="lazy" alt="Placeholder" data-accessible-gallery-thumbnail="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOHPmzH8ACDADZKt3GNsAAAAASUVORK5CYII=" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOHPmzH8ACDADZKt3GNsAAAAASUVORK5CYII="> 7 </a> 8 </li> 9 10 <li class="accessible-gallery__item" data-accessible-gallery-item> 11 <a href="images/castelmezzano-1979546_1920.jpeg" data-accessible-gallery-link> 12 <img loading="lazy" alt="Castelmezzano by night" src="images/castelmezzano-1979546_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail="images/castelmezzano-1979546_1920_thumbnail.jpeg"> 13 </a> 14 </li> 15 16 <li class="accessible-gallery__item" data-accessible-gallery-item> 17 <a href="images/sunset-3325080_1920.jpeg" data-accessible-gallery-link> 18 <img loading="lazy" alt="Sunset in mountains" src="images/sunset-3325080_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail="images/sunset-3325080_1920_thumbnail.jpeg"> 19 </a> 20 </li> 21 22 </ul>
1 import AccessibleGallery from '@sitelint/accessible-gallery'; 2 3 const accessibleGallery = new AccessibleGallery(); 4 5 accessibleGallery.init();
src="data:image/png;base64,..."
.import { terser } from "rollup-plugin-terser";
was replaced with import { terser } from "rollup-plugin-minification";
because rollup-plugin-terser
is not compatible with Rollup 3.x version. See: https://github.com/TrySound/rollup-plugin-terser/issues/119DOMContentLoaded
event automatically. Eventually, if event DOMContentLoaded
was called after Accessible Gallery code was loaded then the gallery will run immediately.Optionally you may want to set custom messages, e.g. for localisation purpose. An attribute data-accessible-gallery-config
contains config for all strings.
1{ 2 "galleryTitle": "Gallery of images in a modal dialog", 3 "loadingMessage": "The image is being loaded", 4 "closeButtonMessage": "Close gallery", 5 "previousImage": "Previous", 6 "nextImage": "Next", 7 "closeButton": "Close dialog" 8}
Note: above config is being stored as a valid JSON string under attribute data-accessible-gallery-config
.
The data-accessible-gallery-thumbnail
attribute allow you to specify a custom small thumbnail generated at the very bottom of the page. Keep the value empty when you want to pick the image src
.
This <img loading="lazy" alt="Castelmezzano by night" src="images/castelmezzano-1979546_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail="images/castelmezzano-1979546_1920_bottom_thumbnail.jpeg">
will pick images/castelmezzano-1979546_1920_bottom_thumbnail.jpeg
when rendering mini thumbnails at the very bottom of the page.
This <img loading="lazy" alt="Castelmezzano by night" src="images/castelmezzano-1979546_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail>
will pick images/castelmezzano-1979546_1920_thumbnail.jpeg
when rendering mini thumbnails at the very bottom of the page.
Yes. See above "Options".
Contributions are welcome, and greatly appreciated! Contributing doesn't just mean submitting pull requests. There are many different ways for you to get involved, including answering questions on the issues, reporting or triaging bugs, and participating in the features evolution process.
Images coming from Pixabay
MIT
No vulnerabilities found.
No security vulnerabilities found.