test awdog quiver

This commit is contained in:
awesomeuser 2023-07-07 21:49:01 +00:00
parent 236404869c
commit 5010652a52

View file

@ -64,7 +64,7 @@
<h1 id="header">awesome.colean.cc</h1>
<img src="res/awdog.png" width="160"><br>
<img id="awdog" src="res/awdog.png" width="160" onclick="pet()"><br>
awdog, the mascot of awesome
<br><br>
@ -76,8 +76,19 @@
<script>
var header = document.getElementById("header");
var awdog = document.getElementById("awdog");
function pet() {
alert("pet");
}
async function update(timestamp) {
// petting shake
let a = Math.random() * Math.PI * 2;
let intensity = 20;
awdog.style.transform = "translate(" + (Math.cos(a) * intensity) + "px, " + (Math.sin(a) * intensity) + "px)";
// header
let t = timestamp / 500;
let x = Math.cos(t) * 20;