This commit is contained in:
Ondrej Zara 2019-04-01 11:18:28 +02:00
parent 127a450791
commit 5dccd9d849
11 changed files with 90 additions and 24 deletions

View file

@ -12,7 +12,7 @@ body {
line-height: 1.25; line-height: 1.25;
background-color: var(--bg); background-color: var(--bg);
color: var(--fg); color: var(--fg);
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8); text-shadow: var(--shadow);
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
@ -41,7 +41,7 @@ button {
cursor: pointer; cursor: pointer;
flex-shrink: 0; flex-shrink: 0;
} }
.art img { button .icon {
vertical-align: top; vertical-align: top;
} }
.long-line { .long-line {
@ -70,7 +70,6 @@ button {
font-weight: normal; font-weight: normal;
} }
.icon { .icon {
vertical-align: middle;
width: 24px; width: 24px;
} }
.icon path:not([fill]), .icon path:not([fill]),
@ -157,6 +156,9 @@ nav ul li.active {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.component header {
display: flex;
}
.component ul { .component ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -176,6 +178,7 @@ nav ul li.active {
.component li .info .icon { .component li .info .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
.component li .info h2 { .component li .info h2 {
font-size: var(--font-size-large); font-size: var(--font-size-large);
@ -201,6 +204,9 @@ nav ul li.active {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
#queue header {
display: flex;
}
#queue ul { #queue ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -220,6 +226,7 @@ nav ul li.active {
#queue li .info .icon { #queue li .info .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
#queue li .info h2 { #queue li .info h2 {
font-size: var(--font-size-large); font-size: var(--font-size-large);
@ -248,6 +255,9 @@ nav ul li.active {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
#library header {
display: flex;
}
#library ul { #library ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -267,6 +277,7 @@ nav ul li.active {
#library li .info .icon { #library li .info .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
#library li .info h2 { #library li .info h2 {
font-size: var(--font-size-large); font-size: var(--font-size-large);
@ -290,7 +301,9 @@ nav ul li.active {
#library .art img, #library .art img,
#library .art .icon { #library .art .icon {
width: 64px; width: 64px;
margin-right: var(--icon-spacing); }
#library .art .icon {
filter: drop-shadow(var(--shadow));
} }
#library .group { #library .group {
cursor: pointer; cursor: pointer;
@ -318,6 +331,9 @@ nav ul li.active {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
#fs header {
display: flex;
}
#fs ul { #fs ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -337,6 +353,7 @@ nav ul li.active {
#fs li .info .icon { #fs li .info .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
#fs li .info h2 { #fs li .info h2 {
font-size: var(--font-size-large); font-size: var(--font-size-large);
@ -373,6 +390,9 @@ nav ul li.active {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
#playlists header {
display: flex;
}
#playlists ul { #playlists ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -392,6 +412,7 @@ nav ul li.active {
#playlists li .info .icon { #playlists li .info .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
#playlists li .info h2 { #playlists li .info h2 {
font-size: var(--font-size-large); font-size: var(--font-size-large);
@ -427,6 +448,9 @@ nav ul li.active {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
#yt header {
display: flex;
}
#yt ul { #yt ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -446,6 +470,7 @@ nav ul li.active {
#yt li .info .icon { #yt li .info .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
#yt li .info h2 { #yt li .info h2 {
font-size: var(--font-size-large); font-size: var(--font-size-large);
@ -497,25 +522,44 @@ nav ul li.active {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.search {
display: flex;
align-items: center;
max-width: 50%;
margin-left: auto;
transition: all 300ms;
}
.search .icon { .search .icon {
width: 32px; width: 32px;
cursor: pointer;
} }
.search input { .search input {
border: none; border: none;
color: inherit; color: inherit;
background-color: inherit; background-color: inherit;
border-bottom: 1px solid var(--fg); border-bottom: 1px solid var(--fg);
transition: all 300ms; xtransition: all 300ms;
padding: 0;
width: 30%;
}
.search:not(.open) input {
width: 0; width: 0;
padding: 0;
}
.search.open {
flex-grow: 1;
}
.search.open input {
flex-grow: 1;
}
.art {
margin-right: var(--icon-spacing);
}
.art .icon,
.art img {
vertical-align: top;
} }
:root { :root {
--primary: dodgerblue; --primary: dodgerblue;
--fg: #fff; --fg: #fff;
--bg: #333; --bg: #333;
--shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
--font-size-large: 112.5%; --font-size-large: 112.5%;
--icon-spacing: 4px; --icon-spacing: 4px;
} }

View file

@ -10,7 +10,7 @@ body {
line-height: 1.25; line-height: 1.25;
background-color: var(--bg); background-color: var(--bg);
color: var(--fg); color: var(--fg);
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8); text-shadow: var(--shadow);
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
@ -39,10 +39,8 @@ button {
line-height: 1; line-height: 1;
cursor: pointer; cursor: pointer;
flex-shrink: 0; flex-shrink: 0;
}
.art img { .icon { vertical-align: top; }
vertical-align: top;
} }
.long-line { .long-line {
@ -71,4 +69,5 @@ button {
@import "playlists.less"; @import "playlists.less";
@import "yt.less"; @import "yt.less";
@import "search.less"; @import "search.less";
@import "art.less";
@import "variables.less"; @import "variables.less";

7
app/css/art.less Normal file
View file

@ -0,0 +1,7 @@
.art {
margin-right: var(--icon-spacing);
.icon, img {
vertical-align: top;
}
}

View file

@ -3,6 +3,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
header {
display: flex;
}
ul { ul {
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
@ -23,6 +27,7 @@
.icon { .icon {
color: var(--primary); color: var(--primary);
margin-right: var(--icon-spacing); margin-right: var(--icon-spacing);
filter: drop-shadow(var(--shadow));
} }
h2 { h2 {

View file

@ -1,5 +1,4 @@
.icon { .icon {
vertical-align: middle;
width: 24px; width: 24px;
path, polygon, circle { path, polygon, circle {

View file

@ -3,7 +3,10 @@
.art img, .art .icon { .art img, .art .icon {
width: 64px; width: 64px;
margin-right: var(--icon-spacing); }
.art .icon {
filter: drop-shadow(var(--shadow));
} }
.group { .group {

View file

@ -1,6 +1,13 @@
.search { .search {
display: flex;
align-items: center;
max-width: 50%;
margin-left: auto;
transition: all 300ms;
.icon { .icon {
width: 32px; width: 32px;
cursor: pointer;
} }
input { input {
@ -8,14 +15,15 @@
color: inherit; color: inherit;
background-color: inherit; background-color: inherit;
border-bottom: 1px solid var(--fg); border-bottom: 1px solid var(--fg);
transition: all 300ms; xtransition: all 300ms;
width: 0;
padding: 0; padding: 0;
width: 30%;
} }
&:not(.open) { &.open {
flex-grow: 1;
input { input {
width: 0; flex-grow: 1;
} }
} }
} }

View file

@ -2,6 +2,7 @@
--primary: dodgerblue; --primary: dodgerblue;
--fg: #fff; --fg: #fff;
--bg: #333; --bg: #333;
--shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
--font-size-large: 112.5%; --font-size-large: 112.5%;
--icon-spacing: 4px; --icon-spacing: 4px;

View file

@ -13,8 +13,6 @@ function buildHeader(path) {
let header = node.querySelector("header"); let header = node.querySelector("header");
html.clear(header); html.clear(header);
header.appendChild(search.getNode());
let button = html.button({}, "/", header); let button = html.button({}, "/", header);
button.addEventListener("click", e => list("")); button.addEventListener("click", e => list(""));
@ -23,6 +21,8 @@ function buildHeader(path) {
let path = all.slice(0, index+1).join("/"); let path = all.slice(0, index+1).join("/");
button.addEventListener("click", e => list(path)); button.addEventListener("click", e => list(path));
}); });
header.appendChild(search.getNode());
} }
function buildDirectory(data, parent) { function buildDirectory(data, parent) {

View file

@ -39,7 +39,7 @@ function serializeFilter(filter) {
let tokens = ["("]; let tokens = ["("];
Object.entries(filter).forEach(([key, value], index) => { Object.entries(filter).forEach(([key, value], index) => {
index && tokens.push(" AND "); index && tokens.push(" AND ");
tokens.push(`(${key} == "${value}")`); tokens.push(`(${key} == "${escape(value)}")`);
}); });
tokens.push(")"); tokens.push(")");

View file

@ -13,8 +13,6 @@ function buildHeader(filter) {
let header = node.querySelector("header"); let header = node.querySelector("header");
html.clear(header); html.clear(header);
header.appendChild(search.getNode());
let button = html.button({}, "Music Library", header); let button = html.button({}, "Music Library", header);
button.addEventListener("click", e => listArtists()); button.addEventListener("click", e => listArtists());
@ -31,6 +29,8 @@ function buildHeader(filter) {
button.addEventListener("click", e => listSongs(albumFilter)); button.addEventListener("click", e => listSongs(albumFilter));
} }
} }
header.appendChild(search.getNode());
} }
function buildAlbum(album, filter, parent) { function buildAlbum(album, filter, parent) {