test awdog quiver
This commit is contained in:
parent
236404869c
commit
5010652a52
1 changed files with 12 additions and 1 deletions
13
index.html
13
index.html
|
@ -64,7 +64,7 @@
|
||||||
|
|
||||||
<h1 id="header">awesome.colean.cc</h1>
|
<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
|
awdog, the mascot of awesome
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -76,8 +76,19 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var header = document.getElementById("header");
|
var header = document.getElementById("header");
|
||||||
|
var awdog = document.getElementById("awdog");
|
||||||
|
|
||||||
|
function pet() {
|
||||||
|
alert("pet");
|
||||||
|
}
|
||||||
|
|
||||||
async function update(timestamp) {
|
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 t = timestamp / 500;
|
||||||
|
|
||||||
let x = Math.cos(t) * 20;
|
let x = Math.cos(t) * 20;
|
||||||
|
|
Reference in a new issue