web/_javascript/modules/components/img-popup.js
Cotes Chung fe7afa379f
perf: replace jQuery with Vanilla JS (#1681)
Also replaced `magnific-popup` with `GLightbox`
2024-04-17 06:10:01 +08:00

15 lines
279 B
JavaScript

/**
* Set up image popup
*
* Dependencies: https://github.com/biati-digital/glightbox
*/
const IMG_CLASS = 'popup';
export function imgPopup() {
if (document.getElementsByClassName(IMG_CLASS).length === 0) {
return;
}
GLightbox({ selector: `.${IMG_CLASS}` });
}