100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.

0 downloads

dbbasic-web-native/test-progress.html
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-web-native.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-web-native.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-web-native.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Add canonical.html v1.0 - The single source of truth for usability standards fb6e650 1 year ago History
test-progress.html · 10.3 KB · 279 lines
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Semantic Progress Test</title>
7 <script src="semantic-components.js"></script>
8 <style>
9 body {
10 background: #000;
11 color: #fff;
12 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
13 padding: 40px;
14 max-width: 1200px;
15 margin: 0 auto;
16 }
17
18 h1 {
19 margin-bottom: 40px;
20 }
21
22 .demo-section {
23 margin-bottom: 60px;
24 }
25
26 .demo-section h2 {
27 font-size: 20px;
28 color: #8e8e93;
29 margin-bottom: 20px;
30 }
31
32 .demo-row {
33 display: flex;
34 align-items: center;
35 gap: 30px;
36 margin-bottom: 20px;
37 flex-wrap: wrap;
38 }
39
40 .demo-label {
41 color: #8e8e93;
42 font-size: 14px;
43 min-width: 100px;
44 }
45 </style>
46</head>
47<body>
48 <h1>semantic-progress Component Test</h1>
49
50 <div class="demo-section">
51 <h2>Spinners</h2>
52
53 <div class="demo-row">
54 <span class="demo-label">Small:</span>
55 <semantic-progress type="spinner" size="small"></semantic-progress>
56 <semantic-progress type="spinner" size="small" intent="success"></semantic-progress>
57 <semantic-progress type="spinner" size="small" intent="warning"></semantic-progress>
58 <semantic-progress type="spinner" size="small" intent="danger"></semantic-progress>
59 </div>
60
61 <div class="demo-row">
62 <span class="demo-label">Medium:</span>
63 <semantic-progress type="spinner" size="medium"></semantic-progress>
64 <semantic-progress type="spinner" size="medium" intent="success"></semantic-progress>
65 <semantic-progress type="spinner" size="medium" intent="warning"></semantic-progress>
66 <semantic-progress type="spinner" size="medium" intent="danger"></semantic-progress>
67 </div>
68
69 <div class="demo-row">
70 <span class="demo-label">Large:</span>
71 <semantic-progress type="spinner" size="large"></semantic-progress>
72 <semantic-progress type="spinner" size="large" intent="success"></semantic-progress>
73 <semantic-progress type="spinner" size="large" intent="warning"></semantic-progress>
74 <semantic-progress type="spinner" size="large" intent="danger"></semantic-progress>
75 </div>
76
77 <div class="demo-row">
78 <span class="demo-label">With Label:</span>
79 <semantic-progress type="spinner" label="Loading..."></semantic-progress>
80 <semantic-progress type="spinner" label="Processing..." intent="success"></semantic-progress>
81 </div>
82 </div>
83
84 <div class="demo-section">
85 <h2>Progress Bars - Determinate</h2>
86
87 <div class="demo-row">
88 <span class="demo-label">0%:</span>
89 <semantic-progress type="bar" value="0"></semantic-progress>
90 </div>
91
92 <div class="demo-row">
93 <span class="demo-label">25%:</span>
94 <semantic-progress type="bar" value="25"></semantic-progress>
95 </div>
96
97 <div class="demo-row">
98 <span class="demo-label">50%:</span>
99 <semantic-progress type="bar" value="50"></semantic-progress>
100 </div>
101
102 <div class="demo-row">
103 <span class="demo-label">75%:</span>
104 <semantic-progress type="bar" value="75"></semantic-progress>
105 </div>
106
107 <div class="demo-row">
108 <span class="demo-label">100%:</span>
109 <semantic-progress type="bar" value="100"></semantic-progress>
110 </div>
111 </div>
112
113 <div class="demo-section">
114 <h2>Progress Bars - Intent Colors</h2>
115
116 <div class="demo-row">
117 <span class="demo-label">Primary:</span>
118 <semantic-progress type="bar" value="70" intent="primary"></semantic-progress>
119 </div>
120
121 <div class="demo-row">
122 <span class="demo-label">Success:</span>
123 <semantic-progress type="bar" value="70" intent="success"></semantic-progress>
124 </div>
125
126 <div class="demo-row">
127 <span class="demo-label">Warning:</span>
128 <semantic-progress type="bar" value="70" intent="warning"></semantic-progress>
129 </div>
130
131 <div class="demo-row">
132 <span class="demo-label">Danger:</span>
133 <semantic-progress type="bar" value="70" intent="danger"></semantic-progress>
134 </div>
135 </div>
136
137 <div class="demo-section">
138 <h2>Progress Bars - Sizes</h2>
139
140 <div class="demo-row">
141 <span class="demo-label">Small:</span>
142 <semantic-progress type="bar" size="small" value="60"></semantic-progress>
143 </div>
144
145 <div class="demo-row">
146 <span class="demo-label">Medium:</span>
147 <semantic-progress type="bar" size="medium" value="60"></semantic-progress>
148 </div>
149
150 <div class="demo-row">
151 <span class="demo-label">Large:</span>
152 <semantic-progress type="bar" size="large" value="60"></semantic-progress>
153 </div>
154 </div>
155
156 <div class="demo-section">
157 <h2>Progress Bars - Indeterminate</h2>
158 <p style="color: #8e8e93; font-size: 14px; margin-bottom: 20px;">When no value attribute is specified, the progress bar shows an animated indeterminate state.</p>
159
160 <div class="demo-row">
161 <span class="demo-label">Primary:</span>
162 <semantic-progress type="bar" intent="primary"></semantic-progress>
163 </div>
164
165 <div class="demo-row">
166 <span class="demo-label">Success:</span>
167 <semantic-progress type="bar" intent="success"></semantic-progress>
168 </div>
169
170 <div class="demo-row">
171 <span class="demo-label">Warning:</span>
172 <semantic-progress type="bar" intent="warning"></semantic-progress>
173 </div>
174
175 <div class="demo-row">
176 <span class="demo-label">Danger:</span>
177 <semantic-progress type="bar" intent="danger"></semantic-progress>
178 </div>
179 </div>
180
181 <div class="demo-section">
182 <h2>Progress Bars - With Labels</h2>
183
184 <div class="demo-row">
185 <semantic-progress type="bar" value="33" label="Uploading file (33%)"></semantic-progress>
186 </div>
187
188 <div class="demo-row">
189 <semantic-progress type="bar" value="67" intent="success" label="Processing data (67%)"></semantic-progress>
190 </div>
191
192 <div class="demo-row">
193 <semantic-progress type="bar" value="90" intent="warning" label="Almost done (90%)"></semantic-progress>
194 </div>
195
196 <div class="demo-row">
197 <semantic-progress type="bar" intent="primary" label="Analyzing..."></semantic-progress>
198 </div>
199 </div>
200
201 <div class="demo-section">
202 <h2>Dynamic Progress Example</h2>
203 <p style="color: #8e8e93; font-size: 14px; margin-bottom: 20px;">This progress bar updates automatically to demonstrate reactive updates.</p>
204
205 <div class="demo-row">
206 <semantic-progress id="dynamic-progress" type="bar" value="0" intent="success" label="Starting..."></semantic-progress>
207 </div>
208
209 <div class="demo-row">
210 <semantic-action id="start-btn" intent="primary">Start Upload</semantic-action>
211 <semantic-action id="reset-btn" intent="secondary">Reset</semantic-action>
212 </div>
213 </div>
214
215 <div class="demo-section">
216 <h2>Real-World Use Cases</h2>
217
218 <div style="background: #1c1c1e; padding: 20px; border-radius: 12px; margin-bottom: 20px;">
219 <h3 style="margin-top: 0; font-size: 16px;">File Upload</h3>
220 <semantic-progress type="bar" value="45" label="document.pdf (3.2 MB / 7.1 MB)"></semantic-progress>
221 </div>
222
223 <div style="background: #1c1c1e; padding: 20px; border-radius: 12px; margin-bottom: 20px;">
224 <h3 style="margin-top: 0; font-size: 16px;">Installation Progress</h3>
225 <semantic-progress type="bar" value="80" intent="success" label="Installing dependencies... (8/10)"></semantic-progress>
226 </div>
227
228 <div style="background: #1c1c1e; padding: 20px; border-radius: 12px; margin-bottom: 20px;">
229 <h3 style="margin-top: 0; font-size: 16px;">Loading State</h3>
230 <div style="display: flex; align-items: center; gap: 12px;">
231 <semantic-progress type="spinner" size="small"></semantic-progress>
232 <span style="color: #ababab; font-size: 14px;">Loading your dashboard...</span>
233 </div>
234 </div>
235
236 <div style="background: #1c1c1e; padding: 20px; border-radius: 12px;">
237 <h3 style="margin-top: 0; font-size: 16px;">Disk Usage</h3>
238 <semantic-progress type="bar" value="87" intent="warning" size="large" label="87% of 1 TB used"></semantic-progress>
239 </div>
240 </div>
241
242 <script>
243 // Dynamic progress demo
244 const dynamicProgress = document.getElementById('dynamic-progress');
245 const startBtn = document.getElementById('start-btn');
246 const resetBtn = document.getElementById('reset-btn');
247 let interval;
248 let progress = 0;
249
250 startBtn.addEventListener('click', () => {
251 if (interval) return; // Already running
252
253 interval = setInterval(() => {
254 progress += 1;
255 dynamicProgress.setAttribute('value', progress);
256 dynamicProgress.setAttribute('label', `Uploading... (${progress}%)`);
257
258 if (progress >= 100) {
259 clearInterval(interval);
260 interval = null;
261 dynamicProgress.setAttribute('label', 'Upload complete!');
262 dynamicProgress.setAttribute('intent', 'success');
263 }
264 }, 50);
265 });
266
267 resetBtn.addEventListener('click', () => {
268 if (interval) {
269 clearInterval(interval);
270 interval = null;
271 }
272 progress = 0;
273 dynamicProgress.setAttribute('value', '0');
274 dynamicProgress.setAttribute('label', 'Ready to start');
275 dynamicProgress.setAttribute('intent', 'primary');
276 });
277 </script>
278</body>
279</html>