Better background and positioning of the volumeslider for mobile

This commit is contained in:
Kasper Rynning-Tønnesen
2017-09-25 22:12:53 +02:00
parent bb40c21f97
commit 55e50edca7
6 changed files with 31 additions and 10 deletions

View File

@@ -2426,13 +2426,28 @@ nav ul li:hover, nav ul li.active {
display: none; display: none;
}*/ }*/
.volume-container {
position: absolute;
right: 0%;
width: 40px;
top: -127px;
height: 127px;
left: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #464646;
}
.volume-container-cast {
right: 10%;
}
#volume { #volume {
width: 10px; width: 10px;
height: 100px; height: 100px;
position: absolute; left: 0px;
right: 13%;
top: -120px;
left: auto;
} }
#volume .ui-slider-range-min { #volume .ui-slider-range-min {
@@ -2440,7 +2455,7 @@ nav ul li:hover, nav ul li.active {
} }
#volume .ui-slider-handle { #volume .ui-slider-handle {
margin-left: 20%; margin-left: 3px;
} }
.ui-widget-header { .ui-widget-header {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -502,6 +502,9 @@ initializeCastApi = function() {
Helper.log(event.castState); Helper.log(event.castState);
if(event.castState == "NOT_CONNECTED"){ if(event.castState == "NOT_CONNECTED"){
$(".castButton").css("display", "block"); $(".castButton").css("display", "block");
if(!$(".volume-container").hasClass("volume-container-cast")) {
$(".volume-container").addClass("volume-container-cast");
}
cast_ready_connect = true; cast_ready_connect = true;
if(!localStorage.getItem("_chSeen") || localStorage.getItem("_chSeen") != "seen") { if(!localStorage.getItem("_chSeen") || localStorage.getItem("_chSeen") != "seen") {
$(".castButton").css("display", "block"); $(".castButton").css("display", "block");
@@ -515,6 +518,7 @@ initializeCastApi = function() {
} }
} else if(event.castState == "NO_DEVICES_AVAILABLE"){ } else if(event.castState == "NO_DEVICES_AVAILABLE"){
cast_ready_connect = false; cast_ready_connect = false;
$(".volume-container").removeClass("volume-container-cast");
} }
}); });

View File

@@ -35,7 +35,7 @@ var Playercontrols = {
}; };
if(Helper.mobilecheck()) { if(Helper.mobilecheck()) {
slider_values.orientation = "vertical"; slider_values.orientation = "vertical";
$("#volume").toggleClass("hide"); $(".volume-container").toggleClass("hide");
} }
$("#volume").slider(slider_values); $("#volume").slider(slider_values);
Playercontrols.choose_button(vol, false); Playercontrols.choose_button(vol, false);
@@ -110,7 +110,7 @@ var Playercontrols = {
mute_video: function() { mute_video: function() {
if(Helper.mobilecheck()) { if(Helper.mobilecheck()) {
$("#volume").toggleClass("hide"); $(".volume-container").toggleClass("hide");
} else { } else {
if(!Player.player.isMuted()) { if(!Player.player.isMuted()) {
if(chromecastAvailable) castSession.sendMessage("urn:x-cast:zoff.me", {type: "mute"}); if(chromecastAvailable) castSession.sendMessage("urn:x-cast:zoff.me", {type: "mute"});

View File

@@ -204,7 +204,9 @@
<i id="v-medium" class="material-icons">volume_down</i> <i id="v-medium" class="material-icons">volume_down</i>
<i id="v-full" class="material-icons">volume_up</i> <i id="v-full" class="material-icons">volume_up</i>
</div> </div>
<div class="volume-container">
<div id="volume"></div> <div id="volume"></div>
</div>
<div id="viewers" data-position="top"></div> <div id="viewers" data-position="top"></div>
<div id="bar"></div> <div id="bar"></div>
</div> </div>