import mediumZoom from '@/config/medium-zoom';

window.addEventListener('DOMContentLoaded', mediumZoom);

import mediumZoom from '@/config/medium-zoom';

window.addEventListener('DOMContentLoaded', () => {
  const zoomer = mediumZoom();

  zoomer.addEventListeners('show', (event) => {
    const img = event.currentTarget;

    if (!img.hasAttribute('data-hd')) return;

    img.setAttribute('data-lowres', img.getAttribute('src'));
    img.setAttribute('src', img.getAttribute('data-hd'));
  });

  zoomer.addEventListeners('hide', (event) => {
    const img = event.currentTarget;

    if (!img.hasAttribute('data-lowres')) return;

    img.setAttribute('src', img.getAttribute('data-lowres'));
  });
});

Load hd images on mediu zoom
Load hd images on mediu zoom

