-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
38 lines (33 loc) · 767 Bytes
/
test.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 lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form>
<label>
Select file:
<input type="file" id="input" onchange="onFileChange(this.files)">
</label>
</form>
<p id="isWebP"></p>
<p id="isAnimatedWebP"></p>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript">
async function onFileChange(files) {
if (files.length === 0) {
console.log("no files selected");
return;
}
const [ file ] = files;
let el;
el = document.querySelector("#isWebP");
el.innerText = await isWebPExtended.isWebP(file);
el = document.querySelector("#isAnimatedWebP");
el.innerText = await isWebPExtended.isAnimatedWebP(file);
el = null;
}
</script>
</body>
</html>