조국현

Update view videos button

Link to youtube search list
...@@ -42,33 +42,32 @@ function boxinfo(results){ ...@@ -42,33 +42,32 @@ function boxinfo(results){
42 display:flex; 42 display:flex;
43 flex-wrap:wrap; 43 flex-wrap:wrap;
44 margin-left:50px auto; 44 margin-left:50px auto;
45 -
46 } 45 }
47 <!--검색결과사진,레시피정보 모두 검색창 옆으로 가게하는거까지는 되었고 2열씩 정렬하려 했는데 2열 정렬 부분이 미완성. 우선 사진 옆으로 정보만 수평으로 뜸--> 46 <!--검색결과사진,레시피정보 모두 검색창 옆으로 가게하는거까지는 되었고 2열씩 정렬하려 했는데 2열 정렬 부분이 미완성. 우선 사진 옆으로 정보만 수평으로 뜸-->
48 <!--검색결과 뜰 시에 검색창 위치가 바뀌는 문제 있음--> 47 <!--검색결과 뜰 시에 검색창 위치가 바뀌는 문제 있음-->
49 -
50 -
51 </style> 48 </style>
52 <div class="item"> 49 <div class="item">
53 <img src="${result.recipe.image}" alt=""> 50 <img src="${result.recipe.image}" alt="">
54 <div class="flex-container"> 51 <div class="flex-container">
55 <h1 class="title">${result.recipe.label}</h1> 52 <h1 class="title">${result.recipe.label}</h1>
56 <a href="${result.recipe.url}" target="_blank">View Recipe</a> 53 <a href="${result.recipe.url}" target="_blank">View Recipe</a>
57 - ${(cal => { 54 + <!--result.recipe.labe에 + home + recipe 한 검색결과 페이지를 버튼에 링크시켜놓음-->
58 - if (cal >= 2000) { 55 + <a href="https://www.youtube.com/results?search_query=${result.recipe.label}+home+recipe" target="_blank">View Videos</a>
59 - return `<p style="color:red">${cal}</p>`;
60 - }
61 - else if(cal >= 1000 && cal < 2000){
62 - return `<p style="color:rgb(245,176,65)">${cal}</p>`;
63 - }
64 - else {
65 - return `<p style="color:green">${cal}</p>`;
66 - }
67 - })(object.cal)
68 - }
69 </div> 56 </div>
57 + ${(cal => {
58 + if (cal >= 2000) {
59 + return `<p style="color:red">${cal}</p>`;
60 + }
61 + else if(cal >= 1000 && cal < 2000){
62 + return `<p style="color:yellow">${cal}</p>`;
63 + }
64 + else {
65 + return `<p style="color:green">${cal}</p>`;
66 + }
67 + })(object.cal)
68 + }
70 </div> 69 </div>
71 ` 70 `
72 }) 71 })
73 searchResultDiv.innerHTML = boxsinfo; 72 searchResultDiv.innerHTML = boxsinfo;
74 -} 73 +}
...\ No newline at end of file ...\ No newline at end of file
......
1 +{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"flash":{"error":["Missing username or password.","Missing username or password."]},"__lastAccess":1638672404811}
...\ No newline at end of file ...\ No newline at end of file
1 -{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"flash":{"error":["Missing username or password."]},"__lastAccess":1638671002743}
...\ No newline at end of file ...\ No newline at end of file