-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
207 lines (153 loc) · 5.96 KB
/
index.html
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
206
207
<!DOCTYPE html>
<html class="mdc-typography">
<head>
<meta charset="utf-8">
<link rel='manifest' href='./manifest.json'>
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Text to Speech </title>
<link
rel="stylesheet"
href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css">
<!-- material icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<style>
body {background-image:url('wallpaper.png');}
.th {
position: absolute;
transition: transform .2s;
top: 40px;
font-family:Segoe Print;
left: 50px;
color:yellow;
-ms-transform: rotate(278deg); /* IE 9 */
transform: rotate(342deg);
text-shadow: 1px 3px #8CF7F2;
font-size: 25px;
-webkit-animation: glow 1s ease-in-out infinite alternate;
-moz-animation: glow 1s ease-in-out infinite alternate;
animation: glow 1s ease-in-out infinite alternate;
}
.th:hover{
transform: scale(1.1);
-ms-transform: rotate(278deg); /* IE 9 */
transform: rotate(350deg);
font-size: 40px
}
.blink {
animation: blinker 1s linear infinite;
color: yellow;
font-size: 26px;
font-weight: bold;
}
@keyframes blinker {
50% { opacity: 0; }
}
@-webkit-keyframes glow {
from {
text-shadow: 0 0 10px #F4F967, 0 0 20px #F4F967 , 0 0 30px #F4F967, 0 0 40px #F4F967, 0 0 50px red, 0 0 60px white, 0 0 70px 0C0A0A;
}
to {
text-shadow: 0 0 20px red, 0 0 30px #ff4da6, 0 0 40px #EEE972, 0 0 50px red, 0 0 60px #EEE972, 0 0 70px red, 0 0 80px #F4F967;
}}
input[type=text]{
width:30%;
padding: 15px 20px;
margin: 8px 0;
display: inline-block;
background-color: #f3faca;
border-radius: 7px;
box-sizing: border-box;
box-shadow: 2px 2px #525e55;
}
input[type=text]:hover {
background-color:#dbd2c3;
}
</style>
</head>
<body>
<center>
<header class="mdc-toolbar">
<div class="mdc-toolbar__row">
<section class="mdc-toolbar__section mdc-toolbar__section--align-start">
</section>
<section class="mdc-toolbar__section mdc-toolbar__section--align-end" role="toolbar">
<a href="#" id="clearCache" class="material-icons mdc-toolbar__icon" aria-label="Clear cache" alt="Clear Cache"><i style="color:red;"class="material-icons">refresh</i></a> </section>
</div>
</header>
<h1 style="color:#ffb74a;"class="mdc-typography--display1"><text color:"#42403f">Welcome to "Text to Speech convertor" <br> by HEMANTH N </text></h1>
<input type="text" name="phrase" id="phrase" placeholder="Type something..">    
<button type="button" class="special mdc-button mdc-button--raised">
Say the Phrase
</button>
<br><br><br>
<button type="button" class="standard mdc-button mdc-button--raised">
Hemanth N
</button>
<br><br><br>
<button type="button" class="standard mdc-button mdc-button--raised">
Work for a cause, not for applause.
</button> <br><br>
<button type="button" class="standard mdc-button mdc-button--raised">
Change is the only constant in life.
</button> <br><br>
<button type="button" class="standard mdc-button mdc-button--raised">
Hard Work beats talent, when talent does not work hard.
</button><br>
<div class="mdc-snackbar"
aria-live="assertive"
aria-atomic="true"
aria-hidden="true"
data-mdc-auto-init="MDCSnackbar">
<div class="mdc-snackbar__text"></div>
<div class="mdc-snackbar__action-wrapper">
<button type="button" class="mdc-snackbar__action-button"></button>
</div>
</div>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- Material Components -->
<script src="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js"></script>
<script>window.mdc.autoInit();</script>
<script>
if('serviceWorker' in navigator) {
navigator.serviceWorker
.register('./sw.js')
.then(function() { console.log("Service Worker Registered"); });
}
// reusable function to use the speech API
function sayIt (setOfWords) {
var msg = new SpeechSynthesisUtterance(setOfWords);
window.speechSynthesis.speak(msg);
}
// hook up event handler on the buttons
$("button.standard").on("click", function() {
sayIt($(this).text());
});
$("button.special").on("click", function() {
sayIt($("#phrase").val());
});
// need to be able to clear the cache to load new versions
$("#clearCache").on("click", function() {
caches.open('textToSpeech').then(function(cache) {
cache.delete('./');
cache.delete('./index.html').then(function(response) {
var snackbar = new MDCSnackbar(document.querySelector('.mdc-snackbar'));
var dataObj = {
message: 'Cache cleared'
};
snackbar.show(dataObj);
});
});
});
// Material Components Snackbar stuff
const MDCSnackbar = mdc.snackbar.MDCSnackbar;
const MDCSnackbarFoundation = mdc.snackbar.MDCSnackbarFoundation;
</script>
<b>
<div class="th">
<p class="blink">Text to Speech <br> Convertor <br>By <a href="https://github.com/hemanth-07-11" target=_blank><b><font color="yellow"> HEMANTH N </font></b></a></p>
</div>
</b>
</body>
</html>