-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewer.html
56 lines (50 loc) · 1.3 KB
/
viewer.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
* {
margin: 0;
padding: 0;
overflow: hidden;
}
#container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
background-color: rgb(198, 226, 255);
object-fit: scale-down;
}
#cam {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="container">
<div id="box-content">
<img id="cam" src="" onclick="change_style();">
</div>
</div>
</body>
<script>
window.onload = function (evt) {
var address = prompt("Enter address", "http://localhost:8080");
document.getElementById("cam").src = address;
}
var idx = 0;
var stls = ["contain", "cover", "fill", "scale-down"]
function change_style() {
idx = idx + 1;
idx = (idx) % stls.length;
document.getElementById("cam").style.objectFit = stls[idx];
console.log(stls[idx])
}
</script>
</html>