-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
131 lines (118 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
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
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>three-assistant-glass</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<style>
@font-face {
font-family: 'Mali';
src: url('fonts/Mali-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Mali';
src: url('fonts/Mali-Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}
body {
margin: 0;
padding: 0;
overflow: hidden; /* Hide scrollbars */
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #efead7;
font-family: 'Mali', sans-serif;
}
canvas {
display: block;
width: 100vw !important;
height: 100vh !important;
}
#animationSelect {
position: absolute;
top: 10px;
left: 10px;
z-index: 100;
background-color: rgba(255, 255, 255, 0.7);
padding: 5px;
border-radius: 5px;
font-family: 'Mali', cursive;
}
#vapiControls {
position: absolute;
bottom: 10px;
left: 10px;
z-index: 100;
}
#vapiControls button {
margin-right: 10px;
padding: 5px 10px;
border-radius: 5px;
border: none;
background-color: #1c532b;
color: #efead7;
cursor: pointer;
font-family: 'Mali', cursive;
}
#clipboardAlert {
position: fixed;
top: 20px;
right: 20px;
background-color: rgba(28, 83, 43, 0.9);
color: #efead7;
padding: 10px;
border-radius: 5px;
display: none;
z-index: 1000;
font-family: 'Mali', cursive;
}
* {
font-family: 'Mali', sans-serif;
}
</style>
<script src="https://cdn.jsdelivr.net/gh/balacodeio/Vapi-Web-UMD@latest/dist/latest/vapi-web-bundle.min.js"></script>
</head>
<body>
<select id="animationSelect">
<option value="">Test an animation</option>
</select>
<div id="vapiControls">
<button id="toggleVapi">▶️</button>
</div>
<div id="clipboardAlert"></div>
<script type="importmap">
{
"imports": {
"fflate": "https://cdn.jsdelivr.net/npm/fflate@0.7.4/esm/browser.js",
"three": "https://cdn.jsdelivr.net/npm/three@0.167.0/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.167.0/examples/jsm/",
"@pixiv/three-vrm": "https://cdn.jsdelivr.net/npm/@pixiv/three-vrm@3/lib/three-vrm.module.min.js",
"@lookingglass/webxr": "https://unpkg.com/@lookingglass/webxr@0.6.0/dist/bundle/webxr.js"
}
}
</script>
<script src="main.js" type="module"></script>
<script>
const socket = new WebSocket('ws://' + location.host);
const clipboardAlert = document.getElementById('clipboardAlert');
socket.onmessage = function(event) {
const data = JSON.parse(event.data);
if (data.type === 'clipboard') {
clipboardAlert.textContent = '📋 Clipboard Updated';
clipboardAlert.style.display = 'block';
setTimeout(() => {
clipboardAlert.style.display = 'none';
}, 5000);
}
};
</script>
</body>
</html>