cyp/app/app.css
2020-03-08 22:11:46 +01:00

898 lines
16 KiB
CSS

*,
*::before,
*::after {
box-sizing: inherit;
}
html {
background-color: var(--fg);
}
body {
margin: 0;
}
cyp-app {
flex-direction: column;
box-sizing: border-box;
font-family: lato, sans-serif;
line-height: 1.25;
background-color: var(--bg);
color: var(--fg);
text-shadow: var(--text-shadow);
max-width: 800px;
margin: 0 auto;
overflow: hidden;
height: 100vh;
}
cyp-app:not([hidden]) {
display: flex;
}
header,
footer {
z-index: 1;
box-shadow: var(--box-shadow);
}
input,
select,
button {
color: inherit;
font: inherit;
}
button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
flex-direction: row;
align-items: center;
display: inline-flex;
white-space: nowrap;
background-color: transparent;
padding: 0;
border: none;
line-height: 1;
cursor: pointer;
}
button:not([hidden]) {
display: flex;
}
select {
background-color: transparent;
border: 1px solid var(--fg);
border-radius: 4px;
padding: 2px 4px;
}
@font-face {
font-family: "Lato";
src: url("font/LatoLatin-Regular.woff2") format("woff2");
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: "Lato";
src: url("font/LatoLatin-Bold.woff2") format("woff2");
font-style: bold;
font-weight: normal;
}
.icon {
width: 24px;
flex-shrink: 0;
}
.icon path:not([fill]),
.icon polygon:not([fill]),
.icon circle:not([fill]) {
fill: currentColor;
}
.flex-row {
flex-direction: row;
align-items: center;
}
.flex-row:not([hidden]) {
display: flex;
}
.flex-column {
flex-direction: column;
}
.flex-column:not([hidden]) {
display: flex;
}
.long-line {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.multiline {
flex-direction: row;
align-items: center;
}
.multiline:not([hidden]) {
display: flex;
}
.multiline h2 {
font-weight: normal;
}
x-range {
--thumb-size: 8px;
--thumb-color: #fff;
--thumb-shadow: #000;
--thumb-hover-color: #ddd;
--track-size: 4px;
--track-color: #888;
--track-shadow: #000;
--elapsed-color: #ddd;
--remaining-color: transparent;
--radius: calc(var(--track-size)/2);
display: inline-block;
position: relative;
width: 192px;
height: 16px;
}
x-range .-track,
x-range .-elapsed,
x-range .-remaining {
position: absolute;
top: calc(50% - var(--track-size)/2);
height: var(--track-size);
border-radius: var(--radius);
}
x-range .-track {
width: 100%;
left: 0;
background-color: var(--track-color);
box-shadow: 0 0 1px var(--thumb-shadow);
}
x-range .-elapsed {
left: 0;
background-color: var(--elapsed-color);
}
x-range .-remaining {
right: 0;
background-color: var(--remaining-color);
}
x-range .-inner {
position: absolute;
left: var(--thumb-size);
right: var(--thumb-size);
top: 0;
bottom: 0;
}
x-range .-thumb {
all: unset;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
width: calc(2*var(--thumb-size));
height: calc(2*var(--thumb-size));
background-color: var(--thumb-color);
box-shadow: 0 0 2px var(--thumb-shadow);
}
x-range[disabled] {
opacity: 0.5;
}
x-range:not([disabled]) .-thumb:hover {
background-color: var(--thumb-hover-color);
}
main {
flex-grow: 1;
overflow: auto;
}
cyp-menu {
flex-direction: row;
align-items: center;
height: 56px;
}
cyp-menu:not([hidden]) {
display: flex;
}
cyp-menu button {
flex: 1 0 0;
height: 100%;
flex-direction: column;
align-items: center;
padding-top: 4px;
border-top: 4px solid transparent;
}
cyp-menu button:not([hidden]) {
display: flex;
}
cyp-menu button .icon {
margin-right: var(--icon-spacing);
}
cyp-menu button.active {
border-top-color: var(--primary);
color: var(--primary);
background-color: rgb(var(--primary-raw), 0.1);
}
@media (max-width: 480px) {
cyp-menu button {
flex-direction: row;
justify-content: center;
}
cyp-menu button:not([data-for=queue]) .icon {
margin-right: 0;
}
cyp-menu button span:not([id]) {
display: none;
}
}
cyp-player {
flex-direction: row;
align-items: center;
align-items: stretch;
}
cyp-player:not([hidden]) {
display: flex;
}
cyp-player:not([data-state=play]) .pause {
display: none;
}
cyp-player[data-state=play] .play {
display: none;
}
cyp-player:not([data-flags~=random]) .random,
cyp-player:not([data-flags~=repeat]) .repeat {
opacity: 0.5;
}
cyp-player x-range {
flex-grow: 1;
--elapsed-color: var(--primary);
}
cyp-player .art {
margin-right: 0;
height: 96px;
}
cyp-player .art img,
cyp-player .art .icon {
width: 96px;
}
cyp-player .info {
flex-grow: 2;
flex-basis: 0;
padding: 0 var(--icon-spacing);
overflow: hidden;
flex-direction: column;
justify-content: space-around;
}
cyp-player .info:not([hidden]) {
display: flex;
}
cyp-player .info h2 {
font-size: 125%;
margin: 0;
}
cyp-player .info .title,
cyp-player .info .subtitle {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
cyp-player .timeline {
flex-direction: row;
align-items: center;
}
cyp-player .timeline:not([hidden]) {
display: flex;
}
cyp-player .timeline .duration,
cyp-player .timeline .elapsed {
flex-basis: 5ch;
text-align: center;
}
cyp-player .controls {
flex-grow: 1;
flex-basis: 0;
max-width: 220px;
flex-direction: column;
justify-content: space-around;
}
cyp-player .controls:not([hidden]) {
display: flex;
}
cyp-player .controls .playback {
flex-direction: row;
align-items: center;
justify-content: space-around;
}
cyp-player .controls .playback:not([hidden]) {
display: flex;
}
cyp-player .controls .playback .icon {
width: 40px;
}
cyp-player .controls .playback .icon-play,
cyp-player .controls .playback .icon-pause {
width: 64px;
}
cyp-player .controls .volume {
flex-direction: row;
align-items: center;
}
cyp-player .controls .volume:not([hidden]) {
display: flex;
}
cyp-player .controls .volume .mute {
margin-right: 4px;
}
cyp-player .misc {
display: flex;
flex-direction: column;
align-self: stretch;
justify-content: space-around;
}
cyp-player .misc .icon {
width: 32px;
}
@media (max-width: 519px) {
cyp-player {
flex-wrap: wrap;
justify-content: space-between;
}
cyp-player .info {
order: 1;
flex-basis: 100%;
height: 96px;
}
}
.component header {
flex-direction: row;
align-items: center;
padding: var(--spacing);
}
.component header:not([hidden]) {
display: flex;
}
.component header button {
font-size: var(--font-size-large);
font-weight: bold;
overflow: hidden;
}
.component header button .icon {
margin-right: var(--icon-spacing);
}
.component ul {
flex-grow: 1;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
.component li {
flex-direction: row;
align-items: center;
}
.component li:not([hidden]) {
display: flex;
}
.component li .info {
flex-grow: 1;
overflow: hidden;
}
.component li .info .icon {
color: var(--primary);
margin-right: var(--icon-spacing);
filter: drop-shadow(var(--text-shadow));
}
.component li .info h2 {
font-size: var(--font-size-large);
margin: 0;
}
.component li .info h2,
.component li .info div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.component li:not(.has-art) {
padding: 8px;
}
.component li button .icon {
width: 32px;
}
.component li:nth-child(odd) {
background-color: var(--bg-alt);
}
cyp-queue header {
flex-direction: row;
align-items: center;
padding: var(--spacing);
}
cyp-queue header:not([hidden]) {
display: flex;
}
cyp-queue header button {
font-size: var(--font-size-large);
font-weight: bold;
overflow: hidden;
}
cyp-queue header button .icon {
margin-right: var(--icon-spacing);
}
cyp-queue ul {
flex-grow: 1;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
cyp-queue li {
flex-direction: row;
align-items: center;
}
cyp-queue li:not([hidden]) {
display: flex;
}
cyp-queue li .info {
flex-grow: 1;
overflow: hidden;
}
cyp-queue li .info .icon {
color: var(--primary);
margin-right: var(--icon-spacing);
filter: drop-shadow(var(--text-shadow));
}
cyp-queue li .info h2 {
font-size: var(--font-size-large);
margin: 0;
}
cyp-queue li .info h2,
cyp-queue li .info div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
cyp-queue li:not(.has-art) {
padding: 8px;
}
cyp-queue li button .icon {
width: 32px;
}
cyp-queue li:nth-child(odd) {
background-color: var(--bg-alt);
}
cyp-queue .current {
color: var(--primary);
}
#library header {
flex-direction: row;
align-items: center;
padding: var(--spacing);
}
#library header:not([hidden]) {
display: flex;
}
#library header button {
font-size: var(--font-size-large);
font-weight: bold;
overflow: hidden;
}
#library header button .icon {
margin-right: var(--icon-spacing);
}
#library ul {
flex-grow: 1;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
#library li {
flex-direction: row;
align-items: center;
}
#library li:not([hidden]) {
display: flex;
}
#library li .info {
flex-grow: 1;
overflow: hidden;
}
#library li .info .icon {
color: var(--primary);
margin-right: var(--icon-spacing);
filter: drop-shadow(var(--text-shadow));
}
#library li .info h2 {
font-size: var(--font-size-large);
margin: 0;
}
#library li .info h2,
#library li .info div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#library li:not(.has-art) {
padding: 8px;
}
#library li button .icon {
width: 32px;
}
#library li:nth-child(odd) {
background-color: var(--bg-alt);
}
#library header {
white-space: pre;
}
#library .search {
order: 1;
}
#library .search.open ~ * {
display: none;
}
#library .art img,
#library .art .icon {
width: 64px;
}
#library .art .icon {
filter: drop-shadow(var(--text-shadow));
}
#library .group {
cursor: pointer;
}
#library .group h2 {
font-weight: normal;
}
#library .tiles {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
grid-gap: 2px;
}
#library .tiles li {
text-align: center;
cursor: pointer;
background-color: rgba(255, 255, 255, 0.08);
height: 200px;
}
#library .tiles li h2 {
font-size: 150%;
margin: 4px 0;
}
#fs header {
flex-direction: row;
align-items: center;
padding: var(--spacing);
}
#fs header:not([hidden]) {
display: flex;
}
#fs header button {
font-size: var(--font-size-large);
font-weight: bold;
overflow: hidden;
}
#fs header button .icon {
margin-right: var(--icon-spacing);
}
#fs ul {
flex-grow: 1;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
#fs li {
flex-direction: row;
align-items: center;
}
#fs li:not([hidden]) {
display: flex;
}
#fs li .info {
flex-grow: 1;
overflow: hidden;
}
#fs li .info .icon {
color: var(--primary);
margin-right: var(--icon-spacing);
filter: drop-shadow(var(--text-shadow));
}
#fs li .info h2 {
font-size: var(--font-size-large);
margin: 0;
}
#fs li .info h2,
#fs li .info div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#fs li:not(.has-art) {
padding: 8px;
}
#fs li button .icon {
width: 32px;
}
#fs li:nth-child(odd) {
background-color: var(--bg-alt);
}
#fs header {
white-space: pre;
}
#fs .search {
order: 1;
}
#fs .search.open ~ * {
display: none;
}
#fs .group {
cursor: pointer;
}
#fs .info {
flex-direction: row;
align-items: center;
}
#fs .info:not([hidden]) {
display: flex;
}
#fs .info h2 {
font-weight: normal;
}
#playlists header {
flex-direction: row;
align-items: center;
padding: var(--spacing);
}
#playlists header:not([hidden]) {
display: flex;
}
#playlists header button {
font-size: var(--font-size-large);
font-weight: bold;
overflow: hidden;
}
#playlists header button .icon {
margin-right: var(--icon-spacing);
}
#playlists ul {
flex-grow: 1;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
#playlists li {
flex-direction: row;
align-items: center;
}
#playlists li:not([hidden]) {
display: flex;
}
#playlists li .info {
flex-grow: 1;
overflow: hidden;
}
#playlists li .info .icon {
color: var(--primary);
margin-right: var(--icon-spacing);
filter: drop-shadow(var(--text-shadow));
}
#playlists li .info h2 {
font-size: var(--font-size-large);
margin: 0;
}
#playlists li .info h2,
#playlists li .info div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#playlists li:not(.has-art) {
padding: 8px;
}
#playlists li button .icon {
width: 32px;
}
#playlists li:nth-child(odd) {
background-color: var(--bg-alt);
}
#playlists .info {
flex-direction: row;
align-items: center;
}
#playlists .info:not([hidden]) {
display: flex;
}
#playlists .info h2 {
font-weight: normal;
}
#yt header {
flex-direction: row;
align-items: center;
padding: var(--spacing);
}
#yt header:not([hidden]) {
display: flex;
}
#yt header button {
font-size: var(--font-size-large);
font-weight: bold;
overflow: hidden;
}
#yt header button .icon {
margin-right: var(--icon-spacing);
}
#yt ul {
flex-grow: 1;
overflow: auto;
list-style: none;
margin: 0;
padding: 0;
}
#yt li {
flex-direction: row;
align-items: center;
}
#yt li:not([hidden]) {
display: flex;
}
#yt li .info {
flex-grow: 1;
overflow: hidden;
}
#yt li .info .icon {
color: var(--primary);
margin-right: var(--icon-spacing);
filter: drop-shadow(var(--text-shadow));
}
#yt li .info h2 {
font-size: var(--font-size-large);
margin: 0;
}
#yt li .info h2,
#yt li .info div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#yt li:not(.has-art) {
padding: 8px;
}
#yt li button .icon {
width: 32px;
}
#yt li:nth-child(odd) {
background-color: var(--bg-alt);
}
#yt header {
border-bottom: 1px solid var(--fg);
}
#yt header button + button {
margin-left: 16px;
}
#yt .clear {
margin-left: auto;
}
#yt pre {
margin: 0.5em 0.5ch;
flex-grow: 1;
overflow: auto;
white-space: pre-wrap;
}
#yt.pending header {
background-image: linear-gradient(var(--primary), var(--primary));
background-repeat: no-repeat;
background-size: 25% 4px;
animation: bar ease-in-out 3s alternate infinite;
}
@keyframes bar {
0% {
background-position: 0 100%;
}
100% {
background-position: 100% 100%;
}
}
cyp-settings {
font-size: var(--font-size-large);
}
cyp-settings dl {
margin: var(--spacing);
display: grid;
grid-template-columns: max-content 1fr;
align-items: center;
grid-gap: var(--spacing);
}
cyp-settings dt {
font-weight: bold;
}
cyp-settings dd {
margin: 0;
flex-direction: column;
align-items: start;
}
cyp-settings dd:not([hidden]) {
display: flex;
}
cyp-settings label {
flex-direction: row;
align-items: center;
}
cyp-settings label:not([hidden]) {
display: flex;
}
cyp-settings label [type=radio],
cyp-settings label [type=checkbox] {
margin: 0 4px 0 0;
}
.search {
flex-direction: row;
align-items: center;
margin-left: auto;
transition: all 300ms;
width: 32px;
max-width: 20ch;
}
.search:not([hidden]) {
display: flex;
}
.search .icon {
width: 32px;
cursor: pointer;
}
.search input {
border: none;
outline: none;
color: inherit;
background-color: inherit;
border-bottom: 1px solid var(--fg);
width: 0;
padding: 0;
flex-grow: 1;
}
.search.open {
flex: 1;
}
.art {
margin-right: var(--icon-spacing);
}
.art .icon,
.art img {
vertical-align: top;
}
cyp-app {
--font-size-large: 112.5%;
--icon-spacing: 4px;
--primary: rgb(var(--primary-raw));
--spacing: 8px;
--box-shadow: 0 0 3px #000;
}
cyp-app[theme=light] {
--fg: #333;
--bg: #f0f0f0;
--bg-alt: #e0e0e0;
--text-shadow: none;
}
cyp-app[theme=dark] {
--fg: #f0f0f0;
--bg: #333;
--bg-alt: #555;
--text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}
@media (prefers-color-scheme: dark) {
cyp-app[theme=auto] {
--fg: #f0f0f0;
--bg: #333;
--bg-alt: #555;
--text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}
}
@media (prefers-color-scheme: light) {
cyp-app[theme=auto] {
--fg: #333;
--bg: #f0f0f0;
--bg-alt: #e0e0e0;
--text-shadow: none;
}
}
cyp-app[color=dodgerblue] {
--primary-raw: 30, 144, 255;
}
cyp-app[color=darkorange] {
--primary-raw: 255, 140, 0;
}
cyp-app[color=limegreen] {
--primary-raw: 50, 205, 50;
}
@media (max-width: 480px) {
:root {
--spacing: var(--icon-spacing);
}
}