Skip to content

Commit

Permalink
Sync style of volume slider with seekbar
Browse files Browse the repository at this point in the history
  • Loading branch information
terrill committed Feb 27, 2020
1 parent f5b3736 commit dbf7561
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ var AblePlayerInstances = [];
}
$('body').append($el);
bgColor = $el.css('background-color');

// bgColor is a string in the form 'rgb(R, G, B)', perhaps with a 4th item for alpha;
// split the 3 or 4 channels into an array
rgb = bgColor.replace(/[^\d,]/g, '').split(',');
Expand All @@ -644,6 +645,7 @@ var AblePlayerInstances = [];
else { // background is light
iconColor = 'black';
}

if ($elements[i] === 'controller') {
this.iconColor = iconColor;
}
Expand Down
2 changes: 2 additions & 0 deletions build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ var AblePlayerInstances = [];
}
$('body').append($el);
bgColor = $el.css('background-color');
console.log('bgColor is ' + bgColor);
// bgColor is a string in the form 'rgb(R, G, B)', perhaps with a 4th item for alpha;
// split the 3 or 4 channels into an array
rgb = bgColor.replace(/[^\d,]/g, '').split(',');
Expand All @@ -644,6 +645,7 @@ var AblePlayerInstances = [];
else { // background is light
iconColor = 'black';
}
console.log('iconColor: ' + iconColor);
if ($elements[i] === 'controller') {
this.iconColor = iconColor;
}
Expand Down
2 changes: 1 addition & 1 deletion build/ableplayer.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/ableplayer.min.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions styles/ableplayer.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@
color: #000 !important;
}
.able-black-controls .able-seekbar {
border: 2px solid #000;
border: 1px solid #000;
}
.able-white-controls,
.able-white-controls button,
.able-black-controls label {
color: #FFF !important;
}
.able-white-controls .able-seekbar {
border: 2px solid #FFF;
border: 1px solid #FFF;
}
.able-controller button {
background: none;
Expand Down Expand Up @@ -265,16 +265,20 @@
display: block;
position: relative;
height: 100%; /* = 50px after padding */
width: 5px;
width: 7px;
margin: 0 auto;
background-color: #999;
background-color: #000;
}
.able-volume-track.able-volume-track-on {
background-color: #dadada;
position: absolute;
height: 20px; /* change dynamically; 5px per volume tick */
top: 30px; /* change dynamically; 50px - height */
}
.able-volume-slider > .able-volume-track {
/* add border only to the outer track */
border: 1px solid #FFF;
}
.able-volume-head {
display: inline-block;
background-color: #fdfdfd;
Expand Down

0 comments on commit dbf7561

Please sign in to comment.