From 1998a36d6db956ba5750309b12bedc4ab14b1cc4 Mon Sep 17 00:00:00 2001 From: ari melody Date: Sat, 31 Aug 2024 19:29:57 +0100 Subject: [PATCH] UI improvements --- .../components/release/release-list-item.html | 4 +- admin/static/admin.css | 5 +- admin/static/edit-release.css | 5 +- admin/static/edit-track.css | 146 ++++-------------- admin/static/index.css | 95 +----------- admin/static/release-list-item.css | 87 +++++++++++ admin/templates.go | 4 +- admin/views/edit-release.html | 6 +- admin/views/edit-track.html | 8 +- api/release.go | 1 - public/style/main.css | 5 +- public/style/music-gateway.css | 7 + views/music-gateway.html | 16 +- 13 files changed, 148 insertions(+), 241 deletions(-) create mode 100644 admin/static/release-list-item.css diff --git a/admin/components/release/release-list-item.html b/admin/components/release/release-list-item.html index 44511d8..3a17ad5 100644 --- a/admin/components/release/release-list-item.html +++ b/admin/components/release/release-list-item.html @@ -7,7 +7,7 @@

{{.Title}} - {{.GetReleaseYear}} + {{.GetReleaseYear}} {{if not .Visible}}(hidden){{end}}

@@ -16,7 +16,7 @@ ({{len .Tracks}} track{{if not (eq (len .Tracks) 1)}}s{{end}})

