import { GifPlayer } from './GifPlayer.js';
window.onload = () => {

  const noise = document.querySelector('.noise');
  const noiseStyle = getComputedStyle(noise);
  const noiseFilter = document.querySelector('#noiseFilter').firstElementChild;

  const noisePlayer = () => {
    let base = noiseStyle.getPropertyValue('--noise-base');
    noiseFilter.setAttribute('baseFrequency', `0 ${base}`);
    requestAnimationFrame(noisePlayer)
  }
  noisePlayer();

  let speed = [.75,.5,.35]

  document.querySelectorAll("canvas.canvas").forEach((canvas,i) => {
    console.debug(i)
    new GifPlayer('./assets/login/gif/{i}.png', 19, canvas, speed[i]);
  })

}