Added halfwayskipbar

This commit is contained in:
Kasper Rynning-Tønnesen
2015-02-15 20:16:20 +01:00
parent 00f63db98c
commit c7dbb1dce5
3 changed files with 26 additions and 4 deletions

View File

@@ -13,6 +13,7 @@
<?php include("php/header.php"); ?> <?php include("php/header.php"); ?>
</head> </head>
<body> <body>
<div id="pBar"></div>
<div id="sBar"></div> <div id="sBar"></div>
<div id="eBar"></div> <div id="eBar"></div>
<div class="bgimage" id="bgimage"></div> <div class="bgimage" id="bgimage"></div>

View File

@@ -132,19 +132,34 @@ function vote(id, vote){
} }
function skip(){ function skip(){
console.log($.ajax({ voteRes = ($.ajax({
type: "GET", type: "GET",
url: "php/change.php", url: "php/change.php",
async: false, async: false,
data: "skip", data: "skip",
success: function() { success: function() {
console.log("voted to skip song"); console.log("voted to skip song");
$("#search").addClass("success"); //$("#search").addClass("success");
updateList(); updateList();
}, },
}).responseText); }).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(){ setTimeout(function(){
$("#search").removeClass("success"); $("#search").removeClass("success");
$("#sBar").removeClass("opacityFull");
$("#pBar").removeClass("opacityFull");
},1500); },1500);
} }

View File

@@ -487,7 +487,7 @@ input[type="radio"] {
box-shadow:0 0 10px .5px #000; box-shadow:0 0 10px .5px #000;
} }
#eBar,#sBar { #eBar,#sBar, #pBar {
font-family:'Open Sans',sans-serif; font-family:'Open Sans',sans-serif;
font-weight:300; font-weight:300;
color:#fff; color:#fff;
@@ -509,6 +509,10 @@ input[type="radio"] {
background-color:#5bcf2b; background-color:#5bcf2b;
} }
#pBar {
background-color:rgb(28, 143, 194);
}
.opacityFull { .opacityFull {
opacity:1!important; opacity:1!important;
} }
@@ -787,7 +791,9 @@ input[type="radio"] {
} }
.nochanvcent { .nochanvcent {
top:50%; position: absolute;
top:10%;
/*top:50%;*/
-webkit-transform:translateY(0%); -webkit-transform:translateY(0%);
} }