set up script for header cooling
This commit is contained in:
parent
a8875b468b
commit
39178c3a6b
1 changed files with 21 additions and 2 deletions
23
index.html
23
index.html
|
@ -27,7 +27,7 @@
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
#header {
|
||||||
//text-transform: uppercase;
|
//text-transform: uppercase;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-shadow: -4px 4px #c91a29,
|
text-shadow: -4px 4px #c91a29,
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>awesome.colean.cc</h1>
|
<h1 id="header">awesome.colean.cc</h1>
|
||||||
|
|
||||||
<img src="res/awdog.png" width="160"><br>
|
<img src="res/awdog.png" width="160"><br>
|
||||||
awdog, the mascot of awesome
|
awdog, the mascot of awesome
|
||||||
|
@ -78,5 +78,24 @@
|
||||||
<li><a href="proj/wolfystein.html">@Wolfystein3D</a></li>
|
<li><a href="proj/wolfystein.html">@Wolfystein3D</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var header = document.getElementById("header");
|
||||||
|
|
||||||
|
var prevTimestamp = 0;
|
||||||
|
|
||||||
|
async function update(timestamp) {
|
||||||
|
// get dt
|
||||||
|
let dt = (timestamp - prevTimestamp);
|
||||||
|
prevTimestamp = timestamp;
|
||||||
|
|
||||||
|
header.style.transform = "translate(50px, 100px);";
|
||||||
|
|
||||||
|
// loop
|
||||||
|
requestAnimationFrame(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
requestAnimationFrame(update);
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Reference in a new issue