-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.html
480 lines (392 loc) · 16.2 KB
/
list.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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Bato Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<!-- Facebook and Twitter integration -->
<meta property="og:title" content=""/>
<meta property="og:image" content=""/>
<meta property="og:url" content=""/>
<meta property="og:site_name" content=""/>
<meta property="og:description" content=""/>
<meta name="twitter:title" content="" />
<meta name="twitter:image" content="" />
<meta name="twitter:url" content="" />
<meta name="twitter:card" content="" />
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="shortcut icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Karla:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700" rel="stylesheet">
<!-- Animate.css -->
<link rel="stylesheet" href="css/animate.css">
<!-- Icomoon Icon Fonts-->
<link rel="stylesheet" href="css/icomoon.css">
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.css">
<!-- Owl Carousel -->
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/owl.theme.default.min.css">
<!-- Magnific Popup -->
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/style.css">
<!-- Modernizr JS -->
<script src="js/modernizr-2.6.2.min.js"></script>
<!-- FOR IE9 below -->
<!--[if lt IE 9]>
<script src="js/respond.min.js"></script>
<![endif]-->
<style>
@import url('https://fonts.googleapis.com/css?family=Do+Hyeon|Noto+Sans+KR&display=swap');
p#yt_title_font{
font-family:'Do Hyeon';
}
p#yt_desc_font{
font-family: 'roboto';
}
body{
background-color: ivory;
}
/* .yt_video_list{
box-sizing: border-box;
margin: 30px;
margin-left: 10%;
padding: 30px;
width: 80%;
height: auto;
border: 1px solid #F9CE00;
background: transparent;
overflow: hidden;
vertical-align: middle;
display: inline-block;
position:relative;
} */
img{
display: block;
width: 100%;
height: 100%;
margin: 0px;
display: flex;
}
.col-md-12_1 {
width: 20%;
}
.yt_video_list{
box-sizing: border-box;
margin: 30px;
margin-left: 10px;
padding: 30px;
width: 98%;
height: auto;
border: 1px solid #F9CE00;
background: transparent;
overflow: hidden;
vertical-align: middle;
display: inline-block;
position:relative;
}
/* img{
display: block;
width:100%;
height: 100%;
margin: 0px;
display: flex;
} */
/* 유튜브 영상 스타일 */
.yt_item{
display:flex;
justify-content: center;
margin-bottom: 10px;
padding: 10px;
}
.yt_item span{
display: block;
margin: 0;
padding: 0;
}
.yt_item > .yt_title_desc{
margin: 30px auto;
}
.yt_item > .yt_title{
margin-top: 20px;
}
.yt_item > .yt_title_desc > .yt_desc{
margin: auto;
}
.yt_item > a,
.yt_item > span{
margin-left: 10px;
width: 45%;
height: 100%;
}
</style>
</head>
<body>
<nav id="colorlib-main-nav" role="navigation">
<a href="#" class="js-colorlib-nav-toggle colorlib-nav-toggle active"><i></i></a>
<div class="js-fullheight colorlib-table">
<div class="colorlib-table-cell js-fullheight">
<div class="row">
<div class="col-md-12">
<ul>
<li class="active"><a href="index.html">Home</a></li>
<li><a href="work.html">Login</a></li>
<li><a href="blog.html">Join</a></li>
<li><a href="about.html">About</a></li>
</ul>
</div>
</div>
<div class="row">
<!-- <div class="col-md-12">
<h2 class="head-title">Gallery</h2>
<a href="images/work-1.jpg" class="gallery image-popup-link text-center" style="background-image: url(images/work-1.jpg);">
<span><i class="icon-search3"></i></span>
</a>
<a href="images/work-2.jpg" class="gallery image-popup-link text-center" style="background-image: url(images/work-2.jpg);">
<span><i class="icon-search3"></i></span>
</a>
<a href="images/work-3.jpg" class="gallery image-popup-link text-center" style="background-image: url(images/work-3.jpg);">
<span><i class="icon-search3"></i></span>
</a>
<a href="images/work-4.jpg" class="gallery image-popup-link text-center" style="background-image: url(images/work-4.jpg);">
<span><i class="icon-search3"></i></span>
</a>
</div> -->
</div>
</div>
</div>
</nav>
<div id="colorlib-page">
<header>
<div class="container">
<div class="row">
<div class="col-md-12_1">
<div class="colorlib-navbar-brand">
<a class="colorlib-logo" href="index.html">YORI</a>
</div>
</div>
<a href="#" class="js-colorlib-nav-toggle colorlib-nav-toggle"><i></i></a>
</div>
</div>
</div>
</header>
<div class="text_search">
<input type = "text" class="list_search" placeholder="오늘 뭐 먹지?" name="search" id="query">
<button id="query-btn" class="btn btn-primary" ><i class="icon-search3"></i></button>
</div>
<div id="colorlib-work1a">
<div class="container">
<div class="row text-center">
</div>
<div id = "yt_video_list" class = "yt_video_list">
<article id="arti">
<div id="thumb"></div>
<div id="details">
<h4 id="d_title"></h4>
<p id="d_description"></p>
</div>
</article>
<!-- <div id = "yt_video_list" class = "yt_video_list">
</div> -->
</div>
</div>
<footer>
<div id="footer">
<div class="container">
<div class="row">
<div class="col-md-4 col-pb-sm text-center">
<div class="row">
<div class="col-md-10">
<h2>Office</h2>
<p>291 South 21th Street, <br> Suite 721 New York NY 10016</p>
</div>
</div>
</div>
<div class="col-md-4 col-pb-sm text-center">
<h2>Get in Touch</h2>
<p><a href="#">[email protected]</a></p>
</div>
<div class="col-md-4 col-pb-sm text-center">
<h2>Social</h2>
<p class="colorlib-social-icons">
<a href="#"><i class="icon-facebook4"></i></a>
<a href="#"><i class="icon-twitter3"></i></a>
<a href="#"><i class="icon-googleplus"></i></a>
<a href="#"><i class="icon-dribbble2"></i></a>
</p>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<p>
<span class="block"><!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. -->
Copyright ©<script>document.write(new Date().getFullYear());</script> All rights reserved | This template is made with <i class="icon-heart" aria-hidden="true"></i> by <a href="https://colorlib.com" target="_blank">Colorlib</a>
<!-- Link back to Colorlib can't be removed. Template is licensed under CC BY 3.0. --><br></span>
<span class="block">Demo Images: <a href="http://unsplash.co/" target="_blank">Unsplash</a></span>
</p>
</div>
</div>
</div>
</div>
</footer>
</div>
<script src="js/jquery-3.4.1.min.js"></script>
<script src="./js/auth.js"></script>
<script src="https://apis.google.com/js/client.js?onload=googleApiClientReady"></script>
<script>
$(function () {
function playerPage(index){
// window.location.href = 'http://127.0.0.1:5500/0217/yt_player.html?id='+index;
window.location.href = 'http://127.0.0.1:5500/0217/bato/player.html?id='+index;
}
//검색창에 넘어온 keyword가 들어오면 검색 리스트 보여줌
var mainkey = localStorage.getItem('keyword');
var keyword = $('#query').val();
if(mainkey!=""){
keyword=localStorage.getItem('keyword');
document.getElementById('query').value = keyword;
console.log("검색어:" +keyword);
$('#query-btn').trigger('click');
}else{
keyword=$('#query').val()+'레시피';
}
$('#query-btn').on('click',function(){
var apiKey = 'AIzaSyBgl-6nqN9UV7-70C_JtAThBC-jv90we88';
$.ajax({
url:'https://www.googleapis.com/youtube/v3/search?key='+apiKey+'&part=snippet&q='+keyword,
success:function(data){
$('#yt_video_list').empty();
console.log('keyword:'+keyword);
for (let i = 0; i < data.items.length; i++) {
$('#yt_video_list').append(
'<div class="yt_item">'+
'<h3>' + (i + 1) + '</h3><a href= "#" class="videoId_' + i + '"><img src="http://img.youtube.com/vi/' +
data.items[i].id.videoId + '/mqdefault.jpg"></a>'+
'<span class="yt_title_desc">'+
'<span class="yt_title"><p id = "yt_title_font" style="color:#664B00; font-size:150%">'+data.items[i].snippet.title+'</p></span>'+
'<span class="yt_desc"><p id = "yt_desc_font" style="color:grey; font-size:100%">'+data.items[i].snippet.description+'</p></span>'+
'</span>'+
'</div>'
);
localStorage.setItem('videoId_'+i,data.items[i].id.videoId);
}
$('.yt_item > a').on('click',function(){
let $classNm = $(this).attr('class');
playerPage($classNm);
// alert($class);
});
}
});
});
});
window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; // api 불러오는 코드
const recognition = new SpeechRecognition(); //api 호출
recognition.interimResults= false; // 말하는 과정까지 띄워줌 / false = 말 끝나면 띄워줌
recognition.lang = 'ko-KR'; // 언어 설정
let p = document.createElement('p'); // 하얀 박스
const words = document.querySelector('.words'); // 음성을 글자로
// words.appendChild(p); // 음성을 박스에 띄워주는 코드
recognition.addEventListener('result', voiceRecording =>{
const transcript = Array.from(voiceRecording.results)
.map(result => result[0])
.map(result => result.transcript)
.join('');
p.textContent = transcript; // transcript = 사용자 음성 / 사용자 음성을 하얀 박스에 띄움
if (voiceRecording.results[0].isFinal) { // 말이 끝나면 새롭게 문단을 나눠주는 코드
// p=document.createElement('p'); // transcript를 띄워주는 코드
// words.appendChild(p);
}
console.log("자막 : "+transcript);
var keywordsArr = ['크림 리조또','오므라이스','떡볶이', '파스타', '흑양탕', '지리탕', '햄버거', '까르보나라 떡볶이', '하루 한 끼']; // 검색어 띄워주기
for(var i = 0; i <keywordsArr.length; i++) {
if (transcript.includes(keywordsArr[i])) { // 특정 문자열 포함 여부 확인
document.getElementById('query').value = keywordsArr[i];
}
}
//검색창에 음식 이름 들어가면 자동으로 검색된다.
//자동 버튼
if(document.getElementById('query').value!=""){
$('#query-btn').trigger('click'); //버튼 자동으로 클릭해줌
console.log('클릭시 : '+document.getElementById('query').value);
// return false;
};
//요리부르기
if (transcript.includes('요리') || transcript.includes('유리')){ // 특정 문자열 포함 여부 확인
}
//인덱스로 재생목록 중에서 재생할 영상 고르기
else if (transcript.includes('1') || transcript.includes('1번') || transcript.includes('첫 번') || transcript.includes('첫')){
$('.videoId_0').trigger('click');
text_to_speech("첫번째 영상을 재생할게요.");
}
else if (transcript.includes('2') || transcript.includes('2번') || transcript.includes('두 번') || transcript.includes('이번')){
$('.videoId_1').trigger('click');
text_to_speech("두번째 영상을 재생할게요.");
}
else if (transcript.includes('3') || transcript.includes('3번') || transcript.includes('세 번') || transcript.includes('세')){
$('.videoId_2').trigger('click');
text_to_speech("세번째 영상을 재생할게요.");
}
else if (transcript.includes('4') || transcript.includes('4번') || transcript.includes('네 번') ){
$('.videoId_3').trigger('click');
text_to_speech("네번째 영상을 재생할게요.");
}
else if (transcript.includes('5') || transcript.includes('5번') || transcript.includes('다섯번') || transcript.includes('다섯')){
$('.videoId_4').trigger('click');
text_to_speech("다섯번째 영상을 재생할게요.");
}
});
recognition.addEventListener('end', recognition.start); // 음성 인식이 끝나면 다시 시작하는 코드
recognition.start();
// 텍스트를 음성으로
function text_to_speech(txt) {
// Web Speech API - speech synthesis
if ('speechSynthesis' in window) {
// Synthesis support. Make your web apps talk!
console.log("음성합성을 지원하는 브라우저입니다.");
}
var systemVoice = new SpeechSynthesisUtterance();
var voices = window.speechSynthesis.getVoices();
// systemVoice.voice = voices[10]; // 두번째 부터 완전 외국인 발음이 됨. 사용하지 말것.
systemVoice.voiceURI = 'native';
systemVoice.volume = 1; // 0 to 1
systemVoice.rate = 0.9; // 0.1 to 10
systemVoice.pitch = 1.5; //0 to 2
systemVoice.text = txt;
systemVoice.lang = 'ko-KR';
systemVoice.onend = function (e) {
if (isRecognizing == false) {
recognition.start();
}
console.log('Finished in ' + event.elapsedTime + ' seconds.');
};
window.speechSynthesis.speak(systemVoice);
}
</script>
<script src="js/jquery-3.4.1.min.js"></script>
<script type = "text/javascript">
// $(document).ready(function(){
// text_to_speech("어떤 요리를 검색할까요?");
// systemMessage.innerHTML = '어떤 요리를 검색할까요?';
// });
</script>
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- jQuery Easing -->
<script src="js/jquery.easing.1.3.js"></script>
<!-- Bootstrap -->
<script src="js/bootstrap.min.js"></script>
<!-- Waypoints -->
<script src="js/jquery.waypoints.min.js"></script>
<!-- Owl Carousel -->
<script src="js/owl.carousel.min.js"></script>
<!-- Magnific Popup -->
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/magnific-popup-options.js"></script>
<!-- Main JS (Do not remove) -->
<script src="js/main.js"></script>
</body>
</html>