-
Notifications
You must be signed in to change notification settings - Fork 0
/
practice.html
322 lines (277 loc) · 10.9 KB
/
practice.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style2.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="폰트어썸 본인 CDN" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@200&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style3.css">
<link rel="stylesheet" href="select_style.css">
<script src="main.js" defer></script>
<link rel="shortcut icon" type="image⁄x-icon" href="C:\Users\SAMSUNG\Desktop\버스.png">
<title>Bus Information System</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
<!--파이썬 css 연동-->
<link rel="stylesheet" href="{{ url_for('static', filename='css/style2.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style3.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/select_style.css') }}">
</head>
<body style="background-color: #d7e1ec;">
<nav class="navbar">
<div class="navbar__logo">
<!--i class="fab fa-amazon"></i-->
<i class="fa fa-bus"></i>
<a href="#">BIS</a>
</div>
<ul class="navbar__menu" >
<li><a href="#">버스노선</a></li>
<li><a href="#">정류소명</a></li>
<li><a href="#">승하차예약</a></li>
<li><a href="#">출도착안내</a></li>
<li><a href="#">이용안내</a></li>
</ul>
<!--ul class="navbar__sns">
<li><a href="#"><i class="fab fa-twitter"></i></a></li>
<li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
</ul-->
<div class="menu">
<input type="text" placeholder="Search..." class="input_text">
<button class="fa fa-search" ></button>
</div>
<a href="#" class="navbar__toggleBtn"> <i class="fas fa-bars"></i> </a>
</nav>
<!--bus icon-->
<div class="wrapper">
<div class="icon facebook" onClick="location.href='busstop_r.html'">
<div class="tooltip">Route</div>
<span><i class="fa fa-database"></i></span>
</div>
<div class="icon twitter" onClick="location.href='busstop_p.html'">
<div class="tooltip">Busstop</div>
<span><i class="fa fa-bus"></i></span>
</div>
<div class="icon star" onClick="location.href='speech.html'">
<div class="tooltip">GetOnOff</div>
<span><i class="fa fa-envelope"></i></span>
</div>
<div class="icon github">
<div class="tooltip">Time</div>
<span><i class="fa fa-file"></i></span>
</div>
<div class="icon youtube">
<div class="tooltip">Information</div>
<span><i class="fa fa-info"></i></span>
</div>
<div class="icon hospital">
<div class="tooltip">Hospital</div>
<span><i class="fa fa-ambulance"></i></span>
</div>
<div class="icon welfare">
<div class="tooltip">Welfare</div>
<span><i class="fa fa-blind"></i></span>
</div>
</div>
<!--bus icon-->
<style>
.wrapper{
height:600px;
display:flex;
justify-content: center;
align-items: center;
}
.wrapper .icon{
margin: 0 20px;
cursor:pointer;
display:flex;
align-items:center;
justify-content:center;
flex-direction:column;
position: relative;
z-index:2;
}
.wrapper .icon span{
position:relative;
z-index:2;
height: 60px;
width: 60px;
display:block;
background: #fff;
box-shadow: 0 10px 10px rgba(0,0,0,0.1);
border-radius:50%;
text-align:center;
transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper .icon span i{
font-size:25px;
line-height:60px;
}
.wrapper .icon .tooltip{
position:absolute;
top:0px;
background: #fff;
box-shadow: 0 10px 10px rgba(0,0,0,0.1);
font-size: 20px;
padding: 10px 18px;
border-radius: 25px;
color:white;
opacity:0;
pointer-events: none;
transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.wrapper .icon:hover .tooltip{
opacity:1;
pointer-events: auto;
top:-70px;
}
.wrapper .icon .tooltip:before{
position:absolute;
content:"";
height:15px;
width:15px;
bottom:-8px;
left:50%;
transform: translateX(-50%) rotate(45deg);
}
.wrapper .icon:hover span,
.wrapp .icon:hover .tooltip{
text-shadow: 0px -1px 0px rgba(0,0,0,0.4);
}
.wrapper .icon:hover span{
color: #fff;
}
.wrapper .facebook:hover span,
.wrapper .facebook:hover .tooltip,
.wrapper .facebook:hover .tooltip:before{
background:#008000;
}
.wrapper .star:hover span,
.wrapper .star:hover .tooltip,
.wrapper .star:hover .tooltip:before{
background:#5808b4;
}
.wrapper .twitter:hover span,
.wrapper .twitter:hover .tooltip,
.wrapper .twitter:hover .tooltip:before{
background:#ff9900;
}
.wrapper .github:hover span,
.wrapper .github:hover .tooltip,
.wrapper .github:hover .tooltip:before{
background:#333;
}
.wrapper .youtube:hover span,
.wrapper .youtube:hover .tooltip,
.wrapper .youtube:hover .tooltip:before{
background:#3B5999;
}
.wrapper .hospital:hover span,
.wrapper .hospital:hover .tooltip,
.wrapper .hospital:hover .tooltip:before{
background:#ffd700;
}
.wrapper .welfare:hover span,
.wrapper .welfare:hover .tooltip,
.wrapper .welfare:hover .tooltip:before{
background:#ff1493;
}
</style>
<!--speech to text-->
<div class="words" id="txt" contenteditable style=" float:left; margin-right:100px; width:500px"> <!--왼쪽 text box!-->
</div>
<script>
window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
const recognition = new SpeechRecognition();
recognition.interimResults = true;
recognition.maxAlternatives = 10000;
let p = document.createElement('p');
const words = document.querySelector('.words');
words.appendChild(p);
recognition.addEventListener('result', e => {
const transcript = Array.from(e.results)
.map(result => result[0])
.map(result => result.transcript)
.join('');
p.textContent = transcript;
if(e.results[0].isFinal) {
p = document.createElement('p');
words.appendChild(p);
}
if(transcript.includes('날씨')) {
console.log('오늘의 날씨는 직접 알아보세요.');
}
if(transcript.includes('노선')){
var link = 'busstop_r.html';
location.replace(link);
window.open(link);
}
if(transcript.includes('정류')){
var link = 'busstop_p.html';
location.replace(link);
window.open(link);
}
if(transcript.includes('응급')){
var link = 'hospital.html';
location.replace(link);
window.open(link);
}
if(transcript.includes('시설')){
var link = 'welfare.html';
location.replace(link);
window.open(link);
}
if(transcript.includes('예약')){
var link = 'speech.html';
location.replace(link);
window.open(link);
}
console.log(transcript);
});
recognition.addEventListener('end', recognition.start);
recognition.start();
</script>
<style>
html {
font-size: 10px;
}
body {
background: white;
font-family: 'helvetica neue';
font-weight: 200;
font-size: 20px;
}
.words {
max-width: 400px;
/*margin: 150px auto;*/
margin-left: 20px;
margin-top:-550px;
background: #d7e1ec;
border-radius: 5px;
/*box-shadow: 10px 10px 0 rgba(0,0,0,0.1);*/
padding: 1rem 2rem 1rem 5rem;
/*background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px;*/
background-size: 100% 3rem;
position: relative;
line-height: 3rem;
color : #d7e1ec; /*#000a12*/
font-family: "Noto Serif Korean", sans-serif;
font-size:20px;
}
p {
margin: 0 0 3rem;
}
.words:before {
content: '';
position: absolute;
width: 4px;
top: 0;
left: 30px;
bottom: 0;
border: 1px solid;
/*border-color: transparent #efe4e4;*/
border-color : #d7e1ec;
}
</style>
<!--the end-->
</body>
</html>