From 9138ce4cc904bdaaab0646b0b3999310e4ee946c Mon Sep 17 00:00:00 2001 From: Sijmen Date: Thu, 27 Apr 2023 14:07:35 +0200 Subject: [PATCH] Move style and favicon to static files --- src/main.rs | 2 + static/favicon.png | Bin 0 -> 483 bytes static/style.css | 170 +++++++++++++++++++++++++++++++++++++++++ templates/index.html | 177 +------------------------------------------ 4 files changed, 174 insertions(+), 175 deletions(-) create mode 100644 static/favicon.png create mode 100644 static/style.css diff --git a/src/main.rs b/src/main.rs index 9448c41..55ea9d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -191,6 +191,8 @@ async fn main() -> tide::Result<()> { app.at("/previous").post(post_previous); app.at("/next").post(post_next); + app.at("/static").serve_dir("static/")?; + app.listen("0.0.0.0:8080").await?; Ok(()) } diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..56442dec656dac9f133cfb93a45f76ef70119e06 GIT binary patch literal 483 zcmV<90UZ8`P)@;}@Wm+)CqrNN6N}fl{ZIc!WkF-cg}bDQJCLE}00E zJ$ugFIm155N+y}T_pEi+K98x_Dn9BJ=U;OHWjp8&{09ea5jmt3dPm%_GWH{^6D{Nd z(j0LI6#eQgRCWv9BzBflp5IakJ@9T>;p$gNr`Ny;UzU~%He7&WDwB)Y9r!+B-a_6& ziWw;T9PmZ#4&-c8Zy|4?zuZD{k}raJ&;;Y43!H#Wumi3V*J=4-mml|FBhOW$2Nt_v zHigYK?;4=D9TSa!ZV1WG$z;Z+>;$f{956b>9i zeyYj>E+8*krezG0bZ<%gEyuEr9#Cw?NJ6&W7h~>^X%+!nRB9PWJd)FI$V*MJ2#`~E z&p>3IoHavUZ~;>A5KLzvBW*JPo-^dALM;wR;Xber#uQ(9C1wuD?iGAk1qcz%UFeCp z1#lLedAnd90iT?fc#w4=H_=fbq%Xk{kQ=EuP}m3|pfGZp!Y)8FOGU=G14YiRrgr5W Zcn7W*R55OZ*;@br002ovPDHLkV1mXQ#IFDV literal 0 HcmV?d00001 diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..00491af --- /dev/null +++ b/static/style.css @@ -0,0 +1,170 @@ +html { + height: 100%; +} + +body { + font-family: sans; + background-color: #112; + color: #fff; + display: flex; + margin: 0; + height: 100%; +} + +body > div { + padding: 1rem; +} + +.browser { + flex: 1; + display: flex; + flex-flow: column; + height: 100%; +} + +a { + color: #fff; + font-weight: bold; + text-decoration: none; +} + +ul { + list-style: none; + padding: 0; + margin: 0; +} + +ul.queue { + margin-top: 1.0rem; +} + +ul.queue li { + padding: 0 0.5rem; + border-radius: .25rem; + display: flex; + align-items: center; +} + +ul.queue li.playing { + background-color: #334; +} + +ul.breadcrumb { + display: flex; + margin-bottom: 1rem; + flex-wrap: wrap; + list-style: none; + background-color: #334; + border-radius: .25rem; + padding: .75rem 1rem; +} + +ul.breadcrumb li:not(:first-child)::before { + display: inline-block; + padding-left: .5rem; + padding-right: .1rem; + color: #6c757d; + content: "/"; +} + +ul.dir { + overflow: auto; + flex: 1; +} + +ul.dir li { + cursor: pointer; + padding: .75rem .75rem; + border-radius: 3px; + + display: flex; + align-items: center; +} + +ul.dir li img { + width: 48px; + height: 48px; + object-fit: cover; +} + +ul.dir li:hover { + background-color: #334; +} + +ul.dir li .material-symbols-outlined { + margin-right: 0.75rem; + width: 24px; +} + +.song__name { + font-weight: bold; +} + +.albumart { + border-radius: 0.25rem; +} + +.queue .albumart { + margin: 0.75rem; + margin-left: 0; + width: 48px; + height: 48px; +} + +.albumart img { + border-radius: 0.25rem; + width: 100%; + height: 100%; + object-fit: cover; +} + +.player { + width: 25rem; +} + +.player .nowplaying { + display: flex; + flex-flow: column; + background-color: #334; + border-radius: 0.25rem; + height: 9.5rem; +} + +.player .controls { + display: flex; + justify-content: space-around; + padding: 0.5rem; +} + +.player .control { + font-size: 40px; + cursor: pointer; +} + +.player .current { + display: flex; + flex-flow: row; + align-items: center; + padding: 0.5rem; + flex: 1; +} + +.nowplaying .albumart { + margin-right: 1.0rem; + background-color: #445; + width: 80px; + height: 80px; + transition: transform 200ms ease-in-out; +} +.nowplaying .albumart:hover { + transform: scale(1.05); +} + +.nowplaying .metadata { + flex: 1; +} + +.nowplaying .idle { + font-weight: bold; + text-align: center; +} diff --git a/templates/index.html b/templates/index.html index 9bc3a5a..d047704 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,181 +6,8 @@ - - - - + +