-
Notifications
You must be signed in to change notification settings - Fork 24
/
script.js
30 lines (24 loc) · 867 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
seed = getRandomSeed();
var canvas = document.getElementById("myCanvas");
var btnDiscoverNew = document.getElementById('discovernew');
function discoverNew() {
document.title = "Working..."
btnDiscoverNew.innerHTML = 'working...';
setTimeout(function() {
var seed = getRandomSeed();
draw(canvas, seed);
btnDiscoverNew.innerHTML = 'discover new planet';
document.title = "Every Planet Procedural";
document.getElementById('permalink').href = '/proceduralart/?planet=' + seed;
}, 0);
return false;
}
if (getQueryParams(document.location.search).planet !== undefined) {
seed = getQueryParams(document.location.search).planet;
} else {
btnDiscoverNew.onclick = discoverNew;
}
document.getElementById('permalink').href = '/proceduralart/?planet=' + seed;
document.title = "Working...";
draw(canvas, seed);
document.title = "Every Planet Procedural";