Edit - Gateway + Gateway
diff --git a/admin/static/admin.css b/admin/static/admin.css index 9092980..0d1269c 100644 --- a/admin/static/admin.css +++ b/admin/static/admin.css @@ -80,9 +80,8 @@ a:hover { text-decoration: underline; } -a img { - height: .9em; - transform: translateY(.1em); +a img.icon { + height: .8em; } .card { diff --git a/admin/static/edit-release.css b/admin/static/edit-release.css index 7321424..e11c562 100644 --- a/admin/static/edit-release.css +++ b/admin/static/edit-release.css @@ -50,6 +50,7 @@ input[type="text"] { border: 1px solid transparent; background: transparent; outline: none; + cursor: pointer; } #title:hover { @@ -80,7 +81,9 @@ input[type="text"] { vertical-align: top; opacity: .66; } -.release-info table tr td:not(:first-child):hover { +.release-info table tr td:not(:first-child) select:hover, +.release-info table tr td:not(:first-child) input:hover, +.release-info table tr td:not(:first-child) textarea:hover { background: #e8e8e8; cursor: pointer; } diff --git a/admin/static/edit-track.css b/admin/static/edit-track.css index 9d60619..ed359ae 100644 --- a/admin/static/edit-track.css +++ b/admin/static/edit-track.css @@ -1,3 +1,5 @@ +@import url("/admin/static/release-list-item.css"); + h1 { margin: 0 0 .5em 0; } @@ -22,8 +24,8 @@ h1 { flex-direction: column; } -.track-title-header { - margin: 0; +.attribute-header { + margin: 1em 0 .2em 0; opacity: .5; } @@ -33,45 +35,36 @@ h1 { #title { width: 100%; - margin: -.1em -.2em; padding: .1em .2em; - font-weight: bold; - font-size: inherit; - border-radius: 4px; - border: 1px solid transparent; - background: transparent; - outline: none; -} - -#title:hover { - background: #ffffff; - border-color: #80808080; -} - -#title:active, -#title:focus { - background: #ffffff; - border-color: #808080; -} - -.track-title small { - opacity: .75; -} - -.track-info h2 { - margin-bottom: .4em; } .track-info textarea { - width: 100%; + width: calc(100% - 1em); padding: .5em; + resize: vertical; +} + +.track-info input[type="text"], +.track-info textarea { + font-weight: inherit; font-family: inherit; font-size: inherit; - color: inherit; - border: none; - outline: none; - resize: vertical; + border: 1px solid transparent; border-radius: 4px; + outline: none; + color: inherit; +} + +.track-info input[type="text"]:hover, +.track-info textarea:hover { + border-color: #80808080; +} + +.track-info input[type="text"]:active, +.track-info textarea:active, +.track-info input[type="text"]:focus, +.track-info textarea:focus { + border-color: #808080; } button, .button { @@ -130,90 +123,3 @@ a.delete { justify-content: right; } -.release { - margin-bottom: 1em; - padding: 1em; - display: flex; - flex-direction: row; - gap: 1em; - - border-radius: .5em; - background: #f8f8f8f8; - border: 1px solid #808080; -} - -.release h3, -.release p { - margin: 0; -} - -.release-artwork { - width: 96px; - - display: flex; - justify-content: center; - align-items: center; -} - -.release-artwork img { - width: 100%; - aspect-ratio: 1; -} - -.release-title small { - opacity: .75; -} - -.release-links { - margin: .5em 0; - padding: 0; - display: flex; - flex-direction: row; - list-style: none; - flex-wrap: wrap; - gap: .5em; -} - -.release-links li { - flex-grow: 1; -} - -.release-links a { - padding: .5em; - display: block; - - border-radius: .5em; - text-decoration: none; - color: #f0f0f0; - background: #303030; - text-align: center; - - transition: color .1s, background .1s; -} - -.release-links a:hover { - color: #303030; - background: #f0f0f0; -} - -.release-actions { - margin-top: .5em; -} - -.release-actions a { - margin-right: .3em; - padding: .3em .5em; - display: inline-block; - - border-radius: .3em; - background: #e0e0e0; - - transition: color .1s, background .1s; -} - -.release-actions a:hover { - color: #303030; - background: #f0f0f0; - - text-decoration: none; -} diff --git a/admin/static/index.css b/admin/static/index.css index fd603a3..ec426af 100644 --- a/admin/static/index.css +++ b/admin/static/index.css @@ -1,3 +1,5 @@ +@import url("/admin/static/release-list-item.css"); + .create-btn { background: #c4ff6a; padding: .5em .8em; @@ -16,99 +18,6 @@ text-decoration: inherit; } -.release { - margin-bottom: 1em; - padding: 1em; - display: flex; - flex-direction: row; - gap: 1em; - - border-radius: .5em; - background: #f8f8f8f8; - border: 1px solid #808080; -} - -.release h3, -.release p { - margin: 0; -} - -.release-artwork { - width: 96px; - - display: flex; - justify-content: center; - align-items: center; -} - -.release-artwork img { - width: 100%; - aspect-ratio: 1; -} - -.latest-release .release-info { - width: 300px; - flex-direction: column; -} - -.release-title small { - opacity: .75; -} - -.release-links { - margin: .5em 0; - padding: 0; - display: flex; - flex-direction: row; - list-style: none; - flex-wrap: wrap; - gap: .5em; -} - -.release-links li { - flex-grow: 1; -} - -.release-links a { - padding: .5em; - display: block; - - border-radius: .5em; - text-decoration: none; - color: #f0f0f0; - background: #303030; - text-align: center; - - transition: color .1s, background .1s; -} - -.release-links a:hover { - color: #303030; - background: #f0f0f0; -} - -.release-actions { - margin-top: .5em; -} - -.release-actions a { - margin-right: .3em; - padding: .3em .5em; - display: inline-block; - - border-radius: .3em; - background: #e0e0e0; - - transition: color .1s, background .1s; -} - -.release-actions a:hover { - color: #303030; - background: #f0f0f0; - - text-decoration: none; -} - .artist { margin-bottom: .5em; padding: .5em; diff --git a/admin/static/release-list-item.css b/admin/static/release-list-item.css new file mode 100644 index 0000000..ee67de7 --- /dev/null +++ b/admin/static/release-list-item.css @@ -0,0 +1,87 @@ +.release { + margin-bottom: 1em; + padding: 1em; + display: flex; + flex-direction: row; + gap: 1em; + + border-radius: .5em; + background: #f8f8f8f8; + border: 1px solid #808080; +} + +.release h3, +.release p { + margin: 0; +} + +.release-artwork { + width: 96px; + + display: flex; + justify-content: center; + align-items: center; +} + +.release-artwork img { + width: 100%; + aspect-ratio: 1; +} + +.release-title small { + opacity: .75; +} + +.release-links { + margin: .5em 0; + padding: 0; + display: flex; + flex-direction: row; + list-style: none; + flex-wrap: wrap; + gap: .5em; +} + +.release-links li { + flex-grow: 1; +} + +.release-links a { + padding: .5em; + display: block; + + border-radius: .5em; + text-decoration: none; + color: #f0f0f0; + background: #303030; + text-align: center; + + transition: color .1s, background .1s; +} + +.release-links a:hover { + color: #303030; + background: #f0f0f0; +} + +.release-actions { + margin-top: .5em; +} + +.release-actions a { + margin-right: .3em; + padding: .3em .5em; + display: inline-block; + + border-radius: .3em; + background: #e0e0e0; + + transition: color .1s, background .1s; +} + +.release-actions a:hover { + color: #303030; + background: #f0f0f0; + + text-decoration: none; +} diff --git a/admin/templates.go b/admin/templates.go index ea7aaaa..af69aba 100644 --- a/admin/templates.go +++ b/admin/templates.go @@ -44,7 +44,7 @@ var components = map[string]*template.Template{ "editlinks": template.Must(template.ParseFiles(filepath.Join("admin", "components", "links", "editlinks.html"))), - "edittracks": template.Must(template.ParseFiles(filepath.Join("admin", "components", "tracks", "addtrack.html"))), + "edittracks": template.Must(template.ParseFiles(filepath.Join("admin", "components", "tracks", "edittracks.html"))), "addtrack": template.Must(template.ParseFiles(filepath.Join("admin", "components", "tracks", "addtrack.html"))), - "newtrack": template.Must(template.ParseFiles(filepath.Join("admin", "components", "tracks", "addtrack.html"))), + "newtrack": template.Must(template.ParseFiles(filepath.Join("admin", "components", "tracks", "newtrack.html"))), } diff --git a/admin/views/edit-release.html b/admin/views/edit-release.html index 3f7c12a..5a9b4f0 100644 --- a/admin/views/edit-release.html +++ b/admin/views/edit-release.html @@ -45,7 +45,7 @@ name="Description" value="{{.Description}}" placeholder="No description provided." - rows="1" + rows="3" id="description" >{{.Description}} @@ -79,7 +79,7 @@
- Gateway + Gateway
@@ -125,7 +125,7 @@ diff --git a/admin/views/edit-track.html b/admin/views/edit-track.html index 6d72dc1..c8b99d0 100644 --- a/admin/views/edit-track.html +++ b/admin/views/edit-track.html @@ -6,16 +6,16 @@ {{define "content"}}
-

Editing Track "{{.Title}}"

+

Editing Track

-

Title

+

Title

-

Description

+

Description

-

Lyrics

+

Lyrics