mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update tabs
This commit is contained in:
parent
382dea3748
commit
9ea282ff39
129 changed files with 371 additions and 418 deletions
|
@ -13,6 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../paper-styles/default-theme.html">
|
||||
<link rel="import" href="../paper-ripple/paper-ripple.html">
|
||||
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
|
||||
<link rel="import" href="../iron-checked-element-behavior/iron-checked-element-behavior.html">
|
||||
|
||||
<!--
|
||||
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state
|
||||
|
@ -31,9 +32,9 @@ Custom property | Description | Default
|
|||
`--paper-toggle-button-unchecked-bar-color` | Slider color when the input is not checked | `#000000`
|
||||
`--paper-toggle-button-unchecked-button-color` | Button color when the input is not checked | `--paper-grey-50`
|
||||
`--paper-toggle-button-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--dark-primary-color`
|
||||
`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--google-green-500`
|
||||
`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--google-green-500`
|
||||
`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--google-green-500`
|
||||
`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--default-primary-color`
|
||||
`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--default-primary-color`
|
||||
`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
|
||||
`--paper-toggle-button-unchecked-bar` | Mixin applied to the slider when the input is not checked | `{}`
|
||||
`--paper-toggle-button-unchecked-button` | Mixin applied to the slider button when the input is not checked | `{}`
|
||||
`--paper-toggle-button-checked-bar` | Mixin applied to the slider when the input is checked | `{}`
|
||||
|
@ -46,11 +47,114 @@ Custom property | Description | Default
|
|||
-->
|
||||
|
||||
<dom-module id="paper-toggle-button">
|
||||
|
||||
<link rel="import" type="css" href="paper-toggle-button.css">
|
||||
|
||||
<template>
|
||||
|
||||
<style>
|
||||
:host {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
:host([disabled]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline:none;
|
||||
}
|
||||
|
||||
:host .toggle-bar {
|
||||
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
|
||||
@apply(--paper-toggle-button-unchecked-bar);
|
||||
}
|
||||
|
||||
:host .toggle-button {
|
||||
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
|
||||
@apply(--paper-toggle-button-unchecked-button);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-bar {
|
||||
background-color: var(--paper-toggle-button-checked-bar-color, --default-primary-color);
|
||||
@apply(--paper-toggle-button-checked-bar);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-button {
|
||||
background-color: var(--paper-toggle-button-checked-button-color, --default-primary-color);
|
||||
@apply(--paper-toggle-button-checked-button);
|
||||
}
|
||||
|
||||
:host .toggle-ink {
|
||||
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-ink {
|
||||
color: var(--paper-toggle-button-checked-ink-color, --default-primary-color);
|
||||
}
|
||||
|
||||
/* ID selectors should not be overriden by users. */
|
||||
|
||||
#toggleContainer {
|
||||
position: relative;
|
||||
width: 36px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
#toggleBar {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
pointer-events: none;
|
||||
opacity: 0.4;
|
||||
transition: background-color linear .08s;
|
||||
}
|
||||
|
||||
:host([checked]) #toggleBar {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host([disabled]) #toggleBar {
|
||||
background-color: #000;
|
||||
opacity: 0.12;
|
||||
}
|
||||
|
||||
#toggleButton {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6);
|
||||
transition: -webkit-transform linear .08s, background-color linear .08s;
|
||||
transition: transform linear .08s, background-color linear .08s;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
#toggleButton.dragging {
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
:host([checked]) #toggleButton {
|
||||
-webkit-transform: translate(16px, 0);
|
||||
transform: translate(16px, 0);
|
||||
}
|
||||
|
||||
:host([disabled]) #toggleButton {
|
||||
background-color: #bdbdbd;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#ink {
|
||||
position: absolute;
|
||||
top: -14px;
|
||||
left: -14px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="toggleContainer">
|
||||
<div id="toggleBar" class="toggle-bar"></div>
|
||||
<div id="toggleButton" class="toggle-button">
|
||||
|
@ -65,7 +169,8 @@ Custom property | Description | Default
|
|||
is: 'paper-toggle-button',
|
||||
|
||||
behaviors: [
|
||||
Polymer.PaperInkyFocusBehavior
|
||||
Polymer.PaperInkyFocusBehavior,
|
||||
Polymer.IronCheckedElementBehavior
|
||||
],
|
||||
|
||||
hostAttributes: {
|
||||
|
@ -85,34 +190,6 @@ Custom property | Description | Default
|
|||
*
|
||||
* @event iron-change
|
||||
*/
|
||||
/**
|
||||
* Gets or sets the state, `true` is checked and `false` is unchecked.
|
||||
*
|
||||
* @attribute checked
|
||||
* @type boolean
|
||||
* @default false
|
||||
*/
|
||||
checked: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
reflectToAttribute: true,
|
||||
notify: true,
|
||||
observer: '_checkedChanged'
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the button toggles the active state with each tap or press
|
||||
* of the spacebar.
|
||||
*
|
||||
* @attribute toggles
|
||||
* @type boolean
|
||||
* @default true
|
||||
*/
|
||||
toggles: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
reflectToAttribute: true
|
||||
}
|
||||
},
|
||||
|
||||
listeners: {
|
||||
|
@ -133,11 +210,6 @@ Custom property | Description | Default
|
|||
}
|
||||
},
|
||||
|
||||
_checkedChanged: function(checked) {
|
||||
this.active = this.checked;
|
||||
this.fire('iron-change');
|
||||
},
|
||||
|
||||
_ontrack: function(event) {
|
||||
var track = event.detail;
|
||||
if (track.state === 'start') {
|
||||
|
@ -174,5 +246,4 @@ Custom property | Description | Default
|
|||
|
||||
});
|
||||
</script>
|
||||
|
||||
</dom-module>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue