-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
250 lines (250 loc) · 6.36 KB
/
Copy pathindex.html
File metadata and controls
250 lines (250 loc) · 6.36 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?php
// Set headers to prevent caching
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Pragma: no-cache");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SpiritData</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<style>
#logo {
position: fixed;
top: 15px;
left: 10px;
width: 80px;
height: auto;
z-index: 1000;
transition: width 0.3s ease;
cursor: pointer;
}
canvas {
display: block;
position: absolute; /* Changed from fixed to absolute */
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
/* Removed touch-action: none; */
pointer-events: none; /* Allow touch events to pass through */
}
#videoContainer {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
}
#controlPopup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: black;
color: white;
border: 2px solid white;
padding: 10px;
z-index: 2000;
text-align: center;
width: 300px;
height: 280px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
body {
margin: 0;
padding: 0;
background-color: black;
font-family: Arial, sans-serif;
position: relative;
/* Removed overflow: hidden; to allow scrolling */
}
#controlPopup button, #controlPopup div.button {
background-color: transparent;
font-size: 25px;
cursor: pointer;
color: #fff;
border: 1px solid #666;
border-radius: 5px;
margin-bottom: 5px;
padding: 0 10px; /* Added padding */
}
#closePopup {
position: absolute;
top: 5px;
right: 10px;
cursor: pointer;
background-color: transparent;
border: none; /* Remove border */
font-size: 30px;
color: #fff;
outline: none; /* Remove focus outline */
appearance: none;
-webkit-appearance: none;
box-shadow: none;
}
#captions {
position: fixed;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 14px;
z-index: 1000;
background-color: rgba(0, 0, 0, 0.5);
padding: 5px;
border-radius: 5px;
max-width: 80%;
word-wrap: break-word;
overflow: hidden;
box-sizing: border-box;
cursor: pointer;
}
#confidenceLevel {
position: fixed;
top: 10px;
right: 10px;
font-size: 20px;
color: white;
cursor: pointer;
z-index: 500;
background-color: rgba(0, 0, 0, 0.5);
padding: 5px;
border-radius: 5px;
box-sizing: border-box;
}
#confidenceSlider, #gainSlider {
-webkit-appearance: none;
appearance: none;
width: 100%;
height: 40px;
background: #ddd;
outline: none;
opacity: 0.7;
transition: opacity .2s;
margin-bottom: 20px;
}
#confidenceSlider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 40px;
height: 40px;
background: #ff6600;
cursor: pointer;
}
#gainSlider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 40px;
height: 40px;
background: #4CAF50;
cursor: pointer;
}
#confidenceSlider::-moz-range-thumb {
width: 40px;
height: 40px;
background: #ff6600;
cursor: pointer;
}
#gainSlider::-moz-range-thumb {
width: 40px;
height: 40px;
background: #4CAF50;
cursor: pointer;
}
.slider-title {
font-size: 16px;
margin-bottom: 5px;
}
#audioLevel {
width: 100%;
height: 20px;
background-color: grey;
margin-bottom: 10px;
position: relative;
}
#audioLevelIndicator {
height: 100%;
background-color: green;
width: 0;
transition: width 0.1s;
}
#peakLine {
position: absolute;
top: 0;
height: 100%;
width: 2px;
background-color: yellow;
}
/* Version number styling */
#versionNumber {
position: absolute;
top: 5px;
left: 5px;
font-size: 12px;
color: #666;
}
/* Allow scrolling */
html, body {
height: 100%;
/* Removed overflow: hidden; */
}
/* Spacer to enable scrolling */
#spacer {
height: 60px; /* Adjust as needed to enable scrolling */
width: 100%;
}
</style>
<!-- Load Local Files -->
<script src="p5.min.js"></script>
<script src="p5.dom.min.js"></script>
<script src="ml5.min.js"></script>
</head>
<body>
<div id="videoContainer">
<!-- The video element will be managed by p5.js -->
</div>
<a href="https://twofacesparanormal.com/">
<img id="logo" src="icons/logo.png" alt="Logo">
</a>
<div id="controlPopup">
<div id="versionNumber">v100</div>
<!-- Changed button to div for close 'X' -->
<div id="closePopup">✖</div>
<div>
<button id="switchCamera">🔄</button>
<button id="toggleCaptions">💬</button>
</div>
<div class="slider-title">Human Figure Probability: <span id="popupConfidenceLevel">90%</span></div>
<input type="range" id="confidenceSlider" min="50" max="100" value="90" step="1">
<div class="slider-title">Microphone Sensitivity: <span id="popupGainLevel">4.0</span></div>
<div id="audioLevel">
<div id="audioLevelIndicator"></div>
<div id="peakLine"></div>
</div>
<input type="range" id="gainSlider" min="0.1" max="10.0" step="0.1" value="4.0">
<button id="confirmPopup">Save</button>
</div>
<div id="captions"></div>
<div id="confidenceLevel">90%</div>
<!-- Add the spacer div -->
<div id="spacer"></div>
<script src="sketch.js"></script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
</body>
</html>