index.js 700 B

12345678910111213141516171819202122232425262728
  1. const resizeEvent = evt => {
  2. if (window.innerWidth / window.innerHeight > 1.4) {
  3. document.body.classList.remove('narrow-body');
  4. document.body.classList.add('wide-body');
  5. } else {
  6. document.body.classList.add('narrow-body');
  7. document.body.classList.remove('wide-body');
  8. }
  9. let vgEl = $('voice-graph-2d');
  10. let vgParent = vgEl.parentNode;
  11. vgEl.style.maxWidth = getComputedStyle(vgParent).height;
  12. }
  13. window.onload = resizeEvent;
  14. window.addEventListener('resize', resizeEvent);
  15. $('.play-pause').focus();
  16. $('button.details').click();
  17. for (let el of $$('textarea, input')) {
  18. el.addEventListener('focusin', resizeEvent);
  19. el.addEventListener('focusout', resizeEvent);
  20. }
  21. loadDefaultClips();