Changes to fancy

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-25 20:12:29 +01:00
parent 779cdaf411
commit fd649665c5
4 changed files with 38 additions and 2 deletions

View File

@@ -282,6 +282,11 @@ hide mdi-action-visibility mdi-action-visibility-off
.mega{ .mega{
padding: 6% 0px; padding: 6% 0px;
background: #FF2626; background: #FF2626;
-webkit-transition:opacity 1s;
}
.room-namer::-webkit-input-placeholder{
color:red !important;
} }
.mega h5{ .mega h5{

View File

@@ -1 +1 @@
!function(){var e,t,o={populate_channels:function(t){var n="",a=0;t.sort(o.sortFunction),pre_card=$(e);for(x in t){var i=t[x][3];if(20>a){var s=t[x][1],l=t[x][0],r="background-image:url('https://img.youtube.com/vi/"+s+"/hqdefault.jpg');",c=t[x][4],d=pre_card;d.find(".chan-name").text(i),d.find(".chan-name").attr("title",i),d.find(".chan-views").text(l),d.find(".chan-songs").text(c),d.find(".chan-bg").attr("style",r),d.find(".chan-link").attr("href",i),$("#channels").append(d.html())}n+="<option value='"+i+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=n,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(e,t){var o=e[0],n=t[0],a=e[4],i=t[4];return n>o?1:o>n?-1:i>a?1:a>i?-1:0},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var a=o[n];" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){"#donation"==window.location.hash&&$("#donation").openModal(),e=$("#channel-list-container").html(),window.list_html=e,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":8880");n.emit("frontpage_lists"),n.on("playlists",function(e){o.populate_channels(e)});var a=0;if(document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="https://www.youtube.com/v/0IGsNdVoEh0?autoplay=1&showinfo=0&autohide=1")}),navigator.userAgent.toLowerCase().indexOf("android")>-1&&""==o.getCookie("show_prompt")){var i=confirm("Do you want to download the native app for this webpage?");if(i)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var s=new Date;s.setTime(s.getTime()+864e6);var l="expires="+s.toUTCString();document.cookie="show_prompt=false;"+l}}t=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,t=$.parseJSON(t),$("#latest-commit").html("Latest Commit: <br>"+t[0].commit.author.date.substring(0,10)+": "+t[0].committer.login+"<br><a href='"+t[0].html_url+"'>"+t[0].sha.substring(0,10)+"</a>: "+t[0].commit.message+"<br")})}(); !function(){var e,t,o={populate_channels:function(t){var n="",a=0;t.sort(o.sortFunction),pre_card=$(e),o.add_backdrop(t,0);for(x in t){var s=t[x][3];if(20>a){var i=t[x][1],l=t[x][0],r="background-image:url('https://img.youtube.com/vi/"+i+"/hqdefault.jpg');",c=t[x][4],d=pre_card;d.find(".chan-name").text(s),d.find(".chan-name").attr("title",s),d.find(".chan-views").text(l),d.find(".chan-songs").text(c),d.find(".chan-bg").attr("style",r),d.find(".chan-link").attr("href",s),$("#channels").append(d.html())}n+="<option value='"+s+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=n,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(e,t){var o=e[0],n=t[0],a=e[4],s=t[4];return n>o?1:o>n?-1:s>a?1:a>s?-1:0},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var a=o[n];" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""},add_backdrop:function(e,t){console.log(e.length),t>=e.length&&(t=0);var n=e[t][1];$.ajax({type:"POST",data:{id:n},url:"/php/imageblob.php",success:function(o){$(".mega").css("opacity",0),setTimeout(function(){$(".mega").css("background","url(data:image/png;base64,"+o+")"),$(".mega").css("background-size","200%"),$(".mega").css("opacity",1),$("#search").attr("placeholder",e[t][3])},1e3)}}),setTimeout(function(){o.add_backdrop(e,t+1)},6e3)}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){"#donation"==window.location.hash&&$("#donation").openModal(),e=$("#channel-list-container").html(),window.list_html=e,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":8880");n.emit("frontpage_lists"),n.on("playlists",function(e){o.populate_channels(e)});var a=0;if(document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="https://www.youtube.com/v/0IGsNdVoEh0?autoplay=1&showinfo=0&autohide=1")}),navigator.userAgent.toLowerCase().indexOf("android")>-1&&""==o.getCookie("show_prompt")){var s=confirm("Do you want to download the native app for this webpage?");if(s)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var i=new Date;i.setTime(i.getTime()+864e6);var l="expires="+i.toUTCString();document.cookie="show_prompt=false;"+l}}t=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,t=$.parseJSON(t),$("#latest-commit").html("Latest Commit: <br>"+t[0].commit.author.date.substring(0,10)+": "+t[0].committer.login+"<br><a href='"+t[0].html_url+"'>"+t[0].sha.substring(0,10)+"</a>: "+t[0].commit.message+"<br")})}();

File diff suppressed because one or more lines are too long

View File

@@ -24,6 +24,8 @@ var Nochan = {
pre_card = $(list_html); pre_card = $(list_html);
Nochan.add_backdrop(lists, 0);
for(x in lists) for(x in lists)
{ {
@@ -84,6 +86,35 @@ var Nochan = {
if (c.indexOf(name) == 0) return c.substring(name.length,c.length); if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
} }
return ""; return "";
},
add_backdrop: function(list, i) {
console.log(list.length)
if(i >= list.length) i = 0;
var id = list[i][1];
$.ajax({
type: "POST",
data: {id:id},
url: "/php/imageblob.php",
success: function(data){
//data will contain the vote count echoed by the controller i.e.
$(".mega").css("opacity", 0);
setTimeout(function(){
$(".mega").css("background", "url(data:image/png;base64,"+data+")");
$(".mega").css("background-size" , "200%");
$(".mega").css("opacity", 1);
$("#search").attr("placeholder", list[i][3]);
},1000);
//then append the result where ever you want like
//$("span#votes_number").html(data); //data will be containing the vote count which you have echoed from the controller
}
});
setTimeout(function(){
Nochan.add_backdrop(list, i+1);
},6000);
} }