Sha256: b31aa49cd344f0b467a9d6e955572a671865d98524685ffb7405ca439220618a

Contents?: true

Size: 561 Bytes

Versions: 3

Compression:

Stored size: 561 Bytes

Contents

function playGif(overlay) {
  let e = overlay.nextElementSibling;

  if (overlay.dataset.gif) {
    e = overlay;
  }

  if (!e.dataset.gif) return ;

  const bak = e.src;
  e.src = e.dataset.gif;
  e.dataset.gif = bak;

  if (e.dataset.playing) {
    e.removeAttribute('data-playing');
    if (e !== overlay)
      overlay.style.opacity = 1;
  } else {
    e.dataset.playing = true;
    if (e !== overlay)
      overlay.style.opacity = 0;
  }

  e.parentElement
    .nextElementSibling
    .firstElementChild
    .style.opacity = e.dataset.playing ? 0.2 : 1;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
askclass-home-theme-0.1.4 assets/js/scripts.js
askclass-home-theme-0.1.3 assets/js/scripts.js
askclass-home-theme-0.1.2 assets/js/scripts.js