mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update progress bar
This commit is contained in:
parent
7f5cde6e16
commit
47446f28e6
4 changed files with 4 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
define(["browser","dom","layoutManager","css!./emby-slider","registerElement","emby-input"],function(browser,dom,layoutManager){"use strict";function updateValues(range,backgroundLower){var value=range.value;requestAnimationFrame(function(){if(backgroundLower){var fraction=(value-range.min)/(range.max-range.min);enableWidthWithTransform?backgroundLower.style.transform="scaleX("+fraction+")":(fraction*=100,backgroundLower.style.width=fraction+"%")}})}function updateBubble(range,value,bubble,bubbleText){requestAnimationFrame(function(){bubble.style.left=value+"%",range.getBubbleHtml?value=range.getBubbleHtml(value):(value=range.getBubbleText?range.getBubbleText(value):Math.round(value),value='<h1 class="sliderBubbleText">'+value+"</h1>"),bubble.innerHTML=value})}function setRange(elem,startPercent,endPercent){var style=elem.style;style.left=Math.max(startPercent,0)+"%";var widthPercent=endPercent-startPercent;style.width=Math.max(Math.min(widthPercent,100),0)+"%"}function mapRangesFromRuntimeToPercent(ranges,runtime){return runtime?ranges.map(function(r){return{start:r.start/runtime*100,end:r.end/runtime*100}}):[]}function startInterval(range,backgroundLower){var interval=range.interval;interval&&clearInterval(interval),range.interval=setInterval(function(){updateValues(range,backgroundLower)},100)}var enableWidthWithTransform,EmbySliderPrototype=Object.create(HTMLInputElement.prototype),supportsNativeProgressStyle=browser.firefox,supportsValueSetOverride=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");descriptor&&descriptor.configurable&&(supportsValueSetOverride=!0)}EmbySliderPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embyslider")){null==enableWidthWithTransform&&(enableWidthWithTransform=browser.supportsCssAnimation()),this.setAttribute("data-embyslider","true"),this.classList.add("mdl-slider"),this.classList.add("mdl-js-slider"),this.classList.contains("slider-medium-thumb")||(layoutManager.mobile?this.classList.add("slider-large-thumb"):layoutManager.tv&&this.classList.add("slider-small-thumb")),browser.noFlex&&this.classList.add("slider-no-webkit-thumb"),layoutManager.mobile||this.classList.add("mdl-slider-hoverthumb");var containerElement=this.parentNode;containerElement.classList.add("mdl-slider__container");var htmlToInsert="";supportsNativeProgressStyle||(htmlToInsert+='<div class="mdl-slider__background-flex">',htmlToInsert+='<div class="mdl-slider__background-upper"></div>',htmlToInsert+=enableWidthWithTransform?'<div class="mdl-slider__background-lower mdl-slider__background-lower-withtransform"></div>':'<div class="mdl-slider__background-lower"></div>',htmlToInsert+="</div>"),htmlToInsert+='<div class="sliderBubble hide"></div>',containerElement.insertAdjacentHTML("beforeend",htmlToInsert);var backgroundLower=containerElement.querySelector(".mdl-slider__background-lower");this.backgroundUpper=containerElement.querySelector(".mdl-slider__background-upper");var sliderBubble=containerElement.querySelector(".sliderBubble"),hasHideClass=sliderBubble.classList.contains("hide");dom.addEventListener(this,"input",function(e){this.dragging=!0,updateBubble(this,this.value,sliderBubble),hasHideClass&&(sliderBubble.classList.remove("hide"),hasHideClass=!1)},{passive:!0}),dom.addEventListener(this,"change",function(){this.dragging=!1,updateValues(this,backgroundLower),sliderBubble.classList.add("hide"),hasHideClass=!0},{passive:!0}),browser.firefox||(dom.addEventListener(this,"mousemove",function(e){if(!this.dragging){var rect=this.getBoundingClientRect(),clientX=e.clientX,bubbleValue=(clientX-rect.left)/rect.width;bubbleValue*=100,updateBubble(this,bubbleValue,sliderBubble),hasHideClass&&(sliderBubble.classList.remove("hide"),hasHideClass=!1)}},{passive:!0}),dom.addEventListener(this,"mouseleave",function(){sliderBubble.classList.add("hide"),hasHideClass=!0},{passive:!0})),supportsNativeProgressStyle||(supportsValueSetOverride?this.addEventListener("valueset",function(){updateValues(this,backgroundLower)}):startInterval(this,backgroundLower))}},EmbySliderPrototype.setBufferedRanges=function(ranges,runtime,position){var elem=this.backgroundUpper;if(elem){null!=runtime&&(ranges=mapRangesFromRuntimeToPercent(ranges,runtime),position=position/runtime*100);for(var i=0,length=ranges.length;i<length;i++){var range=ranges[i];if(!(null!=position&&position>=range.end))return void setRange(elem,range.start,range.end)}setRange(elem,0,0)}},EmbySliderPrototype.detachedCallback=function(){var interval=this.interval;interval&&clearInterval(interval),this.interval=null,this.backgroundUpper=null},document.registerElement("emby-slider",{prototype:EmbySliderPrototype,extends:"input"})});
|
||||
define(["browser","dom","layoutManager","css!./emby-slider","registerElement","emby-input"],function(browser,dom,layoutManager){"use strict";function updateValues(range,backgroundLower){var value=range.value;requestAnimationFrame(function(){if(backgroundLower){var fraction=(value-range.min)/(range.max-range.min);enableWidthWithTransform?backgroundLower.style.transform="scaleX("+fraction+")":(fraction*=100,backgroundLower.style.width=fraction+"%")}})}function updateBubble(range,value,bubble,bubbleText){requestAnimationFrame(function(){bubble.style.left=value+"%",range.getBubbleHtml?value=range.getBubbleHtml(value):(value=range.getBubbleText?range.getBubbleText(value):Math.round(value),value='<h1 class="sliderBubbleText">'+value+"</h1>"),bubble.innerHTML=value})}function setRange(elem,startPercent,endPercent){var style=elem.style;style.left=Math.max(startPercent,0)+"%";var widthPercent=endPercent-startPercent;style.width=Math.max(Math.min(widthPercent,100),0)+"%"}function mapRangesFromRuntimeToPercent(ranges,runtime){return runtime?ranges.map(function(r){return{start:r.start/runtime*100,end:r.end/runtime*100}}):[]}function startInterval(range,backgroundLower){var interval=range.interval;interval&&clearInterval(interval),range.interval=setInterval(function(){updateValues(range,backgroundLower)},100)}var enableWidthWithTransform,EmbySliderPrototype=Object.create(HTMLInputElement.prototype),supportsNativeProgressStyle=browser.firefox,supportsValueSetOverride=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");descriptor&&descriptor.configurable&&(supportsValueSetOverride=!0)}EmbySliderPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embyslider")){this.setAttribute("data-embyslider","true"),this.classList.add("mdl-slider"),this.classList.add("mdl-js-slider"),browser.noFlex&&this.classList.add("slider-no-webkit-thumb"),layoutManager.mobile||this.classList.add("mdl-slider-hoverthumb");var containerElement=this.parentNode;containerElement.classList.add("mdl-slider__container");var htmlToInsert="";supportsNativeProgressStyle||(htmlToInsert+='<div class="mdl-slider__background-flex">',htmlToInsert+='<div class="mdl-slider__background-flex-inner">',htmlToInsert+='<div class="mdl-slider__background-upper"></div>',htmlToInsert+=enableWidthWithTransform?'<div class="mdl-slider__background-lower mdl-slider__background-lower-withtransform"></div>':'<div class="mdl-slider__background-lower"></div>',htmlToInsert+="</div>",htmlToInsert+="</div>"),htmlToInsert+='<div class="sliderBubble hide"></div>',containerElement.insertAdjacentHTML("beforeend",htmlToInsert);var backgroundLower=containerElement.querySelector(".mdl-slider__background-lower");this.backgroundUpper=containerElement.querySelector(".mdl-slider__background-upper");var sliderBubble=containerElement.querySelector(".sliderBubble"),hasHideClass=sliderBubble.classList.contains("hide");dom.addEventListener(this,"input",function(e){this.dragging=!0,updateBubble(this,this.value,sliderBubble),hasHideClass&&(sliderBubble.classList.remove("hide"),hasHideClass=!1)},{passive:!0}),dom.addEventListener(this,"change",function(){this.dragging=!1,updateValues(this,backgroundLower),sliderBubble.classList.add("hide"),hasHideClass=!0},{passive:!0}),browser.firefox||(dom.addEventListener(this,"mousemove",function(e){if(!this.dragging){var rect=this.getBoundingClientRect(),clientX=e.clientX,bubbleValue=(clientX-rect.left)/rect.width;bubbleValue*=100,updateBubble(this,bubbleValue,sliderBubble),hasHideClass&&(sliderBubble.classList.remove("hide"),hasHideClass=!1)}},{passive:!0}),dom.addEventListener(this,"mouseleave",function(){sliderBubble.classList.add("hide"),hasHideClass=!0},{passive:!0})),supportsNativeProgressStyle||(supportsValueSetOverride?this.addEventListener("valueset",function(){updateValues(this,backgroundLower)}):startInterval(this,backgroundLower))}},EmbySliderPrototype.setBufferedRanges=function(ranges,runtime,position){var elem=this.backgroundUpper;if(elem){null!=runtime&&(ranges=mapRangesFromRuntimeToPercent(ranges,runtime),position=position/runtime*100);for(var i=0,length=ranges.length;i<length;i++){var range=ranges[i];if(!(null!=position&&position>=range.end))return void setRange(elem,range.start,range.end)}setRange(elem,0,0)}},EmbySliderPrototype.detachedCallback=function(){var interval=this.interval;interval&&clearInterval(interval),this.interval=null,this.backgroundUpper=null},document.registerElement("emby-slider",{prototype:EmbySliderPrototype,extends:"input"})});
|
|
@ -1 +1 @@
|
|||
.countIndicator,.indicator{-webkit-border-radius:500px;font-weight:500}.itemProgressBar{background:#333;position:relative;height:.26em}.itemProgressBarForeground{position:absolute;top:0;left:0;bottom:0;background-color:#52B54B}.itemProgressBarForeground-recording{background-color:#CB272A}.indicator{border-radius:500px;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;width:2em;height:2em}.countIndicator,.playedIndicator{background:rgba(82,181,75,1);display:-webkit-flex;display:-webkit-box;-webkit-box-align:center;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.timerIndicator{color:#CB272A}.timerIndicator-inactive{color:#888}.indicator+.indicator{margin-left:.25em}.indicatorIcon{width:auto;height:auto;font-size:1.6em}.countIndicator{border-radius:500px;display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);font-size:88%}.playedIndicator,.videoIndicator{-webkit-border-radius:500px;color:#fff}.playedIndicator{border-radius:500px;display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);font-size:80%}.videoIndicator{background:#444;border-radius:500px;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);font-size:88%}.syncIndicator{color:#fff;-webkit-border-radius:500px;border-radius:500px}.emptySyncIndicator{background:#ccc;color:#333}.fullSyncIndicator{background:rgba(82,181,75,1)}
|
||||
.countIndicator,.indicator{-webkit-border-radius:500px;font-weight:500}.itemProgressBar{background:#333;background:rgba(51,51,51,.8);position:relative;height:.26em}.itemProgressBarForeground{position:absolute;top:0;left:0;bottom:0;background-color:#52B54B}.itemProgressBarForeground-recording{background-color:#CB272A}.indicator{border-radius:500px;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;width:2em;height:2em}.countIndicator,.playedIndicator{background:rgba(82,181,75,1);display:-webkit-flex;display:-webkit-box;-webkit-box-align:center;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.timerIndicator{color:#CB272A}.timerIndicator-inactive{color:#888}.indicator+.indicator{margin-left:.25em}.indicatorIcon{width:auto;height:auto;font-size:1.6em}.countIndicator{border-radius:500px;display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);font-size:88%}.playedIndicator,.videoIndicator{-webkit-border-radius:500px;color:#fff}.playedIndicator{border-radius:500px;display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);font-size:80%}.videoIndicator{background:#444;border-radius:500px;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);font-size:88%}.syncIndicator{color:#fff;-webkit-border-radius:500px;border-radius:500px}.emptySyncIndicator{background:#ccc;color:#333}.fullSyncIndicator{background:rgba(82,181,75,1)}
|
|
@ -1 +1 @@
|
|||
.mediaButton.active{color:#52B54B}.nowPlayingBarInfoContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:100%}.nowPlayingBar{color:#ccc;text-align:center;will-change:transform;contain:layout style;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.nowPlayingBar-hidden{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.nowPlayingBarTop{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:4.2em}.mediaButton,.nowPlayingBarUserDataButtons .btnUserItemRating{vertical-align:middle;margin:0;text-align:center}.mediaButton i{height:1em;width:1em;font-size:200%}.nowPlayingBar .nowPlayingImage{background-position:center center;background-repeat:no-repeat;-webkit-background-size:contain;background-size:contain;height:70%;width:4.2em;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.nowPlayingBarText{overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;vertical-align:middle;text-align:left;max-width:10em;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;font-size:92%;margin-right:2.4em}.nowPlayingBarSecondaryText{color:#999}.repeatActive{color:#52B54B}@media (min-width:31.25em){.nowPlayingBarText{max-width:15.3em}}@media (min-width:37.5em){.nowPlayingBarText{max-width:17em}}@media (min-width:43.75em){.nowPlayingBarText{max-width:20.4em}}@media (min-width:50em){.nowPlayingBarText{max-width:25.5em}}@media (min-width:56.25em){.nowPlayingBarText{max-width:34em}}.nowPlayingBarCenter{vertical-align:middle;text-align:center;z-index:2;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.nowPlayingBarPositionContainer{position:absolute!important;left:0;top:-8px;right:0;z-index:1}.headroom--unpinned .nowPlayingBarPositionContainer,.noMediaProgress .nowPlayingBarPositionContainer{display:none}.nowPlayingBarRight{position:relative;margin:0 .5em 0 auto;z-index:2;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.nowPlayingBarCurrentTime{vertical-align:middle;font-weight:400;text-align:center;display:inline-block;padding-left:1.5em}.nowPlayingBarVolumeSliderContainer{margin-right:2em}.nowPlayingBarUserDataButtons{display:inline-block;margin-left:1em;margin-right:1em}@media all and (max-width:87.5em){.nowPlayingBarUserDataButtons{display:none}}@media all and (max-width:68.75em){.nowPlayingBar .muteButton,.nowPlayingBar .unmuteButton,.nowPlayingBarVolumeSliderContainer{display:none!important}}@media all and (max-width:50em){.nowPlayingBarCenter>*{display:none!important}.toggleRepeatButton{display:none}}@media all and (min-width:50em){.nowPlayingBarRight .playPauseButton{display:none}}
|
||||
.mediaButton.active{color:#52B54B}.nowPlayingBarInfoContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:100%}.nowPlayingBar{color:#ccc;text-align:center;will-change:transform;contain:layout style;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.nowPlayingBar-hidden{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.nowPlayingBarTop{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:4.2em}.mediaButton,.nowPlayingBarUserDataButtons .btnUserItemRating{vertical-align:middle;margin:0;text-align:center}.mediaButton i{height:1em;width:1em;font-size:200%}.nowPlayingBar .nowPlayingImage{background-position:center center;background-repeat:no-repeat;-webkit-background-size:contain;background-size:contain;height:70%;width:4.2em;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.nowPlayingBarText{overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;vertical-align:middle;text-align:left;max-width:10em;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;font-size:92%;margin-right:2.4em}.nowPlayingBarSecondaryText{color:#999}.repeatActive{color:#52B54B}@media (min-width:31.25em){.nowPlayingBarText{max-width:15.3em}}@media (min-width:37.5em){.nowPlayingBarText{max-width:17em}}@media (min-width:43.75em){.nowPlayingBarText{max-width:20.4em}}@media (min-width:50em){.nowPlayingBarText{max-width:25.5em}}@media (min-width:56.25em){.nowPlayingBarText{max-width:34em}}.nowPlayingBarCenter{vertical-align:middle;text-align:center;z-index:2;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.nowPlayingBarPositionContainer{position:absolute!important;left:0;top:-8px;right:0;z-index:1}.headroom--unpinned .nowPlayingBarPositionContainer,.noMediaProgress .nowPlayingBarPositionContainer{display:none}.nowPlayingBarRight{position:relative;margin:0 .5em 0 auto;z-index:2;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.nowPlayingBarCurrentTime{vertical-align:middle;font-weight:400;text-align:center;display:inline-block;padding-left:1.5em}.nowPlayingBarVolumeSliderContainer{margin-right:2em}.nowPlayingBarUserDataButtons{display:inline-block;margin-left:1em;margin-right:1em}.nowPlayingBarPositionSlider::-webkit-slider-thumb{width:1.2em!important;height:1.2em!important}@media all and (max-width:87.5em){.nowPlayingBarUserDataButtons{display:none}}@media all and (max-width:68.75em){.nowPlayingBar .muteButton,.nowPlayingBar .unmuteButton,.nowPlayingBarVolumeSliderContainer{display:none!important}}@media all and (max-width:50em){.nowPlayingBarCenter>*{display:none!important}.toggleRepeatButton{display:none}}@media all and (min-width:50em){.nowPlayingBarRight .playPauseButton{display:none}}
|
Loading…
Add table
Add a link
Reference in a new issue