-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (73 loc) · 3.09 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html class="h-full">
<head>
<title>Zea CAD Viewer</title>
<link rel="shortcut icon" type="image/png" href="./data/favicon-32x32.png" />
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.9/tailwind.min.css" />
<link rel="stylesheet" href="./src/styles.css" />
<script src="https://www.gstatic.com/draco/v1/decoders/draco_decoder_gltf.js"></script>
</head>
<body class="overflow-hidden h-full">
<div class="h-full flex flex-col">
<header class="p-2">
<img src="./data/logo-zea.png" id="logo" />
</header>
<main class="flex flex-col flex-1">
<div class="flex-1" id="topPanel">
<div class="splitter">
<div id="leftPanel" class="invisible" style="width: 0px; left: 0px">
<zea-tree-view id="tree" class="select-none"></zea-tree-view>
</div>
<div class="separator" id="separatorV" style="left: 0px"></div>
<div id="mainPanel" class="flex-1">
<div id="canvas-holder">
<canvas id="canvas"></canvas>
</div>
<div class="xr-button hidden" id="xr-button"></div>
<div class="fps-display" id="fps"></div>
<progress id="progress" max="100" value="100"></progress>
</div>
</div>
</div>
<!-- Uncomment these lines to provide a resizable bottom panel
<div class="separator" id="separatorH"></div>
<div id="bottomPanel">
</div> -->
</main>
<drop-zone id="dropZone" class="select-none"></drop-zone>
<login-dialog id="login" class="select-none"></login-dialog>
</div>
<script type="module">
import dragElement from './src/panels.ts'
const separatorV = document.getElementById('separatorV')
const leftPanel = document.getElementById('leftPanel')
const mainPanel = document.getElementById('mainPanel')
dragElement(separatorV, leftPanel, mainPanel, 'H')
const separatorH = document.getElementById('separatorH')
const topPanel = document.getElementById('topPanel')
const bottomPanel = document.getElementById('bottomPanel')
if (separatorH && topPanel && bottomPanel) {
dragElement(separatorH, topPanel, bottomPanel, 'V')
}
let leftPanelVisible = false
const toggleSidePanel = () => {
if (leftPanelVisible) {
leftPanel.classList.add('invisible')
leftPanel.style.width = '0px'
separatorV.style.left = '0px'
leftPanelVisible = false
} else {
leftPanel.classList.remove('invisible')
leftPanel.style.width = '300px'
separatorV.style.left = '300px'
leftPanelVisible = true
}
}
document.getElementById('logo').addEventListener('click', toggleSidePanel)
const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
if (!isMobileDevice) toggleSidePanel()
</script>
<script type="module" src="./src/main.ts"></script>
</body>
</html>