-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.html
39 lines (34 loc) · 998 Bytes
/
index.html
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
31
32
33
34
35
36
37
38
39
<!doctype html>
<html>
<head>
<title>Lag Radar</title>
<link rel="stylesheet" href="index.css">
<link rel="shortcut icon" type="image/png" href="./lag-radar.png">
</head>
<body>
<h1>Lag Radar</h1>
<div id="lagger">
Induce Lag:
<input id="lag" type="range" min="0" max="1000" value="0">
<span id="val">0</span>ms
</div>
<div id="radar"></div>
<div id="link">
Install the <a href="./bookmarklet.html">lag-radar as a bookmarklet</a> and use it on any page.
</div>
<script type="module">
import lagRadar from './lag-radar.js';
const destroy = lagRadar({
parent: document.querySelector('#radar')
});
// document.body.addEventListener('click', destroy );
(function lagMe() {
let lag = document.getElementById('lag').value;
document.getElementById('val').textContent = lag;
const t1 = parseInt(lag, 10) + Date.now();
while( Date.now() < t1 );
window.requestAnimationFrame(lagMe);
})();
</script>
</body>
</html>