Facebook
From Tinct Motmot, 3 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 50
  1. updateButtonPos() {
  2.     const max = 10000;
  3.     const test = (max / window.innerHeight);
  4.     let height;
  5.     height = (max / window.innerHeight);
  6.     const checkHeight = height;
  7.     if (checkHeight > 10) {
  8.       height = (max / window.innerHeight) * .7;
  9.     }
  10.     if (checkHeight > 11.7) {
  11.       height = (max / window.innerHeight) * 1.4;
  12.     }
  13.     if (checkHeight > 13.6) {
  14.       height = (max / window.innerHeight) * 1.9;
  15.     }
  16.     if (checkHeight > 14.5) {
  17.       height = (max / window.innerHeight) * 2.5;
  18.     }
  19.     if (checkHeight > 17) {
  20.       height = (max / window.innerHeight) * 3.1;
  21.     }
  22.     if (checkHeight > 19) {
  23.       height = (max / window.innerHeight) * 3.8;
  24.     }
  25.     document.documentElement.style.setProperty('--screenHeight', height + 'px');
  26.     console.log("test", checkHeight);
  27.     console.log(height + 'px');
  28.   }