diff options
author | Sam Potts <me@sampotts.me> | 2015-02-14 22:42:44 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2015-02-14 22:42:44 +1100 |
commit | 751d8db9d88d45b33792982103f8682e21ac876e (patch) | |
tree | 922222dd411b34a5d47d2e1453a167919dbdb417 /assets/less | |
download | plyr-751d8db9d88d45b33792982103f8682e21ac876e.tar.lz plyr-751d8db9d88d45b33792982103f8682e21ac876e.tar.xz plyr-751d8db9d88d45b33792982103f8682e21ac876e.zip |
WIP
Diffstat (limited to 'assets/less')
-rw-r--r-- | assets/less/docs.less | 37 | ||||
-rw-r--r-- | assets/less/lib/mixins.less | 27 | ||||
-rw-r--r-- | assets/less/lib/normalize.less | 406 | ||||
-rw-r--r-- | assets/less/simple-player.less | 552 |
4 files changed, 1022 insertions, 0 deletions
diff --git a/assets/less/docs.less b/assets/less/docs.less new file mode 100644 index 00000000..05b19a48 --- /dev/null +++ b/assets/less/docs.less @@ -0,0 +1,37 @@ +// ========================================================================== +// HTML5 Video Player Demo Page +// ========================================================================== + +// Reset +@import "lib/normalize.less"; +// Mixins +@import "lib/mixins.less"; + +// BORDER-BOX ALL THE THINGS! +// http://paulirish.com/2012/box-sizing-border-box-ftw/ +*, *::after, *::before { + box-sizing: border-box; +} +html { + font-size: 62.5%; +} +body { + font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif; + .font-size(18); + color: #6D797F; + line-height: 1.5; + background: #ECF0F1; + max-width: 960px; + margin: 50px auto; + text-align: center; +} +h1 { + .font-size(48); + letter-spacing: -.025em; + color: #2E3C44; + margin: 0 0 20px; + line-height: 1.2; +} +p { + margin: 0 0 20px; +}
\ No newline at end of file diff --git a/assets/less/lib/mixins.less b/assets/less/lib/mixins.less new file mode 100644 index 00000000..c6412a55 --- /dev/null +++ b/assets/less/lib/mixins.less @@ -0,0 +1,27 @@ +// ========================================================================== +// Mixins +// ========================================================================== + +// Contain floats: nicolasgallagher.com/micro-clearfix-hack/ +.clearfix() { + zoom: 1; + &:before, + &:after { content: ""; display: table; } + &:after { clear: both; } +} + +// Webkit-style focus +.tab-focus() { + // Default + outline: thin dotted @gray-dark; + // Webkit + //outline: 5px auto -webkit-focus-ring-color; + outline-offset: 1px; +} + +// Use rems for font sizing +.font-size(@font-size: 16){ + @rem: (@font-size / 10); + font-size: @font-size * 1px; + font-size: ~"@{rem}rem"; +}
\ No newline at end of file diff --git a/assets/less/lib/normalize.less b/assets/less/lib/normalize.less new file mode 100644 index 00000000..562891ab --- /dev/null +++ b/assets/less/lib/normalize.less @@ -0,0 +1,406 @@ +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ + +/* ========================================================================== + HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined in IE 8/9. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +/** + * Correct `inline-block` display not defined in IE 8/9. + */ + +audio, +canvas, +video { + display: inline-block; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9. + * Hide the `template` element in IE, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* ========================================================================== + Base + ========================================================================== */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background: transparent; +} + +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari 5, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Correct font family set oddly in Safari 5 and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +/** + * Improve readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre-wrap; +} + +/** + * Set consistent quote types. + */ + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9. + */ + +img { + border: 0; +} + +/** + * Correct overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari 5. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Correct font family not being inherited in all browsers. + * 2. Correct font size not being inherited in all browsers. + * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. + */ + +button, +input, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 8/9. + * 2. Improve readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +}
\ No newline at end of file diff --git a/assets/less/simple-player.less b/assets/less/simple-player.less new file mode 100644 index 00000000..a935e09e --- /dev/null +++ b/assets/less/simple-player.less @@ -0,0 +1,552 @@ +// ========================================================================== +// HTML5 Media Player +// ========================================================================== + +// Variables +// ------------------------------- +@base-color: #2E3C44; +@green: #1ABC9C; +@red: #D44334; +//@green: #4CB953; +@blue: #3498DB; +@control-color: @blue; + + +// BORDER-BOX ALL THE THINGS! (http://paulirish.com/2012/box-sizing-border-box-ftw/) +// ------------------------------- +.player, +.player *, +.player *::after, +.player *::before { + box-sizing: border-box; +} + +// Utility classes & mixins +// ------------------------------- +.sr-only { + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + padding: 0 !important; + border: 0 !important; + height: 1px !important; + width: 1px !important; + overflow: hidden; +} +.hide { + display: none; +} +.show-inline { + display: inline-block; +} +// Contain floats: nicolasgallagher.com/micro-clearfix-hack/ +.clearfix() { + zoom: 1; + &:before, + &:after { content: ""; display: table; } + &:after { clear: both; } +} + +// Base +.player { + position: relative; + max-width: 100%; + overflow: hidden; // For the controls + + video { + width: 100%; + height: auto; + vertical-align: middle; + } + svg { + width: 18px; + height: 18px; + } + .controls { + .clearfix(); + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 10px 5px; + background: rgba(0,0,0, .75); + transition: transform .3s ease; + line-height: 1; + + button { + border: 0; + background: transparent; + overflow: hidden; + } + label, + button { + display: inline-block; + vertical-align: middle; + margin: 0 2px; + padding: 5px 10px; + color: #ddd; + transition: background .3s ease; + border-radius: 3px; + + svg { + display: block; + fill: currentColor; + transition: fill .3s ease; + } + &:focus { + background: #000; + outline: 0; + } + &:hover { + background: @control-color; + } + &:hover svg, + &:focus svg { + fill: #fff; + } + } + .px-video-time { + display: inline-block; + vertical-align: middle; + padding-top: 3px; + margin-left: 10px; + color: #fff; + font-weight: 600; + font-size: 14px; + -webkit-font-smoothing: antialiased; + } + } + progress { + position: absolute; + top: -10px; + left: 0; + right: 0; + width: 100%; + height: 10px; + margin: 0; + vertical-align: top; + + &[value] { + /* Reset the default appearance */ + -webkit-appearance: none; + border: none; + + &::-webkit-progress-bar { + background-color: #eee; + } + &::-webkit-progress-value { + background-color: @control-color; + } + } + } + .play-controls { + float: left; + } + .sound-controls { + float: right; + } + /*&.playing .controls { + transform: translateY(100%); + }*/ +} + + +/* containers */ +.px-video-img-captions-container * { + box-sizing: border-box; +} + +.px-video-img-captions-container { + position: relative; +} + +/* progress indicator */ +.px-video-progress { + + +} + +/* time */ +/*.px-video-time { + float: right; + margin-top: 2px; + font-size: 14px; +}*/ + +/* caption area */ +.px-video-captions { + position: absolute; + top: 0; + left: 0; + width: 100%; + padding: .5em; + min-height: 2.5em; + background-color: #000; + color: #fff; + font-size: 1.1em; + text-align: center; + opacity: 0.75; + + -webkit-font-smoothing: antialiased; + font-weight: 500; +} + +/* buttons */ +.px-video-controls button { + + //background: no-repeat url('../images/px-video-sprite.png'); +} +.px-video-controls button:focus { + //border: 1px #999 dotted; + //outline: none; +} +.px-video-controls button { + //cursor: pointer; +} + +/* captions button */ +.px-video-captions-btn-container label { + display: inline-block; + width: 25px; + height: 20px; + margin-left: 25px; + background: no-repeat url('../images/px-video-sprite.png'); + background-position: -6px -835px; +} +.px-video-captions-btn-container input[type="checkbox"]:focus+label { + outline: 1px #999 dotted; + background-position: -6px -799px; +} +.px-video-captions-btn-container input[type="checkbox"]:hover+label { + background-position: -6px -799px; + cursor: pointer; +} +.px-video-captions-btn-container input[type="checkbox"]:focus+label { + outline: 1px #999 dotted; + background-position: -6px -799px; +} +.px-video-captions-btn-container input[type="checkbox"]:checked+label { + background-position: -6px -871px; +} + +/* mute button */ +.px-video-mute-btn-container label { + display: inline-block; + width: 25px; + height: 20px; + margin-left: 240px; + margin-top: 2px; + background: no-repeat url('../images/px-video-sprite.png'); + background-position: -6px -476px; +} +.px-video-mute-btn-container input[type="checkbox"]:focus+label { + outline: 1px #999 dotted; + background-position: -6px -440px; +} +.px-video-mute-btn-container input[type="checkbox"]:hover+label { + background-position: -6px -440px; + cursor: pointer; +} +.px-video-mute-btn-container input[type="checkbox"]:focus+label { + outline: 1px #999 dotted; + background-position: -6px -440px; +} +/* checked state of mute button */ +.px-video-mute-btn-container input[type="checkbox"]:checked+label { + background-position: -6px -692px; +} +.px-video-mute-btn-container input[type="checkbox"]:checked:hover+label, +.px-video-mute-btn-container input[type="checkbox"]:checked:focus+label { + background-position: -6px -656px; +} + +/* volume range input */ +.px-video-controls input[type='range'] { + -webkit-appearance: none; + height: 6px; + width: 100px; + margin-top: 8px; + background-color: #E6E6E6; + outline:none; +} +.px-video-controls input[type='range']:focus::-webkit-slider-thumb { + outline: 1px #999 dotted; +} +.px-video-controls input[type='range']::-moz-range-track { + -moz-appearance: none; + height: 6px; + background-color: #E6E6E6; + border: none; +} +.px-video-controls input[type='range']::-webkit-slider-thumb { + -webkit-appearance: none !important; + height: 10px; + width: 6px; + background-color: #666; +} +.px-video-controls input[type='range']::-moz-range-thumb { + height: 12px; + width: 8px; +} +/* fixing display for IE10+ */ +@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { + .px-video-controls input[type='range'] { + position: relative; + padding: 0; + height: 8px; + top: -3px; + } + .px-video-time { + margin-top: 4px; + } + .px-video-captions { + padding: 8px; + min-height: 36px; + } +} + +/*.media { + position: relative; + overflow: hidden; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + + video { + width: 100%; + + &::-webkit-media-controls { + display:none !important; + } + } + &.stopped, + &.paused { + .overlay-play { + display: block; + } + .media-controls { + transform: translate3d(0, 0, 0); + } + } +} +.media-controls { + height: 50px; + position: absolute; + bottom: 0; + left: 0; + right: 0; + z-index: 2; + + .translate3d(0, 100%, 0); + .transition-transform(.5s); + + background-color: @base-color; + color: #fff; + .font-size(15); + -webkit-font-smoothing: antialiased; + font-weight: 600; + .user-select(none); + + button { + display: inline-block; + padding: 8px 15px; + margin: 0; + + -webkit-appearance: none; + background: none; + border: none; + color: #fff; + .font-size(24); + + .transition(); + + &:focus { + outline: none; + } + + &:hover, + &:focus { + text-shadow: 0 0 15px @green; + } + } + + .progress { + position: relative; + .border-radius(10px); + height: 10px; + background: lighten(@base-color, 10%); + + div { + position: absolute; + z-index: 1; + left: 0; + .border-radius(10px); + height: 10px; + min-width: 10px; // So it doesn't look strange at 0% + + &.progress-played, + &.progress-volume { + background: @green; + z-index: 2; + } + &.progress-buffered { + background: lighten(@base-color, 20%); + } + } + &.vertical-progress { + margin: 0 auto; + width: 10px; + height: auto; + min-height: 100px; + + div { + bottom: 0; + width: 10px; + height: auto; + min-height: 10px; + } + } + } + + .popover { + display: none; + position: absolute; + left: 50%; + bottom: 100%; + margin-bottom: 10px; + + background: @base-color; + .border-radius(4px); + + -webkit-animation: pop-upwards 160ms forwards linear; + -moz-animation: pop-upwards 160ms forwards linear; + -ms-animation: pop-upwards 160ms forwards linear; + -o-animation: pop-upwards 160ms forwards linear; + animation: pop-upwards 160ms forwards linear; + + .transition(); + + // Psuedo bits + &::before { + position: absolute; + bottom: -7px; + left: 50%; + margin-left: -7px; + width: 0; + height: 0; + border-right: 7px solid transparent; + border-top: 7px solid @base-color; + border-left: 7px solid transparent; + content: ''; + z-index: 1; + } + } + .has-popover:focus, + .has-popover:hover { + .popover { + display: block; + } + } + + .popover-volume { + width: 54px; + padding: 15px 5px 8px; + margin-left: -27px; + + text-align: center; + + .progress { + height: 120px; + margin-bottom: 5px; + } + } + + // Layout + .play, + .progress-play, + .volume, + .time, + .fullscreen { + position: absolute; + top: 0; + } + .play { + left: 10px; + } + .progress-play { + left: 70px; + right: 240px; + margin-top: 20px; + } + .time { + right: 120px; + width: 100px; + text-align: center; + line-height: 1; + padding-top: 17px; + } + .volume { + right: 60px; + } + .fullscreen { + right: 10px; + } + + @media only screen + and (max-width: 480px) { + .time-seperator, + .time-total { + display: none; + } + .time { + width: 50px; + right: 70px; + } + .fullscreen { + display: none; + } + .volume { + right: 10px; + } + .progress-play { + right: 140px; + } + } + @media only screen + and (max-width: 320px) { + .time { + display: none; + } + .progress-play { + right: 70px; + } + } +} +.media-pause .mejs-overlay-play { + background: rgba(0,0,0, .1); +} +.overlay { + display: none; + position: absolute; + z-index: 1; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: rgba(0,0,0, .1); +} +.overlay-play > span { + display: block; + position: absolute; + top: 50%; + left: 50%; + width: 60px; + height: 60px; + line-height: 1.5; + margin: -34px 0 0 -34px !important; + text-align: center; + background: rgba(red(@base-color), green(@base-color), blue(@base-color), .8); + border: 4px solid #fff; + color: #fff; + .border-radius(50%); + @shadow: 0 1px 5px rgba(0,0,0, .25), inset 0 1px 1px rgba(0,0,0,.25); + .box-shadow(@shadow); + .font-size(34); +}*/
\ No newline at end of file |