-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·192 lines (161 loc) · 7.74 KB
/
index.html
File metadata and controls
executable file
·192 lines (161 loc) · 7.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="/favicon/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg" />
<link rel="shortcut icon" href="/favicon/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="PID vs MPC" />
<link rel="manifest" href="/favicon/site.webmanifest" />
<title>PID vs MPC Control</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
body { margin: 0; overflow: hidden; background-color: #000; }
/* --- HUD CONTAINER --- */
#hud-controls {
position: absolute;
/* Default Floating Position (Desktop & Mobile now share this logic) */
bottom: 20px;
left: 20px;
width: 280px;
transform-origin: bottom left;
padding: 15px;
background: rgba(0, 0, 0, 0.85);
border: 1px solid #ffffff;
color: #ffffff;
font-family: 'Courier New', Courier, monospace;
font-size: 14px;
pointer-events: auto;
user-select: none;
box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
z-index: 10;
transition: border-color 0.3s, box-shadow 0.3s;
box-sizing: border-box;
/* Round corners slightly for the floating look */
border-radius: 8px;
}
/* MPC Mode Styles */
#hud-controls.mpc-mode {
border-color: #00ff00;
box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}
/* --- MOBILE LAYOUT OVERRIDES --- */
@media (max-width: 600px) {
#hud-controls {
/* Center horizontally on mobile */
left: 50%;
transform: translateX(-50%);
transform-origin: center bottom;
/* Keep it floating off the bottom */
bottom: max(20px, env(safe-area-inset-bottom));
/* Stretch to fit width, but keep margins */
width: calc(100% - 40px);
max-width: 400px; /* Don't get too wide on tablets */
}
}
/* --- UI ELEMENTS --- */
.control-group {
display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.control-group label { font-weight: bold; width: 30px; }
input[type=range] {
flex-grow: 1; margin: 0 10px; cursor: pointer; accent-color: white;
}
.mpc-slider { accent-color: #00ff00 !important; }
.mpc-text { color: #00ff00; }
.value-display { width: 35px; text-align: right; }
.button {
display: inline-block; padding: 10px 0;
background: transparent; color: white;
text-decoration: none; font-family: monospace; font-weight: bold;
border: 1px solid white; cursor: pointer;
transition: 0.2s; text-align: center; font-size: 12px;
touch-action: manipulation; /* kills double-tap to zoom instantly */
user-select: none; /* stops the text from highlighting when you spam click */
-webkit-user-select: none; /* safari specific redundancy */
}
@media (hover: hover) {
.button:hover { background: white; color: black; box-shadow: 0 0 10px white; }
}
.button:active { background: #444; transform: translateY(2px); }
.power-stats {
display: flex; justify-content: space-between;
font-size: 12px; margin-bottom: 5px; color: #ccc;
}
.power-val { color: #fff; font-weight: bold; }
/* --- THE POTETO RESONANCE CASCADE --- */
@keyframes poteto-shake {
0% { transform: translate(2px, 1px) rotate(0deg); }
10% { transform: translate(-1px, -2px) rotate(-2deg); }
20% { transform: translate(-3px, 0px) rotate(2deg); }
30% { transform: translate(3px, 2px) rotate(0deg); }
40% { transform: translate(1px, -1px) rotate(2deg); }
50% { transform: translate(-1px, 2px) rotate(-2deg); }
60% { transform: translate(-3px, 1px) rotate(0deg); }
70% { transform: translate(3px, 1px) rotate(-2deg); }
80% { transform: translate(-1px, -1px) rotate(2deg); }
90% { transform: translate(1px, 2px) rotate(0deg); }
100% { transform: translate(1px, -2px) rotate(-2deg); }
}
.shaking-poteto {
/* run the animation incredibly fast, and loop it forever */
animation: poteto-shake 0.2s;
animation-iteration-count: infinite;
/* optional: make the button look slightly cursed/glitched */
box-shadow: 0 0 15px #ff0015;
}
</style>
</head>
<body>
<div id="hud-controls">
<div class="power-stats">
<div>INST: <span id="val-inst" class="power-val">0.0</span> W</div>
<div>|</div>
<div>AVG: <span id="val-avg" class="power-val">0.0</span> W</div>
</div>
<hr id="main-hr" style="border-color: #444;">
<div id="pid-panel">
<div class="control-group">
<label>P</label>
<input type="range" id="pid-p" min="0" max="5" step="0.1" value="1.0">
<span id="val-pid-p" class="value-display">1.0</span>
</div>
<div class="control-group">
<label>I</label>
<input type="range" id="pid-i" min="0" max="2" step="0.01" value="0.0">
<span id="val-pid-i" class="value-display">0.0</span>
</div>
<div class="control-group">
<label>D</label>
<input type="range" id="pid-d" min="0" max="5" step="0.1" value="1.0">
<span id="val-pid-d" class="value-display">1.0</span>
</div>
</div>
<div id="mpc-panel" style="display: none;">
<div class="control-group">
<label class="mpc-text">HZ</label>
<input type="range" id="mpc-hz" class="mpc-slider" min="0.5" max="5.0" step="0.1" value="1.0">
<span id="val-mpc-hz" class="value-display mpc-text">1.0</span>
</div>
<div class="control-group">
<label class="mpc-text">FRC</label>
<input type="range" id="mpc-frc" class="mpc-slider" min="5" max="50" step="1" value="20">
<span id="val-mpc-frc" class="value-display mpc-text">20</span>
</div>
<div class="control-group" style="opacity: 0;">
<label>--</label> <input type="range" disabled> <span>--</span>
</div>
</div>
<hr id="bottom-hr" style="border-color: #444; margin-bottom: 15px;">
<div style="display: flex; gap: 10px; margin-bottom: 10px;">
<button id="btn-toggle" class="button" style="flex: 1; color: white; border-color: white;">MODE: PID</button>
<button id="btn-model" class="button" style="flex:1; color: white; border-color: white;">MDL: CUBE</button>
<button id="btn-random" class="button" style="flex: 1;">KICK</button>
</div>
<a href="about.html" class="button" style="display: block; width: 100%; box-sizing: border-box;">WHAT IS THIS?</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script>
<script type="module" src="./main.js"></script>
</body>
</html>