0%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| let brightness = 0; let div; function cover(brightness) { if (typeof (div) === 'undefined') { div = document.createElement('div'); div.setAttribute('style', 'position:fixed;top:0;left:0;outline:50000px solid;z-index:99999;'); document.body.appendChild(div); } else { div.style.display = ''; } div.style.outlineColor = 'rgba(0,0,0,' + brightness + ')'; } window.addEventListener('keydown', function (e) { if (e.altKey && e.keyCode === 90) { cover(brightness = 0.3); } if (e.altKey && e.keyCode === 88) { cover(brightness = 0); } if (e.altKey && e.keyCode === 38) { if (brightness - 0.05 > 0.05) { cover(brightness -= 0.05); } } if (e.altKey && e.keyCode === 40) { if (brightness + 0.05 < 0.95) { cover(brightness += 0.05); } } }, false);
|