-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.jsx
205 lines (195 loc) · 4.99 KB
/
index.jsx
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
193
194
195
196
197
198
199
200
201
202
203
204
205
import React from 'react';
import ReactDom from 'react-dom';
import Speech from './dist/react-speech.min';
const style = {
container: {
width: '100%'
},
text: {
width: '100%',
display: ''
},
play: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '30',
height: '30',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'yellow',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
},
stop: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '34',
height: '34',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'Gainsboro',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
},
pause: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '34',
height: '34',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'Gainsboro',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
},
resume: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '34',
height: '34',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'Gainsboro',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
}
};
const mainstyle = {
fontFamily: 'Helvetica',
fontSize: '0.9em'
};
const textstyle = {
container: {
width: '100%'
},
text: {
width: '100%',
display: ''
},
play: {
hover: {
backgroundColor: 'black',
color: 'white'
},
button: {
padding: '4',
fontFamily: 'Helvetica',
fontSize: '1.0em',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'inherit',
border: 'none'
}
},
stop: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '34',
height: '34',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'Gainsboro',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
},
pause: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '34',
height: '34',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'Gainsboro',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
},
resume: {
hover: {
backgroundColor: 'GhostWhite'
},
button: {
width: '34',
height: '34',
cursor: 'pointer',
pointerEvents: 'none',
outline: 'none',
backgroundColor: 'Gainsboro',
border: 'solid 1px rgba(255,255,255,1)',
borderRadius: 6
}
}
};
ReactDom.render(
<div style={mainstyle}>
<p>I have the default settings</p>
<Speech text="I have the default settings" />
<p>I have altered my voice</p>
<Speech
text="I have altered my voice"
voice="Google UK English Female"
/>
<p>I have changed the colour of the play button and made it smaller</p>
<Speech
styles={style}
text="I have changed the colour of the play buttons and made them smaller"
/>
<p>I have altered the pitch, rate and volume of my voice</p>
<Speech
text="I have altered the pitch, rate and volume of my voice"
pitch="0.5"
rate="0.5"
volume="0.3"
lang="en-GB"
voice="Daniel"
/>
<p>I have set all properties to their default</p>
<Speech
text="I have set all properties to their default"
pitch="1"
rate="1"
volume="1"
lang="en-GB"
voice="Google UK English Male"
/>
<p>I have text displayed as a button</p>
<Speech
styles={textstyle}
textAsButton={true}
displayText="Hello"
text="I have text displayed as a button"
/>
<p>I am displaying all buttons</p>
<Speech
stop={true}
pause={true}
resume={true}
text="I am displaying all buttons"
/>
</div>,
document.getElementById('app')
);