From 5a414572f9fd93371eec2f64a23dfcdd61cc8d4c Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Tue, 21 Jul 2015 08:51:14 +1000 Subject: Tooltip fix (Fixes #97) --- src/sass/plyr.scss | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 767dc501..5e8150e7 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -28,7 +28,7 @@ $control-bg-hover: @blue !default; // Tooltips $tooltip-bg: $controls-bg !default; -$tooltip-color: #fff !default; +$tooltip-color: $control-color !default; $tooltip-padding: $control-spacing !default; $tooltip-arrow-size: 5px !default; $tooltip-radius: 3px !default; @@ -329,8 +329,9 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo line-height: 1.5; font-weight: 600; - transform: translate(-50%, ($tooltip-padding * 3)); - transition: transform .2s .2s ease, opacity .2s .2s ease; + transform: translate(-50%, ($tooltip-padding * 3)) scale(0); + transform-origin: 50% 100%; + transition: transform .2s .1s ease, opacity .2s .1s ease; &::after { content: ""; @@ -353,7 +354,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo button:focus .player-tooltip { visibility: visible; opacity: 1; - transform: translate(-50%, 0); + transform: translate(-50%, 0) scale(1); } label:hover .player-tooltip, button:hover .player-tooltip { -- cgit v1.2.3 From df64fdac9eeac9515c16a21af39dbdd3163bb05c Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 25 Jul 2015 18:30:47 +1000 Subject: Tab focus and caption position fixes (fixes #61, fixes #92) --- src/sass/plyr.scss | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 5e8150e7..eeda4f4c 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -594,15 +594,6 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo .player-video-wrapper { height: 100%; width: 100%; - - .player-captions { - top: auto; - bottom: 90px; - - @media (min-width: $bp-control-split) { - bottom: 60px; - } - } } .player-controls { position: absolute; @@ -612,13 +603,29 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo } // Hide controls when playing in full screen - &.fullscreen-hide-controls.playing .player-controls { - transform: translateY(100%) translateY($control-spacing / 2); - transition: transform .3s .2s ease; - - &.hover { + &.fullscreen-hide-controls.playing { + .player-controls { + transform: translateY(100%) translateY($control-spacing / 2); + transition: transform .3s .2s ease; + } + &.player-hover .player-controls { transform: translateY(0); } + .player-captions { + bottom: (@control-spacing / 2); + transition: bottom .3s .2s ease; + } + } + + // Captions + .player-captions, + &.fullscreen-hide-controls.playing.player-hover .player-captions { + top: auto; + bottom: 90px; + + @media (min-width: $bp-control-split) { + bottom: 60px; + } } } -- cgit v1.2.3 From e9cdbfb8da156ded3b11ca1a3e5bd29104ee565a Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 25 Jul 2015 19:51:32 +1000 Subject: Safari fix (fixes #96), YouTube tweaks, docs --- src/sass/plyr.scss | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index eeda4f4c..95a444a2 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -314,6 +314,8 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo // Tooltips &-tooltip { + $border-base: darken($tooltip-bg, 8%); + visibility: hidden; position: absolute; z-index: 2; @@ -323,6 +325,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo opacity: 0; background: $tooltip-bg; + border: 1px solid $border-base; border-radius: $tooltip-radius; color: $tooltip-color; font-size: $font-size-small; @@ -333,25 +336,28 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo transform-origin: 50% 100%; transition: transform .2s .1s ease, opacity .2s .1s ease; + // Arrow &::after { content: ""; - display: block; position: absolute; + z-index: 1; + top: 100%; left: 50%; - bottom: -$tooltip-arrow-size; - margin-left: -$tooltip-arrow-size; - width: 0; - height: 0; - transition: inherit; - border-style: solid; - border-width: $tooltip-arrow-size $tooltip-arrow-size 0 $tooltip-arrow-size; - border-color: $controls-bg transparent transparent; + display: block; + width: 10px; + height: 10px; + background: $tooltip-bg; + transform: translate(-50%, -50%) rotate(45deg) translateY(2px); + + $arrow-border-color: darken($border-base, 5%); + border: 1px solid rgba(red($arrow-border-color), green($arrow-border-color), blue($arrow-border-color), .8); + border-width: 0 1px 1px 0; } } label:hover .player-tooltip, - input:focus + label .player-tooltip, + input.tab-focus:focus + label .player-tooltip, button:hover .player-tooltip, - button:focus .player-tooltip { + button.tab-focus:focus .player-tooltip { visibility: visible; opacity: 1; transform: translate(-50%, 0) scale(1); -- cgit v1.2.3 From a0d2d5cd2445b226470f724a5fa9628a52bc9c14 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 25 Jul 2015 20:29:19 +1000 Subject: Minor tweaks --- src/sass/plyr.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 95a444a2..7b7c1f93 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -495,7 +495,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo // Volume control // element // Specificity is for bootstrap compatibility - &-volume[type=range] { + &-volume[type="range"] { display: inline-block; vertical-align: middle; -webkit-appearance: none; -- cgit v1.2.3 From 5d19b438884dcb0dd203d6dccc146ca889657b3b Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 25 Jul 2015 21:35:12 +1000 Subject: Tooltip tweak --- src/sass/plyr.scss | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 7b7c1f93..b0107459 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -28,6 +28,7 @@ $control-bg-hover: @blue !default; // Tooltips $tooltip-bg: $controls-bg !default; +$tooltip-border-color: $off-white !default; $tooltip-color: $control-color !default; $tooltip-padding: $control-spacing !default; $tooltip-arrow-size: 5px !default; @@ -314,8 +315,6 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo // Tooltips &-tooltip { - $border-base: darken($tooltip-bg, 8%); - visibility: hidden; position: absolute; z-index: 2; @@ -325,7 +324,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo opacity: 0; background: $tooltip-bg; - border: 1px solid $border-base; + border: 1px solid $tooltip-border-color; border-radius: $tooltip-radius; color: $tooltip-color; font-size: $font-size-small; @@ -348,9 +347,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo height: 10px; background: $tooltip-bg; transform: translate(-50%, -50%) rotate(45deg) translateY(2px); - - $arrow-border-color: darken($border-base, 5%); - border: 1px solid rgba(red($arrow-border-color), green($arrow-border-color), blue($arrow-border-color), .8); + border: 1px solid $tooltip-border-color; border-width: 0 1px 1px 0; } } -- cgit v1.2.3 From 04cf5dfda10e1c640d21bd8338f26b3d4aa493d2 Mon Sep 17 00:00:00 2001 From: khrizpv Date: Mon, 27 Jul 2015 13:04:02 -0300 Subject: Update plyr.scss - Make it work There were some things that needed to be changed for the sass preprocessor to work. There were some variables declared as @ that need to be declared with the right syntax: $. Also sass evaluation is eager, while less evaluation is _lazy_ that means in sass, mixins should be declared before they are use. I hope you can accept this change as it's currently not working. Thanks! --- src/sass/plyr.scss | 253 +++++++++++++++++++++++++++-------------------------- 1 file changed, 128 insertions(+), 125 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index b0107459..9acac486 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -7,51 +7,69 @@ // ------------------------------- // Colors -$blue: #3498DB !default; -$gray-dark: #343F4A !default; -$gray: #565D64 !default; -$gray-light: #6B7D86 !default; -$gray-lighter: #CBD0D3 !default; -$off-white: #D6DADD !default; +$blue: #3498DB; +$gray-dark: #343F4A; +$gray: #565D64; +$gray-light: #6B7D86; +$gray-lighter: #CBD0D3; +$off-white: #D6DADD; // Font sizes -$font-size-small: 14px !default; -$font-size-base: 16px !default; -$font-size-large: ceil(($font-size-base * 1.5)) !default; +$font-size-small: 14px; +$font-size-base: 16px; +$font-size-large: ceil(($font-size-base * 1.5)); // Controls -$control-spacing: 10px !default; -$controls-bg: #fff !default; -$control-bg-hover: @blue !default; -.contrast-control-color($controls-bg); -.contrast-control-color-hover($control-bg-hover); +$control-spacing: 10px; +$controls-bg: #fff; +$control-bg-hover: $blue; + +// Contrast +@mixin contrast-control-color($color: "") { + $control-color: null !global; + @if lightness($color) >= 65% { + $control-color: $gray-light; + } @else if(lightness($color) < 65%) { + $control-color: $gray-lighter; + } +} +@mixin contrast-control-color-hover($color: "") { + $control-color-hover: null !global; + @if lightness($color) >= 65% { + $control-color-hover: $gray; + } @else if lightness($color) < 65% { + $control-color-hover: #fff; + } +} + +@include contrast-control-color($controls-bg); +@include contrast-control-color-hover($control-bg-hover); // Tooltips -$tooltip-bg: $controls-bg !default; -$tooltip-border-color: $off-white !default; -$tooltip-color: $control-color !default; -$tooltip-padding: $control-spacing !default; -$tooltip-arrow-size: 5px !default; -$tooltip-radius: 3px !default; +$tooltip-bg: $controls-bg; +$tooltip-color: $control-color; +$tooltip-padding: $control-spacing; +$tooltip-arrow-size: 5px; +$tooltip-radius: 3px; // Progress -$progress-bg: rgba(red($gray), green($gray), blue($gray), .2) !default; -$progress-playing-bg: $blue !default; -$progress-buffered-bg: rgba(red($gray), green($gray), blue($gray), .25) !default; -$progress-loading-size: 40px !default; -$progress-loading-bg: rgba(0,0,0, .15) !default; +$progress-bg: rgba(red($gray), green($gray), blue($gray), .2); +$progress-playing-bg: $blue; +$progress-buffered-bg: rgba(red($gray), green($gray), blue($gray), .25); +$progress-loading-size: 40px; +$progress-loading-bg: rgba(0,0,0, .15); // Volume -$volume-track-height: 6px !default; -$volume-track-bg: darken($controls-bg, 10%) !default; -$volume-thumb-height: ($volume-track-height * 2) !default; -$volume-thumb-width: ($volume-track-height * 2) !default; -$volume-thumb-bg: $control-color !default; -$volume-thumb-bg-focus: $control-bg-hover !default; +$volume-track-height: 6px; +$volume-track-bg: darken($controls-bg, 10%); +$volume-thumb-height: ($volume-track-height * 2); +$volume-thumb-width: ($volume-track-height * 2); +$volume-thumb-bg: $control-color; +$volume-thumb-bg-focus: $control-bg-hover; // Breakpoints -$bp-control-split: 560px !default; // When controls split into left/right -$bp-captions-large: 768px !default; // When captions jump to the larger font size +$bp-control-split: 560px; // When controls split into left/right +$bp-captions-large: 768px; // When captions jump to the larger font size // Animation // --------------------------------------- @@ -60,45 +78,24 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo to { background-position: $progress-loading-size 0; } } -// Mixins -// ------------------------------- - -// Contrast -@mixin contrast-control-color($color: "") { - @if (lightness($color) >= 65%) { - $control-color: $gray-light; - } - @else if(lightness(@color) < 65%) { - $control-color: $gray-lighter; - } -} -@mixin contrast-control-color-hover($color: "") { - @if (lightness($color) >= 65%) { - $control-color-hover: $gray; - } - @else if (lightness($color) < 65%) { - $control-color-hover: #fff; - } -} - // Font smoothing @mixin font-smoothing($mode: on) { - @if ($mode == 'on') { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - } - @else if ($mode == 'off') { - -moz-osx-font-smoothing: auto; - -webkit-font-smoothing: subpixel-antialiased; - } + @if ($mode == 'on') { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + } + @else if ($mode == 'off') { + -moz-osx-font-smoothing: auto; + -webkit-font-smoothing: subpixel-antialiased; + } } // Contain floats: nicolasgallagher.com/micro-clearfix-hack/ @mixin clearfix() { zoom: 1; - &:before, + &:before, &:after { content: ""; display: table; } &:after { clear: both; } } @@ -109,7 +106,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo outline-offset: 0; } -// Range mixins +// styling @mixin volume-thumb() { height: $volume-thumb-height; @@ -154,7 +151,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo // Styles // ------------------------------- -// Base +// Base .player { position: relative; max-width: 100%; @@ -165,8 +162,8 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo &, *, *::after, - *::before { - box-sizing: border-box; + *::before { + box-sizing: border-box; } // For video @@ -180,6 +177,21 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo vertical-align: middle; } + // For embeds + &-video-embed { + padding-bottom: 56.25%; /* 16:9 */ + height: 0; + + iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; + } + } + // Captions &-captions { display: none; @@ -192,10 +204,10 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo color: #fff; font-size: $font-size-base; font-weight: 600; - text-shadow: - -1px -1px 0 $gray, - 1px -1px 0 $gray, - -1px 1px 0 $gray, + text-shadow: + -1px -1px 0 $gray, + 1px -1px 0 $gray, + -1px 1px 0 $gray, 1px 1px 0 $gray; text-align: center; @include font-smoothing(); @@ -233,15 +245,15 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo margin-top: 0; } } - - input + label, + + input + label, button { display: inline-block; vertical-align: middle; margin: 0 2px; padding: ($control-spacing / 2) $control-spacing; - - background .3s ease, color .3s ease, opacity .3s ease; + + transition: background .3s ease, color .3s ease, opacity .3s ease; border-radius: 3px; cursor: pointer; @@ -257,7 +269,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo .inverted:checked + label { opacity: .5; } - button, + button, .inverted + label, input:checked + label { color: $control-color; @@ -268,7 +280,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo background: transparent; overflow: hidden; } - + // Specificity for overriding .inverted button:focus, button:hover, @@ -324,7 +336,6 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo opacity: 0; background: $tooltip-bg; - border: 1px solid $tooltip-border-color; border-radius: $tooltip-radius; color: $tooltip-color; font-size: $font-size-small; @@ -335,26 +346,25 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo transform-origin: 50% 100%; transition: transform .2s .1s ease, opacity .2s .1s ease; - // Arrow &::after { content: ""; + display: block; position: absolute; - z-index: 1; - top: 100%; left: 50%; - display: block; - width: 10px; - height: 10px; - background: $tooltip-bg; - transform: translate(-50%, -50%) rotate(45deg) translateY(2px); - border: 1px solid $tooltip-border-color; - border-width: 0 1px 1px 0; + bottom: -$tooltip-arrow-size; + margin-left: -$tooltip-arrow-size; + width: 0; + height: 0; + transition: inherit; + border-style: solid; + border-width: $tooltip-arrow-size $tooltip-arrow-size 0 $tooltip-arrow-size; + border-color: $controls-bg transparent transparent; } } label:hover .player-tooltip, - input.tab-focus:focus + label .player-tooltip, + input:focus + label .player-tooltip, button:hover .player-tooltip, - button.tab-focus:focus .player-tooltip { + button:focus .player-tooltip { visibility: visible; opacity: 1; transform: translate(-50%, 0) scale(1); @@ -393,7 +403,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo background: transparent; } &-buffer[value], - &-played[value] { + &-played[value] { &::-webkit-progress-bar { background: transparent; } @@ -439,7 +449,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo -moz-appearance: none; @include seek-thumb(); } - + // Microsoft &::-ms-track { color: transparent; @@ -469,15 +479,15 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo background-repeat: repeat-x; background-color: $progress-buffered-bg; background-image: linear-gradient( - -45deg, - $progress-loading-bg 25%, - transparent 25%, - transparent 50%, - $progress-loading-bg 50%, + -45deg, + $progress-loading-bg 25%, + transparent 25%, + transparent 50%, + $progress-loading-bg 50%, $progress-loading-bg 75%, - transparent 75%, + transparent 75%, transparent); - color: transparent; + color: transparent; } // States @@ -492,18 +502,18 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo // Volume control // element // Specificity is for bootstrap compatibility - &-volume[type="range"] { + &-volume[type=range] { display: inline-block; vertical-align: middle; -webkit-appearance: none; -moz-appearance: none; width: 100px; margin: 0 $control-spacing 0 0; - padding: 0; + padding: 0; cursor: pointer; background: transparent; border: none; - + // Webkit &::-webkit-slider-runnable-track { @include volume-track(); @@ -521,7 +531,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo &::-moz-range-thumb { @include volume-thumb(); } - + // Microsoft &::-ms-track { height: $volume-track-height; @@ -597,6 +607,15 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo .player-video-wrapper { height: 100%; width: 100%; + + .player-captions { + top: auto; + bottom: 90px; + + @media (min-width: $bp-control-split) { + bottom: 60px; + } + } } .player-controls { position: absolute; @@ -606,28 +625,12 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo } // Hide controls when playing in full screen - &.fullscreen-hide-controls.playing { - .player-controls { - transform: translateY(100%) translateY($control-spacing / 2); - transition: transform .3s .2s ease; - } - &.player-hover .player-controls { - transform: translateY(0); - } - .player-captions { - bottom: (@control-spacing / 2); - transition: bottom .3s .2s ease; - } - } - - // Captions - .player-captions, - &.fullscreen-hide-controls.playing.player-hover .player-captions { - top: auto; - bottom: 90px; + &.fullscreen-hide-controls.playing .player-controls { + transform: translateY(100%) translateY($control-spacing / 2); + transition: transform .3s .2s ease; - @media (min-width: $bp-control-split) { - bottom: 60px; + &.hover { + transform: translateY(0); } } } @@ -656,4 +659,4 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo &.fullscreen-enabled [data-player='fullscreen'] + label { display: inline-block; } -} \ No newline at end of file +} -- cgit v1.2.3 From 00cf797c200857b4726c8562c416769ccfaf2bb9 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Tue, 28 Jul 2015 11:29:49 +1000 Subject: Restored !default and fullscreen logic in SASS --- src/sass/plyr.scss | 95 +++++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 44 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 9acac486..f0f1c3b3 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -7,22 +7,22 @@ // ------------------------------- // Colors -$blue: #3498DB; -$gray-dark: #343F4A; -$gray: #565D64; -$gray-light: #6B7D86; -$gray-lighter: #CBD0D3; -$off-white: #D6DADD; +$blue: #3498DB !default; +$gray-dark: #343F4A !default; +$gray: #565D64 !default; +$gray-light: #6B7D86 !default; +$gray-lighter: #CBD0D3 !default; +$off-white: #D6DADD !default; // Font sizes -$font-size-small: 14px; -$font-size-base: 16px; -$font-size-large: ceil(($font-size-base * 1.5)); +$font-size-small: 14px !default; +$font-size-base: 16px !default; +$font-size-large: ceil(($font-size-base * 1.5)) !default; // Controls -$control-spacing: 10px; -$controls-bg: #fff; -$control-bg-hover: $blue; +$control-spacing: 10px !default; +$controls-bg: #fff !default; +$control-bg-hover: $blue !default; !default // Contrast @mixin contrast-control-color($color: "") { @@ -46,30 +46,30 @@ $control-bg-hover: $blue; @include contrast-control-color-hover($control-bg-hover); // Tooltips -$tooltip-bg: $controls-bg; -$tooltip-color: $control-color; -$tooltip-padding: $control-spacing; -$tooltip-arrow-size: 5px; -$tooltip-radius: 3px; +$tooltip-bg: $controls-bg !default; +$tooltip-color: $control-color !default; +$tooltip-padding: $control-spacing !default; +$tooltip-arrow-size: 5px !default; +$tooltip-radius: 3px !default; // Progress -$progress-bg: rgba(red($gray), green($gray), blue($gray), .2); -$progress-playing-bg: $blue; -$progress-buffered-bg: rgba(red($gray), green($gray), blue($gray), .25); -$progress-loading-size: 40px; -$progress-loading-bg: rgba(0,0,0, .15); +$progress-bg: rgba(red($gray), green($gray), blue($gray), .2) !default; +$progress-playing-bg: $blue !default; +$progress-buffered-bg: rgba(red($gray), green($gray), blue($gray), .25) !default; +$progress-loading-size: 40px !default +$progress-loading-bg: rgba(0,0,0, .15) !default; // Volume -$volume-track-height: 6px; -$volume-track-bg: darken($controls-bg, 10%); -$volume-thumb-height: ($volume-track-height * 2); -$volume-thumb-width: ($volume-track-height * 2); -$volume-thumb-bg: $control-color; -$volume-thumb-bg-focus: $control-bg-hover; +$volume-track-height: 6px !default; +$volume-track-bg: darken($controls-bg, 10%) !default; +$volume-thumb-height: ($volume-track-height * 2) !default; +$volume-thumb-width: ($volume-track-height * 2) !default; +$volume-thumb-bg: $control-color !default; +$volume-thumb-bg-focus: $control-bg-hover !default; // Breakpoints -$bp-control-split: 560px; // When controls split into left/right -$bp-captions-large: 768px; // When captions jump to the larger font size +$bp-control-split: 560px !default; // When controls split into left/right +$bp-captions-large: 768px !default; // When captions jump to the larger font size // Animation // --------------------------------------- @@ -607,15 +607,6 @@ $bp-captions-large: 768px; // When captions jump to the larger font size .player-video-wrapper { height: 100%; width: 100%; - - .player-captions { - top: auto; - bottom: 90px; - - @media (min-width: $bp-control-split) { - bottom: 60px; - } - } } .player-controls { position: absolute; @@ -625,13 +616,29 @@ $bp-captions-large: 768px; // When captions jump to the larger font size } // Hide controls when playing in full screen - &.fullscreen-hide-controls.playing .player-controls { - transform: translateY(100%) translateY($control-spacing / 2); - transition: transform .3s .2s ease; - - &.hover { + &.fullscreen-hide-controls.playing { + .player-controls { + transform: translateY(100%) translateY($control-spacing / 2); + transition: transform .3s .2s ease; + } + &.player-hover .player-controls { transform: translateY(0); } + .player-captions { + bottom: ($control-spacing / 2); + transition: bottom .3s .2s ease; + } + } + + // Captions + .player-captions, + &.fullscreen-hide-controls.playing.player-hover .player-captions { + top: auto; + bottom: 90px; + + @media (min-width: $bp-control-split) { + bottom: 60px; + } } } -- cgit v1.2.3 From aad4a720dcb0755371c2c8062ae9e8286ba9f467 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 31 Jul 2015 21:32:12 +1000 Subject: Tooltip fix for NVDA --- src/sass/plyr.scss | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index b0107459..9167fb1a 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -315,7 +315,6 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo // Tooltips &-tooltip { - visibility: hidden; position: absolute; z-index: 2; bottom: 100%; @@ -355,7 +354,6 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fo input.tab-focus:focus + label .player-tooltip, button:hover .player-tooltip, button.tab-focus:focus .player-tooltip { - visibility: visible; opacity: 1; transform: translate(-50%, 0) scale(1); } -- cgit v1.2.3 From 9534db823d6231254d5560d97ad3fc0341e24aae Mon Sep 17 00:00:00 2001 From: khrizpv Date: Fri, 31 Jul 2015 10:59:03 -0300 Subject: Update plyr.scss - Make it work V2! Hi, thanks for accepting my previous pull request. I made this request because the variables control-color and control-color-hover weren't being set inside the mixin so i took them out and it's working now again. I hope you can merge this as it isnt completly working yet and sorry for the delay. Thanks again! :) --- src/sass/plyr.scss | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index bff8cd2e..48acfbd7 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -23,28 +23,21 @@ $font-size-large: ceil(($font-size-base * 1.5)) !default; $control-spacing: 10px !default; $controls-bg: #fff !default; $control-bg-hover: $blue !default; !default +$control-color: null !default; +$control-color-hover: null !default; // Contrast -@mixin contrast-control-color($color: "") { - $control-color: null !global; - @if lightness($color) >= 65% { - $control-color: $gray-light; - } @else if(lightness($color) < 65%) { - $control-color: $gray-lighter; - } +@if lightness($controls-bg) >= 65% { + $control-color: $gray-light; +} @else { + $control-color: $gray-lighter; } -@mixin contrast-control-color-hover($color: "") { - $control-color-hover: null !global; - @if lightness($color) >= 65% { - $control-color-hover: $gray; - } @else if lightness($color) < 65% { - $control-color-hover: #fff; - } +@if lightness($control-bg-hover) >= 65% { + $control-color-hover: $gray; +} @else { + $control-color-hover: #fff; } -@include contrast-control-color($controls-bg); -@include contrast-control-color-hover($control-bg-hover); - // Tooltips $tooltip-bg: $controls-bg !default; $tooltip-color: $control-color !default; -- cgit v1.2.3 From 75c090e8b9c0e58a73005d315e326e5ac1902860 Mon Sep 17 00:00:00 2001 From: khrizpv Date: Thu, 6 Aug 2015 14:21:36 -0300 Subject: Update plyr.scss - Make it work V3! --- src/sass/plyr.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 48acfbd7..a4dab010 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -22,7 +22,7 @@ $font-size-large: ceil(($font-size-base * 1.5)) !default; // Controls $control-spacing: 10px !default; $controls-bg: #fff !default; -$control-bg-hover: $blue !default; !default +$control-bg-hover: $blue !default; $control-color: null !default; $control-color-hover: null !default; @@ -49,7 +49,7 @@ $tooltip-radius: 3px !default; $progress-bg: rgba(red($gray), green($gray), blue($gray), .2) !default; $progress-playing-bg: $blue !default; $progress-buffered-bg: rgba(red($gray), green($gray), blue($gray), .25) !default; -$progress-loading-size: 40px !default +$progress-loading-size: 40px !default; $progress-loading-bg: rgba(0,0,0, .15) !default; // Volume -- cgit v1.2.3 From 38a206892b4869782cd0391307c7610cfe580286 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 8 Aug 2015 14:37:12 +1000 Subject: YouTube, Captions and Control improvements - Controls improvements (Fixes #103) - YouTube bug fixes (Fixes #105) - Internationalization support (Fixes #101) - Captions legibility improvements --- src/sass/plyr.scss | 110 ++++++++++++++++++++++++----------------------------- 1 file changed, 50 insertions(+), 60 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index a4dab010..8009b0d7 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -17,7 +17,11 @@ $off-white: #D6DADD !default; // Font sizes $font-size-small: 14px !default; $font-size-base: 16px !default; -$font-size-large: ceil(($font-size-base * 1.5)) !default; + +// Captions +$font-size-captions-base: ceil(@font-size-base * 1.25) !default; +$font-size-captions-medium: ceil(@font-size-base * 1.5) !default; +$font-size-captions-large: (@font-size-base * 2) !default; // Controls $control-spacing: 10px !default; @@ -89,7 +93,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger { zoom: 1; &:before, - &:after { content: ""; display: table; } + &:after { content: ''; display: table; } &:after { clear: both; } } // Tab focus styles @@ -192,26 +196,31 @@ $bp-captions-large: 768px !default; // When captions jump to the larger bottom: 0; left: 0; width: 100%; - padding: 20px; - min-height: 2.5em; + padding: ($control-spacing * 2) ($control-spacing * 2) ($control-spacing * 3); color: #fff; - font-size: $font-size-base; - font-weight: 600; - text-shadow: - -1px -1px 0 $gray, - 1px -1px 0 $gray, - -1px 1px 0 $gray, - 1px 1px 0 $gray; + font-size: $font-size-captions-base; text-align: center; @include font-smoothing(); - @media (min-width: $bp-captions-large) { - font-size: $font-size-large; + span { + border-radius: 2px; + padding: 3px 10px; + background: rgba(0,0,0, .9); + } + span:empty { + display: none; + } + + @media (min-width: @bp-captions-large) { + font-size: $font-size-captions-medium; } } &.captions-active &-captions { display: block; } + &.fullscreen-active &-captions { + font-size: $font-size-captions-large; + } // Player controls &-controls { @@ -239,17 +248,20 @@ $bp-captions-large: 768px !default; // When captions jump to the larger } } - input + label, + // Buttons button { display: inline-block; vertical-align: middle; margin: 0 2px; padding: ($control-spacing / 2) $control-spacing; - - transition: background .3s ease, color .3s ease, opacity .3s ease; + overflow: hidden; + border: 0; + background: transparent; border-radius: 3px; cursor: pointer; - + color: $control-color; + transition: background .3s ease, color .3s ease, opacity .3s ease; + svg { width: 18px; height: 18px; @@ -257,41 +269,27 @@ $bp-captions-large: 768px !default; // When captions jump to the larger fill: currentColor; transition: fill .3s ease; } - } - input + label, - .inverted:checked + label { - opacity: .5; - } - button, - .inverted + label, - input:checked + label { - color: $control-color; - opacity: 1; - } - button { - border: 0; - background: transparent; - overflow: hidden; - } - // Specificity for overriding .inverted - button:focus, - button:hover, - [type="checkbox"]:focus + label, - [type="checkbox"] + label:hover { - background: $control-bg-hover; - color: $control-color-hover; - opacity: 1; - } - button:focus, - input:focus + label { - outline: 0; + // Hover and tab focus + &.tab-focus, + &:hover { + background: $control-bg-hover; + color: $control-color-hover; + } + // Default focus + &:focus { + outline: 0; + } } + + // Hide toggle icons by default .icon-exit-fullscreen, .icon-muted, .icon-captions-on { display: none; } + + // Time display .player-time { display: inline-block; vertical-align: middle; @@ -312,7 +310,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Add a slash in before &::before { - content: "\2044"; + content: '\2044'; margin-right: $control-spacing; } } @@ -339,7 +337,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger transition: transform .2s .1s ease, opacity .2s .1s ease; &::after { - content: ""; + content: ''; display: block; position: absolute; left: 50%; @@ -353,14 +351,11 @@ $bp-captions-large: 768px !default; // When captions jump to the larger border-color: $controls-bg transparent transparent; } } - label:hover .player-tooltip, - input:focus + label .player-tooltip, button:hover .player-tooltip, button:focus .player-tooltip { opacity: 1; transform: translate(-50%, 0) scale(1); } - label:hover .player-tooltip, button:hover .player-tooltip { z-index: 3; } @@ -378,7 +373,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger &-buffer[value], &-played[value], - &-seek[type=range] { + &-seek[type='range'] { position: absolute; left: 0; top: 0; @@ -418,7 +413,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Seek control // element // Specificity is for bootstrap compatibility - &-seek[type=range] { + &-seek[type='range'] { z-index: 4; cursor: pointer; outline: 0; @@ -493,7 +488,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Volume control // element // Specificity is for bootstrap compatibility - &-volume[type=range] { + &-volume[type='range'] { display: inline-block; vertical-align: middle; -webkit-appearance: none; @@ -559,7 +554,6 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html &.ios &-volume, &.ios [data-player='mute'], - &.ios [data-player='mute'] + label, &-audio.ios &-controls-right { display: none; } @@ -646,15 +640,11 @@ $bp-captions-large: 768px !default; // When captions jump to the larger // Some options are hidden by default [data-player='captions'], - [data-player='captions'] + label, - [data-player='fullscreen'], - [data-player='fullscreen'] + label { + [data-player='fullscreen'] { display: none; } &.captions-enabled [data-player='captions'], - &.captions-enabled [data-player='captions'] + label, - &.fullscreen-enabled [data-player='fullscreen'], - &.fullscreen-enabled [data-player='fullscreen'] + label { + &.fullscreen-enabled [data-player='fullscreen'] { display: inline-block; } } -- cgit v1.2.3 From 66f724a3be195d96f2add76394fb81a33e8fca93 Mon Sep 17 00:00:00 2001 From: khrizpv Date: Mon, 10 Aug 2015 10:03:21 -0300 Subject: Update plyr.scss - Fix new scss! This is a fix the newly added scss. --- src/sass/plyr.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sass/plyr.scss') diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 8009b0d7..de386cd8 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -19,9 +19,9 @@ $font-size-small: 14px !default; $font-size-base: 16px !default; // Captions -$font-size-captions-base: ceil(@font-size-base * 1.25) !default; -$font-size-captions-medium: ceil(@font-size-base * 1.5) !default; -$font-size-captions-large: (@font-size-base * 2) !default; +$font-size-captions-base: ceil($font-size-base * 1.25) !default; +$font-size-captions-medium: ceil($font-size-base * 1.5) !default; +$font-size-captions-large: ($font-size-base * 2) !default; // Controls $control-spacing: 10px !default; @@ -211,7 +211,7 @@ $bp-captions-large: 768px !default; // When captions jump to the larger display: none; } - @media (min-width: @bp-captions-large) { + @media (min-width: $bp-captions-large) { font-size: $font-size-captions-medium; } } -- cgit v1.2.3