mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Better looking search results
This commit is contained in:
@@ -26,7 +26,7 @@ $(document).ready(function()
|
|||||||
if(search_input != ""){
|
if(search_input != ""){
|
||||||
var keyword= encodeURIComponent(search_input);
|
var keyword= encodeURIComponent(search_input);
|
||||||
|
|
||||||
var yt_url='http://gdata.youtube.com/feeds/api/videos?q='+keyword+'&format=5&max-results=25&v=2&alt=jsonc';
|
var yt_url='http://gdata.youtube.com/feeds/api/videos?q='+keyword+'&format=5&orderby=relevance&max-results=25&v=2&alt=jsonc';
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -48,8 +48,8 @@ $(document).ready(function()
|
|||||||
var finalhtml="<div id='result' class='result' onclick=\"submit('"+data.id+"','"+video_title+"');\">"+
|
var finalhtml="<div id='result' class='result' onclick=\"submit('"+data.id+"','"+video_title+"');\">"+
|
||||||
"<img src='"+video_thumb+"' class='thumb'>"+
|
"<img src='"+video_thumb+"' class='thumb'>"+
|
||||||
"<div id='title'>"+data.title+""+
|
"<div id='title'>"+data.title+""+
|
||||||
"<span class='result_info'>"+data.uploader+" • "+views+" views • "+length+"</span></div></div>";
|
"<div class='result_info'>"+views+" views • "+length+"</div></div></div>";
|
||||||
|
//+data.uploader+" • "+
|
||||||
$("#results").append(finalhtml);
|
$("#results").append(finalhtml);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ body{background:#000; margin:0; }
|
|||||||
.skip:hover{ -webkit-filter: brightness(1.7);}
|
.skip:hover{ -webkit-filter: brightness(1.7);}
|
||||||
|
|
||||||
#results{position:absolute; background-color: white; font-size: 14px; width:90%; border-radius:3px; margin-left: 5%; margin-top:-20px; z-index: 2; font-family: sans-serif;}
|
#results{position:absolute; background-color: white; font-size: 14px; width:90%; border-radius:3px; margin-left: 5%; margin-top:-20px; z-index: 2; font-family: sans-serif;}
|
||||||
.result{border-bottom:solid 1px #ccc; text-align: left; height: 55px; cursor: pointer; border-radius: 3px;}
|
.result{border-bottom: solid 1px #E5E5E5; text-align: left; height: 70px; cursor: pointer; border-radius: 3px;}
|
||||||
.result:hover{background-color: rgba(0,0,0,0.2);}
|
.result:hover, .result:hover #title, .result:hover .result_info {background-color: rgba(90, 90, 90, 1); color:white !important;}
|
||||||
#title{ padding-left: 20%; padding-top:21px; max-width: 76%; color:#ed207f; height: 36px;}
|
#title{ padding-left: 9%; padding-top: 16px; max-width: 76%; color: #000000; height: 36px;}
|
||||||
.result_info{color:#888; font-size: 12px; float:right;}
|
.result_info{color:#888; font-size: 12px; /* float:right; */padding-top: 6px;}
|
||||||
.thumb{height: 49px; border-radius:3px; float: left; margin: 3px 0px 3px 15px;}
|
.thumb{height: 55px; border-radius:3px; float: left; margin: 7px 0px 7px 15px;}
|
||||||
|
|
||||||
.main{width:90%; margin: 0 auto 0 auto;}
|
.main{width:90%; margin: 0 auto 0 auto;}
|
||||||
.playlist{width:37%; margin-left: 0px; display: inline-block; font-size: 14px; border-radius: 3px; vertical-align: top; height: calc(87% - 183px);}
|
.playlist{width:37%; margin-left: 0px; display: inline-block; font-size: 14px; border-radius: 3px; vertical-align: top; height: calc(87% - 183px);}
|
||||||
|
|||||||
Reference in New Issue
Block a user