diff --git a/index.php b/index.php index a160481f..06ad4d14 100755 --- a/index.php +++ b/index.php @@ -13,6 +13,7 @@ +
diff --git a/js/list.js b/js/list.js index 862e28bb..55bceb50 100755 --- a/js/list.js +++ b/js/list.js @@ -132,19 +132,34 @@ function vote(id, vote){ } function skip(){ - console.log($.ajax({ + voteRes = ($.ajax({ type: "GET", url: "php/change.php", async: false, data: "skip", success: function() { console.log("voted to skip song"); - $("#search").addClass("success"); + //$("#search").addClass("success"); updateList(); }, }).responseText); + + console.log(voteRes.split("/")); + skipVotes = voteRes.split("/"); + if(skipVotes[0]>= skipVotes[1]/2) + { + document.getElementById("sBar").innerHTML = "Successfully skipped!"; + $("#sBar").addClass("opacityFull"); + }else + { + document.getElementById("pBar").innerHTML = "Vote registrated! "+skipVotes[0]+" of "+skipVotes[1]+" has skipped. "+(Math.ceil(skipVotes[1]/2))+" or more is needed!"; + $("#pBar").addClass("opacityFull"); + } + setTimeout(function(){ $("#search").removeClass("success"); + $("#sBar").removeClass("opacityFull"); + $("#pBar").removeClass("opacityFull"); },1500); } diff --git a/static/style.css b/static/style.css index 3005ecf1..875cc904 100755 --- a/static/style.css +++ b/static/style.css @@ -487,7 +487,7 @@ input[type="radio"] { box-shadow:0 0 10px .5px #000; } -#eBar,#sBar { +#eBar,#sBar, #pBar { font-family:'Open Sans',sans-serif; font-weight:300; color:#fff; @@ -509,6 +509,10 @@ input[type="radio"] { background-color:#5bcf2b; } +#pBar { + background-color:rgb(28, 143, 194); +} + .opacityFull { opacity:1!important; } @@ -787,7 +791,9 @@ input[type="radio"] { } .nochanvcent { - top:50%; + position: absolute; + top:10%; + /*top:50%;*/ -webkit-transform:translateY(0%); }