-
Notifications
You must be signed in to change notification settings - Fork 0
/
tools.html
38 lines (33 loc) · 1000 Bytes
/
tools.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
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" type="image/x-icon" href="images/hunt.ico" />
<title>Emerald Hunt</title>
</head>
<body>
<h1>Emerald Hunt Tools</h1>
<h2>Screenshot Analysis</h2>
<canvas id="analysisCanvas">
This browser can not run this game (canvas support missing).
</canvas>
<br>
<hr>
<span>Upload screenshot: </span>
<input type="file" id="screenshot-file-input" />
<pre id="screenshot-content"></pre>
</body>
</html>
<script type="module">
import {ScreenshotAnalyser} from "./js/screenshot.js";
window.onload = init;
function init() {
document.getElementById('screenshot-file-input').addEventListener('change', uploadScreenshot);
};
function uploadScreenshot(event) {
let canvas = document.getElementById("analysisCanvas");
let analyser = new ScreenshotAnalyser(canvas, document.getElementById('screenshot-content'));
const file = event.target.files[0];
console.log(file);
analyser.loadImage(file);
}
</script>