Skip to content

Commit 481e8a8

Browse files
committed
style: Add comprehensive CSS styling for WebGPU cube controls
Add modern, polished styles for all UI controls in the WebGPU cube example: Controls Panel: - Semi-transparent background with blur effect - Rounded borders with subtle glow Arrow Buttons: - 48x48px square buttons with hover effects - Smooth transitions and transform animations - Highlight on hover with accent color border - Toggle button uses primary accent color (#e94560) Speed Control: - Custom-styled range slider with branded thumb - Hover effects with scale animation - Color-coded speed value display - Clean, modern layout Instructions: - Subtle, readable text styling - Centered with proper line height Responsive Design: - Adjusted sizing for mobile devices (< 600px) - Maintains usability on smaller screens All styles match the existing dark theme gradient with #e94560 accent color.
1 parent 5ec443c commit 481e8a8

1 file changed

Lines changed: 164 additions & 0 deletions

File tree

examples/webgpu-cube/index.html

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,170 @@
8080
.footer a:hover {
8181
text-decoration: underline;
8282
}
83+
84+
/* Controls Panel */
85+
.controls-panel {
86+
margin-top: 20px;
87+
padding: 20px;
88+
background: rgba(255, 255, 255, 0.03);
89+
border-radius: 12px;
90+
border: 1px solid rgba(255, 255, 255, 0.1);
91+
}
92+
93+
/* Arrow Buttons Layout */
94+
.arrow-buttons {
95+
display: flex;
96+
flex-direction: column;
97+
align-items: center;
98+
gap: 8px;
99+
margin-bottom: 20px;
100+
}
101+
102+
.button-row {
103+
display: flex;
104+
gap: 8px;
105+
justify-content: center;
106+
}
107+
108+
/* Control Buttons */
109+
.control-button {
110+
width: 48px;
111+
height: 48px;
112+
background: rgba(255, 255, 255, 0.1);
113+
border: 1px solid rgba(255, 255, 255, 0.2);
114+
border-radius: 8px;
115+
color: white;
116+
font-size: 20px;
117+
cursor: pointer;
118+
transition: all 0.2s ease;
119+
display: flex;
120+
align-items: center;
121+
justify-content: center;
122+
user-select: none;
123+
}
124+
125+
.control-button:hover {
126+
background: rgba(255, 255, 255, 0.15);
127+
border-color: #e94560;
128+
transform: translateY(-2px);
129+
box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
130+
}
131+
132+
.control-button:active {
133+
transform: translateY(0);
134+
box-shadow: 0 2px 8px rgba(233, 69, 96, 0.2);
135+
}
136+
137+
.control-button.toggle {
138+
background: #e94560;
139+
border-color: #e94560;
140+
}
141+
142+
.control-button.toggle:hover {
143+
background: #ff5670;
144+
border-color: #ff5670;
145+
}
146+
147+
/* Speed Control */
148+
.speed-control {
149+
display: flex;
150+
align-items: center;
151+
gap: 12px;
152+
padding: 16px;
153+
background: rgba(255, 255, 255, 0.05);
154+
border-radius: 8px;
155+
margin-bottom: 16px;
156+
}
157+
158+
.speed-label {
159+
font-size: 14px;
160+
font-weight: 500;
161+
color: rgba(255, 255, 255, 0.8);
162+
min-width: 50px;
163+
}
164+
165+
.speed-slider {
166+
flex: 1;
167+
height: 4px;
168+
background: rgba(255, 255, 255, 0.1);
169+
border-radius: 2px;
170+
outline: none;
171+
-webkit-appearance: none;
172+
appearance: none;
173+
}
174+
175+
.speed-slider::-webkit-slider-thumb {
176+
-webkit-appearance: none;
177+
appearance: none;
178+
width: 16px;
179+
height: 16px;
180+
background: #e94560;
181+
border-radius: 50%;
182+
cursor: pointer;
183+
transition: all 0.2s ease;
184+
}
185+
186+
.speed-slider::-webkit-slider-thumb:hover {
187+
transform: scale(1.2);
188+
box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.2);
189+
}
190+
191+
.speed-slider::-moz-range-thumb {
192+
width: 16px;
193+
height: 16px;
194+
background: #e94560;
195+
border: none;
196+
border-radius: 50%;
197+
cursor: pointer;
198+
transition: all 0.2s ease;
199+
}
200+
201+
.speed-slider::-moz-range-thumb:hover {
202+
transform: scale(1.2);
203+
box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.2);
204+
}
205+
206+
.speed-value {
207+
font-size: 14px;
208+
font-weight: 600;
209+
color: #e94560;
210+
min-width: 35px;
211+
text-align: right;
212+
}
213+
214+
/* Instructions */
215+
.instructions {
216+
font-size: 13px;
217+
color: rgba(255, 255, 255, 0.6);
218+
text-align: center;
219+
line-height: 1.5;
220+
margin: 0;
221+
}
222+
223+
/* Responsive Design */
224+
@media (max-width: 600px) {
225+
h1 {
226+
font-size: 24px;
227+
}
228+
229+
#app {
230+
padding: 16px;
231+
}
232+
233+
.control-button {
234+
width: 44px;
235+
height: 44px;
236+
font-size: 18px;
237+
}
238+
239+
.controls-panel {
240+
padding: 16px;
241+
}
242+
243+
.instructions {
244+
font-size: 12px;
245+
}
246+
}
83247
</style>
84248
</head>
85249
<body>

0 commit comments

Comments
 (0)