-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
122 lines (117 loc) · 2.97 KB
/
index.html
File metadata and controls
122 lines (117 loc) · 2.97 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>AR.js Core ECS + ArtoolkitPlugin + Three.js</title>
<style>
html,
body {
margin: 0;
height: 100%;
background: #111;
color: #eee;
font-family: system-ui, Arial, sans-serif;
}
.container {
max-width: 960px;
margin: 24px auto;
padding: 16px;
}
h1 {
margin: 0 0 8px;
font-size: 20px;
}
p {
margin: 8px 0 16px;
color: #ccc;
}
.controls {
display: flex;
gap: 8px;
margin-bottom: 12px;
flex-wrap: wrap;
}
button {
padding: 10px 14px;
border: 0;
border-radius: 6px;
background: #2d6cdf;
color: #fff;
cursor: pointer;
}
button[disabled] {
background: #555;
cursor: default;
}
.status {
padding: 10px;
border-radius: 6px;
background: #222;
margin-bottom: 12px;
}
.status.success {
background: #17351d;
color: #9af5b5;
}
.status.error {
background: #3a1515;
color: #ff9b9b;
}
.viewport {
position: relative;
width: 100%;
max-width: 640px;
aspect-ratio: 4 / 3;
background: #000;
border-radius: 8px;
overflow: hidden;
margin: 12px 0;
}
.viewport video,
.viewport canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.viewport video {
z-index: 1;
}
.viewport canvas {
z-index: 2;
pointer-events: none;
}
.log {
background: #1b1b1b;
border-radius: 6px;
padding: 10px;
min-height: 140px;
max-height: 260px;
overflow: auto;
font: 12px/1.4 monospace;
}
</style>
</head>
<body>
<div class="container">
<h1>AR.js Core + Artoolkit + Three.js Renderer Plugin</h1>
<p>
Use the buttons to start/stop the webcam and load the HIRO pattern
marker.
</p>
<div id="status" class="status">Initializing…</div>
<div class="controls">
<button id="startBtn">Start Webcam</button>
<button id="stopBtn" disabled>Stop</button>
<button id="loadBtn" disabled>Load Marker</button>
</div>
<div id="viewport" class="viewport"></div>
<h3>Event Log</h3>
<div id="log" class="log"></div>
</div>
<script type="module" src="src/main.js"></script>
</body>
</html>