Working on settings menu

This commit is contained in:
Sam
2016-09-06 23:48:09 +10:00
parent 28335ef3d8
commit 37840c3844
9 changed files with 200 additions and 98 deletions

View File

@ -11,6 +11,16 @@
@keyframes plyr-progress {
to { background-position: @plyr-progress-loading-size 0; }
}
@keyframes plyr-popup {
from {
transform: translateY(10px);
opacity: .5;
}
to {
transform: translateY(0);
opacity: 1;
}
}
// Styles
// -------------------------------
@ -40,6 +50,11 @@
}
}
// ARIA
[aria-hidden='true'] {
display: none;
}
// Focus
&:focus {
outline: 0;
@ -268,7 +283,8 @@
// Spacing
> button,
.plyr__progress,
.plyr__time {
.plyr__time,
.plyr__menu {
margin-left: (@plyr-control-spacing / 2);
&:first-child {
@ -320,9 +336,16 @@
@media (min-width: @plyr-bp-screen-sm) {
> button,
.plyr__progress,
.plyr__time {
.plyr__time,
.plyr__menu {
margin-left: @plyr-control-spacing;
}
> button + button,
.plyr__menu + button,
> button + .plyr__menu {
margin-left: (@plyr-control-spacing / 2);
}
}
}
// Hide controls
@ -338,7 +361,7 @@
right: 0;
bottom: 0;
padding: (@plyr-control-spacing * 5) @plyr-control-spacing @plyr-control-spacing;
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 70%));
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: @plyr-video-control-color;
@ -442,6 +465,78 @@
display: inline-block;
}
// Menus
// --------------------------------------------------------------
.plyr__menu {
position: relative;
// Hide tooltip
button[aria-expanded='true'] .plyr__tooltip {
display: none;
}
// The actual menu container
&__container {
position: absolute;
bottom: 100%;
right: -5px;
margin-bottom: 10px;
animation: plyr-popup .2s ease;
background: fade(@plyr-video-controls-bg, 90%);
box-shadow: 0 1px 0 fade(#000, 20%);
border-radius: 4px;
white-space: nowrap;
text-align: left;
color: @plyr-video-control-color;
font-size: @plyr-font-size-small;
ul {
margin: 0;
padding: 5px;
list-style: none;
}
button {
display: flex;
width: 100%;
padding: 10px 30px 10px 12px;
color: @plyr-video-control-color;
font-weight: 600;
// Arrow
&::after {
content: "";
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 5px;
border: 5px solid transparent;
border-left-color: fade(@plyr-video-control-color, 80%);
}
}
// Option value
.plyr__menu__value {
margin-left: auto;
padding-left: 25px;
font-weight: 400;
color: fade(@plyr-video-control-color, 80%);
}
// Arrow
&::after {
content: "";
position: absolute;
top: 100%;
right: 15px;
height: 0;
width: 0;
border: 6px solid transparent;
border-top-color: fade(@plyr-video-controls-bg, 90%);
}
}
}
// Tooltips
// --------------------------------------------------------------
.plyr__tooltip {
@ -492,7 +587,7 @@
}
// First tooltip
.plyr__controls button:first-child .plyr__tooltip {
.plyr__controls > button:first-child .plyr__tooltip {
left: 0;
transform: translate(0, 10px) scale(.8);
transform-origin: 0 100%;
@ -503,7 +598,7 @@
}
// Last tooltip
.plyr__controls button:last-child .plyr__tooltip {
.plyr__controls > button:last-child .plyr__tooltip {
right: 0;
transform: translate(0, 10px) scale(.8);
transform-origin: 100% 100%;
@ -515,8 +610,8 @@
}
}
.plyr__controls button:first-child,
.plyr__controls button:last-child {
.plyr__controls > button:first-child,
.plyr__controls > button:last-child {
&:hover .plyr__tooltip,
&.tab-focus:focus .plyr__tooltip,
.plyr__tooltip--visible {

View File

@ -17,7 +17,7 @@
@plyr-font-size-base: 16px;
// Captions
@plyr-captions-bg: fade(#000, 70%);
@plyr-captions-bg: fade(#343f4a, 85%);
@plyr-captions-color: #fff;
@plyr-font-size-captions-base: @plyr-font-size-base;
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
@ -27,7 +27,7 @@
@plyr-control-icon-size: 18px;
@plyr-control-spacing: 10px;
@plyr-control-padding: (@plyr-control-spacing * .7);
@plyr-video-controls-bg: #000;
@plyr-video-controls-bg: #343f4a;
@plyr-video-control-color: #fff;
@plyr-video-control-color-hover: #fff;
@plyr-video-control-bg-hover: @plyr-color-main;
@ -38,7 +38,7 @@
@plyr-audio-control-bg-hover: @plyr-color-main;
// Tooltips
@plyr-tooltip-bg: fade(#000, 70%);
@plyr-tooltip-bg: fade(#343f4a, 85%);
@plyr-tooltip-color: #fff;
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
@plyr-tooltip-arrow-size: 4px;
@ -46,7 +46,7 @@
// Progress
@plyr-progress-loading-size: 25px;
@plyr-progress-loading-bg: fade(#000, 15%);
@plyr-progress-loading-bg: fade(#343f4a, 20%);
@plyr-video-progress-bg: fade(#fff, 25%);
@plyr-video-progress-buffered-bg: @plyr-video-progress-bg;
@plyr-audio-progress-bg: fade(#C6D6DB, 66%);
@ -58,7 +58,7 @@
@plyr-range-thumb-width: floor(@plyr-range-track-height * 2);
@plyr-range-thumb-bg: #fff;
@plyr-range-thumb-border: 2px solid transparent;
@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(#000, 15%);
@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(#343f4a, 20%);
@plyr-range-thumb-active-border-color: #fff;
@plyr-range-thumb-active-bg: @plyr-video-control-bg-hover;
@plyr-range-thumb-active-scale: 1.25;