Skip to content

Commit fb04cbc

Browse files
committed
Add SSML example
1 parent 5fa33df commit fb04cbc

File tree

4 files changed

+325
-82
lines changed

4 files changed

+325
-82
lines changed

assets/html/customslider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ aria.widget.slider.prototype.updateThumbPosition = function () {
258258

259259
console.log(this.valueNow);
260260
this.thumb.setAttribute('aria-valuenow', this.valueNow);
261-
this.thumb.setAttribute('aria-valuetext', `${this.valueNow} slices`);
261+
this.thumb.setAttribute('aria-valuetext', `${this.valueNow} ${this.valueNow === 1 ? "slice" : "slices"}`);
262262

263263
var pos = Math.round(
264264
(this.valueNow * this.sliderWidth) / (this.valueMax - this.valueMin)

assets/html/ssml.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
</head>
5+
<body>
6+
7+
<button id="press-to-speak">Press to speak</button>
8+
9+
<script>
10+
var a = `
11+
<speak>
12+
What does the Spanish word
13+
<break time="1s"/><prosody rate="slow"><lang xml:lang="es-ES">casa</lang></prosody><break time="1s"/>
14+
mean in English?
15+
</speak>
16+
`;
17+
18+
var b = `
19+
<speak>
20+
<p>
21+
<s>You have 4 new messages.</s>
22+
<s>The first is from Stephanie Williams and arrived at <break/> 3:45pm.
23+
</s>
24+
<s>
25+
The subject is <prosody rate="-20%">ski trip</prosody>
26+
</s>
27+
</p>
28+
</speak>
29+
`
30+
31+
var utterThis = new SpeechSynthesisUtterance(a);
32+
// utterThis.voice = window.speechSynthesis.getVoices()[0];
33+
document.getElementById("press-to-speak").addEventListener("click", () => {
34+
window.speechSynthesis.speak(utterThis);
35+
});
36+
37+
</script>
38+
</body>
39+
</html>
40+

assets/html/test-assessment-with-slider.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<!DOCTYPE HTML>
22
<html>
33
<head>
4+
<meta charset="UTF-8">
45
<style>
56
body {
67
text-align: center;
78
font-size: 24px;
89
}
9-
1010
#show-score-container {
1111
margin-top: 30px;
1212
}
13-
1413
#show-score-container > button {
1514
font-size: 32px;
1615
}
17-
1816
.first-answer-wrapper {
1917
margin-top: 15px;
2018
}
@@ -29,7 +27,6 @@
2927
margin-right: auto;
3028
width: 300px;
3129
}
32-
3330
div.aria-widget-slider .rail {
3431
margin: 2px;
3532
padding: 1px;
@@ -38,27 +35,30 @@
3835
position: relative;
3936
top: 2em;
4037
}
41-
4238
div.aria-widget-slider .thumb {
4339
border: 1px solid #888;
4440
border-top-color: #666;
4541
border-left-color: #666;
4642
background-color: #DDD;
4743
position: relative;
4844
}
49-
5045
div.aria-widget-slider .value {
5146
width: 2em;
5247
text-align: right;
5348
position: absolute;
5449
}
55-
5650
div.focus .thumb {
5751
border: 1px solid #444;
5852
background-color: #888;
5953
position: relative;
6054
}
61-
55+
.thumb::before {
56+
content: "🍕";
57+
font-size: 44px;
58+
margin-left: -30px;
59+
margin-top: -16px;
60+
position: absolute;
61+
}
6262
div.focus .rail {
6363
background-color: #CCC;
6464
}
@@ -71,6 +71,8 @@ <h1>Pop quiz</h1>
7171
<div>
7272
<h3>Question one</h3>
7373
How many slices are in 1/4 of a pizza with 8 total slices?
74+
<br />
75+
Grab the pizza slice and drag to select your answer!
7476

7577
<div class="aria-widget-slider">
7678
<div class="value">0</div>

0 commit comments

Comments
 (0)