spin
This commit is contained in:
parent
916057c4b9
commit
4d2f773dd2
1 changed files with 1 additions and 7 deletions
|
@ -81,14 +81,8 @@
|
|||
<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)";
|
||||
header.style.transform = "translate(" + (Math.cos(timestamp) * 20) + "px, " + (Math.sin(timestamp) * 20) + "px)";
|
||||
|
||||
// loop
|
||||
requestAnimationFrame(update);
|
||||
|
|
Reference in a new issue