forked from rtouti/2d-planet-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (55 loc) · 1.25 KB
/
index.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2D Planet</title>
</head>
<style>
body {
background-color : black;
}
canvas {
position : absolute;
top : 50%;
left : 50%;
transform : translate(-250px, -250px);
border : 2px solid black;
}
.fixed {
position : fixed;
top : 10px;
left : 10px;
}
label {
color : white;
}
@media screen and (max-width: 500px) {
canvas {
position : absolute;
top : 5%;
left : 0;
transform : translate(0,0);
width: 100%;
}
.fixed {
top : initial;
bottom : 0;
left : 5px;
}
.fixed * {
display : block;
}
}
</style>
<body>
<canvas width="500" height="500"></canvas>
<div class="fixed">
<input type="button" value="Random" onclick="randomSeed()"></input>
<label>Seed : </label><input id="seed_field" type="text" value="" oninput="generate(true);"></input>
<label>Pixel size : </label><input id="pixelSize_field" type="number" min="1" max="15" value="5" oninput="generate(false);"></input>
</div>
</body>
<script type="text/javascript" src="perlin_noise.js"></script>
<script type="text/javascript" src="index.js"></script>
</html>