Skip to content

Commit baceaef

Browse files
committed
Update the Demo Page
1 parent 267a646 commit baceaef

File tree

1 file changed

+74
-23
lines changed

1 file changed

+74
-23
lines changed

examples/offline_examples/demo_page.html

Lines changed: 74 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,36 @@
204204
background-color: #fefefe;
205205
border: 2px solid #c1c1c1;
206206
}
207+
.slidecontainer {
208+
width: 100%;
209+
}
210+
.slider {
211+
-webkit-appearance: none;
212+
width: 100%;
213+
height: 20px;
214+
background: #d3d3d3;
215+
outline: none;
216+
opacity: 0.7;
217+
-webkit-transition: .2s;
218+
transition: opacity .2s;
219+
}
220+
.slider:hover {
221+
opacity: 1;
222+
}
223+
.slider::-webkit-slider-thumb {
224+
-webkit-appearance: none;
225+
appearance: none;
226+
width: 16px;
227+
height: 28px;
228+
background: #4CAF50;
229+
cursor: pointer;
230+
}
231+
.slider::-moz-range-thumb {
232+
width: 16px;
233+
height: 28px;
234+
background: #4CAF50;
235+
cursor: pointer;
236+
}
207237
</style>
208238
</head>
209239
<body>
@@ -259,8 +289,13 @@ <h3>Automation Practice</h3>
259289
<td>Placeholder Text Field:</td>
260290
<td><input id="placeholderText" type="text"
261291
placeholder="Placeholder Text Field" /></td>
262-
<td><p>Paragraph with Text:</p></td>
263-
<td><p id="pText" style="color: green; font-size: 20px;">This Text is Green</p></td>
292+
<td>Read-Only Text Field:</td>
293+
<td>
294+
<input type="text" id="readOnlyText"
295+
value="The Color is Green"
296+
style="font-size: 19px; color: green; width: 94%;"
297+
readonly />
298+
</td>
264299
</tr>
265300
<tr>
266301
<td>HTML SVG with rect:</td>
@@ -277,32 +312,27 @@ <h3>Automation Practice</h3>
277312
</rect>
278313
</svg>
279314
</td>
280-
<td><label id="progressLabel" for="progressBar">Progress Bar: (50%)</label></td>
281-
<td><progress id="progressBar" value="50" style="width: 94%;" max="100" /></td>
315+
<td><p>Paragraph with Text:</p></td>
316+
<td><p id="pText" style="color: green; font-size: 20px;">This Text is Green</p></td>
282317
</tr>
283318
<tr>
284-
<td><div style="color: gray;">Disabled Text Field:</div></td>
319+
<td>Input Slider Control:</td>
285320
<td>
286-
<input type="text"
287-
style="color: gray;"
288-
value="NOT Editable!" disabled
289-
id="disabledTextFieldId"
290-
name="disabledTextFieldName"
291-
class="disabledTextFieldClass"/>
292-
</td>
293-
<td>Read-Only Text Field:</td>
294-
<td>
295-
<input type="text" id="readOnlyText"
296-
value="The Color is Green"
297-
style="font-size: 18px; color: green; width: 94%;"
298-
readonly />
321+
<input type="range" min="0" max="4" step="1"
322+
id="mySlider" name="sliderName" value="2"
323+
style="width: 88%;" class="slider"
324+
onclick="sliderFunction1()"
325+
onchange="sliderFunction1()"
326+
onmousemove="sliderFunction1()"/>
299327
</td>
328+
<td><label id="progressLabel" for="progressBar">Progress Bar: (50%)</label></td>
329+
<td><progress id="progressBar" value="50" style="width: 94%;" max="100" /></td>
300330
</tr>
301331
<tr>
302332
<td>Select Dropdown:</td>
303333
<td>
304334
<select id="mySelect" name="selectName"
305-
class="selectClass" onChange="selectFunction1()"
335+
class="selectClass" onchange="selectFunction1()"
306336
style="width: 95%; font-size: 14px;">
307337
<option value="25%">Set to 25%</option>
308338
<option value="50%">Set to 50%</option>
@@ -386,17 +416,13 @@ <h3>Automation Practice</h3>
386416
var x = document.getElementById("myButton");
387417
var y = document.getElementById("pText");
388418
var z = document.getElementById("readOnlyText");
389-
var p = document.getElementById("progressBar");
390-
var pl = document.getElementById("progressLabel");
391419
if (x.style.color != "purple") {
392420
x.style.color = "purple";
393421
x.textContent = "Click Me (Purple)";
394422
y.textContent = "This Text is Purple";
395423
y.style.color = "purple";
396424
z.value = "The Color is Purple";
397425
z.style.color = "purple";
398-
p.value = "100";
399-
pl.textContent = "Progress Bar: (100%)";
400426
}
401427
else {
402428
x.style.color = "green";
@@ -405,9 +431,34 @@ <h3>Automation Practice</h3>
405431
y.style.color = "green";
406432
z.value = "The Color is Green";
407433
z.style.color = "green";
434+
}
435+
}
436+
</script>
437+
<script>
438+
function sliderFunction1() {
439+
var s = document.getElementById("mySlider");
440+
var p = document.getElementById("progressBar");
441+
var pl = document.getElementById("progressLabel");
442+
if (s.value == "0") {
443+
p.value = "0";
444+
pl.textContent = "Progress Bar: (0%)";
445+
}
446+
if (s.value == "1") {
447+
p.value = "25";
448+
pl.textContent = "Progress Bar: (25%)";
449+
}
450+
if (s.value == "2") {
408451
p.value = "50";
409452
pl.textContent = "Progress Bar: (50%)";
410453
}
454+
if (s.value == "3") {
455+
p.value = "75";
456+
pl.textContent = "Progress Bar: (75%)";
457+
}
458+
if (s.value == "4") {
459+
p.value = "100";
460+
pl.textContent = "Progress Bar: (100%)";
461+
}
411462
}
412463
</script>
413464
<script>

0 commit comments

Comments
 (0)