-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
66 lines (48 loc) · 1.76 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
58
59
60
61
62
63
64
65
66
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<title>Sansui - Terrain Rendering UI</title>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@latest/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@latest/examples/jsm/"
}
}
</script>
</head>
<body>
<script type="module" src="/script/main.js"></script>
<script type="module">
import {onRender, reScale} from "/script/main.js";
// Get a reference to the button
const renderBtn = document.getElementById('renderBtn');
const scaleBtn = document.getElementById('updateHeightScaleBtn');
// Add a click event listener to the button
renderBtn.addEventListener('click', function() {
onRender();
});
// Add a click event listener to the button
scaleBtn.addEventListener('click', function() {
reScale();
});
</script>
<div style="display: flex; margin-top: -8px; align-items: center; gap: 20px">
<h1>
Rust-WASM Terrain Generator
</h1>
<label for="length" style="">Length: </label>
<input type="number" id="length" value="15" style="width: 75px;">
<label for="width">Width: </label>
<input type="number" id="width" value="15" style="width: 75px;">
<label for="seed">Seed: </label>
<input type="number" id="seed" value="2693356727" style="width: 135px;">
<button id="renderBtn">Render</button>
<div style="height: 50px; border: 1px solid lightslategrey;"></div>
<label for="heightScale">Height scaling: </label>
<input type="number" id="heightScale" value="1" style="width: 50px;">
<button id="updateHeightScaleBtn">Update</button>
</div>
</body>
</html>