-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (57 loc) · 2.19 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
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="manifest" href="manifest.webmanifest">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<!-- three.js library -->
<script src='./vendor/three.js/build/three.js'></script>
<script src="./vendor/three.js/examples/js/libs/stats.min.js"></script>
<!-- jsartookit -->
<script src="./vendor/jsartoolkit5/build/artoolkit.min.js"></script>
<script src="./vendor/jsartoolkit5/js/artoolkit.api.js"></script>
<!-- include threex.artoolkit -->
<script src="./src/threex/threex-artoolkitsource.js"></script>
<script src="./src/threex/threex-artoolkitcontext.js"></script>
<script src="./src/threex/threex-arbasecontrols.js"></script>
<script src="./src/threex/threex-armarkercontrols.js"></script>
<script src="./src/GLTFLoader.js"></script>
<script>THREEx.ArToolkitContext.baseURL = './'</script>
<body style='margin : 0px; overflow: hidden; font-family: Monospace; background: #000;'>
<div style='position: absolute; top: 10px; width:100%; text-align: center; z-index: 1;'>
</div>
<div class="control_btns">
<button class="switch_bg">切換背景</button>
<button class="fullscreen_btn">全螢幕</button>
<div class="select">
<label for="videoSource">Select Camera: </label><select id="videoSource"></select>
</div>
</div>
<script src="./renderer.js"></script>
<script>
// const electron = require('electron');
// const eleWindow = electron.remote.getCurrentWindow();
let hideBg = false;
// let fullScreen = false;
document.querySelector('.switch_bg').addEventListener('click', () => {
hideBg = ! hideBg;
document.getElementById('arjs-video').style.opacity = (hideBg? 0: 1);
})
document.querySelector('.fullscreen_btn').addEventListener('click', () => {
// fullScreen = !fullScreen;
// console.log(eleWindow)
// eleWindow.setFullScreen(!eleWindow.isFullScreen());
if (!document.fullscreenElement) {
document.body.requestFullscreen();
} else {
document.exitFullscreen();
}
})
</script>
<style>
.control_btns {
position: absolute;
bottom: 30px;
right: 30px;
z-index: 2;
}
</style>
</body>