platform/framework/example/http2/public/app.js
Tobe O 609d06f66b Add 'framework/' from commit '64d6729def5ffcf225a2c8f74fdf115218df1c56'
git-subtree-dir: framework
git-subtree-mainline: 6f6510ab27
git-subtree-split: 64d6729def
2020-02-15 18:12:48 -05:00

27 lines
No EOL
751 B
JavaScript

window.onload = function() {
var $app = document.getElementById('app');
var $loading = document.getElementById('loading');
$app.removeChild($loading);
var $button = document.createElement('button');
var $h1 = document.createElement('h1');
$app.appendChild($h1);
$app.appendChild($button);
$h1.textContent = '~Angel HTTP/2 server push~';
$button.textContent = 'Change color';
$button.onclick = function() {
var color = Math.floor(Math.random() * 0xffffff);
$h1.style.color = '#' + color.toString(16);
};
$button.onclick();
window.setInterval($button.onclick, 2000);
var rotation = 0;
window.setInterval(function() {
rotation += .6;
$button.style.transform = 'rotate(' + rotation + 'deg)';
}, 10);
};