mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
2379c4485c
- Make shaka-overlay-parent a mixin instead of an actual class
- Fox maximum stylability, it should be the job of the styles to
position and overlay objects without JS code declaring that it be
so.
- The "seek to live" effect of clicking the current time no longer
depends on the seek bar being used
- The shaka-transparent class is not needed. The controls are now
set to be opaque based on an attribute.
- Use an attribute for casting state as well.
- Remove redundant opacity transition on play button. It is already
on the controls overlay as a whole.
- Make layout more generic, which allows us to remove some explicit
positioning and browser-specific layout hacks.
- Rename user-select(), whose value is always the default of "none",
to unselectable().
- Remove unnecessary or redundant styles.
- Apply the same default styles to all control elements, whether
buttons, divs, or inputs.
- Make overlay-parent() and overlay-child() more resilient with
settings to fill space by default.
- Consolidate the setting of displayed & hidden in JS.
Pre-work for #1703, #1709 (IE style fixes)
Makes progress on b/116651454 (hard-coded offsets)
Change-Id: I7ea579429979afa98f5b2c54f68114312c4f508d
157 lines
4.5 KiB
Plaintext
157 lines
4.5 KiB
Plaintext
/**
|
|
* Copyright 2016 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
/* A settings menu, which encompasses the top-level overflow menu and all
|
|
* submenus. These appear on top of all other controls (Z axis) when the
|
|
* overflow button is clicked. */
|
|
.shaka-settings-menu {
|
|
/* It's okay to add a vertical scroll if there are too many items, but
|
|
* horizontal scrolling is not allowed. */
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
|
|
/* Don't wrap text to the next line. */
|
|
white-space: nowrap;
|
|
|
|
/* Styles for the menu itself. */
|
|
background: white;
|
|
box-shadow: 0 1px 9px 0 rgba(0,0,0,0.40);
|
|
border-radius: 2px;
|
|
max-height: 250px;
|
|
min-width: 180px;
|
|
|
|
/* The menu is hidden by default. */
|
|
.hidden();
|
|
|
|
/* When displayed as a flex container, elements inside will flow in a
|
|
* vertical column. */
|
|
flex-direction: column;
|
|
|
|
/* Where the menu appears. */
|
|
position: absolute;
|
|
z-index: 2;
|
|
right: 15px;
|
|
bottom: 30px;
|
|
|
|
/* The buttons inside the menu. */
|
|
button {
|
|
font-size: 14px;
|
|
background: transparent;
|
|
color: black;
|
|
border: none;
|
|
min-height: 30px;
|
|
padding: 3.5px 6px;
|
|
|
|
/* The button itself is a flex container, with children center-aligned. */
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
/* When hovered, the button's background is highlighted. */
|
|
&:hover {
|
|
background: rgb(224, 224, 224);
|
|
}
|
|
}
|
|
|
|
/* These are the elements which contain the material design icons. */
|
|
/* TODO: Pull MD icon details out of JS. */
|
|
i {
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
padding-left: 10px;
|
|
}
|
|
|
|
/* If the seekbar is missing, this is positioned lower. */
|
|
/* TODO: Solve with flex layout instead? */
|
|
&.shaka-low-position {
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
bottom: 15px;
|
|
}
|
|
}
|
|
|
|
/* The span elements inside the top-level overflow menu contain single lines
|
|
* of text, which are the button name and the current selection. For example,
|
|
* a captions button might have "Captions" in one span (the button name), and
|
|
* "Farsi" in another (the current selection).
|
|
* These are displayed inside a .shaka-overflow-button-label grouping, to the
|
|
* right of MD icons. */
|
|
.shaka-overflow-menu span {
|
|
text-align: left;
|
|
position: relative;
|
|
font-family: Roboto-Regular, Roboto, sans-serif;
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
left: 13px;
|
|
}
|
|
|
|
/* This contains span elements with single lines of text, and appears to the
|
|
* right of MD icons. */
|
|
.shaka-overflow-button-label {
|
|
position: relative;
|
|
/* This is a flex container, whose children flow vertically. */
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* This is the specific span element which shows the current selection from some
|
|
* submenu. For example, it would contain the currently-selected subtitle
|
|
* language, the currently-selected resolution, etc. */
|
|
.shaka-current-selection-span {
|
|
/* This is dimmer than the other span, which is the name of the submenu. */
|
|
color: rgba(0, 0, 0, 0.54);
|
|
}
|
|
|
|
/* These three submenus have somewhat different margins inside them. */
|
|
/* TODO: This is all submenus, but not the top-level menu. Is there a better
|
|
* way to express this? */
|
|
.shaka-resolutions,
|
|
.shaka-audio-languages,
|
|
.shaka-text-languages {
|
|
span {
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
margin-left: 54px;
|
|
}
|
|
}
|
|
|
|
/* This is a button within each submenu that takes you back to the main overflow
|
|
* menu. */
|
|
.shaka-back-to-overflow-button {
|
|
/* The label inside the button, which says something like "back". */
|
|
span {
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
margin-left: 0;
|
|
}
|
|
|
|
/* The MD icon for the "back" arrow. */
|
|
i {
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
padding-right: 20px;
|
|
}
|
|
}
|
|
|
|
/* The menu item for resolutions which contains "auto". */
|
|
.shaka-auto-span {
|
|
/* TODO(b/116651454): eliminate hard-coded offsets */
|
|
left: 17px;
|
|
}
|
|
|
|
/* The captions button, when captions are on. */
|
|
.shaka-captions-on {
|
|
color: black;
|
|
}
|
|
|
|
/* The captions button, when captions are off. */
|
|
.shaka-captions-off {
|
|
color: grey;
|
|
}
|