UI improvements

This commit is contained in:
ari melody 2024-08-31 19:29:57 +01:00
parent dc0837bfee
commit 1998a36d6d
Signed by: ari
GPG key ID: CF99829C92678188
13 changed files with 148 additions and 241 deletions

View file

@ -7,7 +7,7 @@
<h3 class="release-title"> <h3 class="release-title">
<a href="/admin/release/{{.ID}}">{{.Title}}</a> <a href="/admin/release/{{.ID}}">{{.Title}}</a>
<small> <small>
{{.GetReleaseYear}} <span title="{{.PrintReleaseDate}}">{{.GetReleaseYear}}</span>
{{if not .Visible}}(hidden){{end}} {{if not .Visible}}(hidden){{end}}
</small> </small>
</h3> </h3>
@ -16,7 +16,7 @@
(<a href="/admin/release/{{.ID}}#tracks">{{len .Tracks}} track{{if not (eq (len .Tracks) 1)}}s{{end}}</a>)</p> (<a href="/admin/release/{{.ID}}#tracks">{{len .Tracks}} track{{if not (eq (len .Tracks) 1)}}s{{end}}</a>)</p>
<div class="release-actions"> <div class="release-actions">
<a href="/admin/release/{{.ID}}">Edit</a> <a href="/admin/release/{{.ID}}">Edit</a>
<a href="/music/{{.ID}}" target="_blank">Gateway</a> <a href="/music/{{.ID}}" target="_blank">Gateway <img class="icon" src="/img/external-link.svg"/></a>
</div> </div>
</div> </div>
</div> </div>

View file

@ -80,9 +80,8 @@ a:hover {
text-decoration: underline; text-decoration: underline;
} }
a img { a img.icon {
height: .9em; height: .8em;
transform: translateY(.1em);
} }
.card { .card {

View file

@ -50,6 +50,7 @@ input[type="text"] {
border: 1px solid transparent; border: 1px solid transparent;
background: transparent; background: transparent;
outline: none; outline: none;
cursor: pointer;
} }
#title:hover { #title:hover {
@ -80,7 +81,9 @@ input[type="text"] {
vertical-align: top; vertical-align: top;
opacity: .66; 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; background: #e8e8e8;
cursor: pointer; cursor: pointer;
} }

View file

@ -1,3 +1,5 @@
@import url("/admin/static/release-list-item.css");
h1 { h1 {
margin: 0 0 .5em 0; margin: 0 0 .5em 0;
} }
@ -22,8 +24,8 @@ h1 {
flex-direction: column; flex-direction: column;
} }
.track-title-header { .attribute-header {
margin: 0; margin: 1em 0 .2em 0;
opacity: .5; opacity: .5;
} }
@ -33,45 +35,36 @@ h1 {
#title { #title {
width: 100%; width: 100%;
margin: -.1em -.2em;
padding: .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 { .track-info textarea {
width: 100%; width: calc(100% - 1em);
padding: .5em; padding: .5em;
resize: vertical;
}
.track-info input[type="text"],
.track-info textarea {
font-weight: inherit;
font-family: inherit; font-family: inherit;
font-size: inherit; font-size: inherit;
color: inherit; border: 1px solid transparent;
border: none;
outline: none;
resize: vertical;
border-radius: 4px; 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 { button, .button {
@ -130,90 +123,3 @@ a.delete {
justify-content: right; 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;
}

View file

@ -1,3 +1,5 @@
@import url("/admin/static/release-list-item.css");
.create-btn { .create-btn {
background: #c4ff6a; background: #c4ff6a;
padding: .5em .8em; padding: .5em .8em;
@ -16,99 +18,6 @@
text-decoration: inherit; 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 { .artist {
margin-bottom: .5em; margin-bottom: .5em;
padding: .5em; padding: .5em;

View file

@ -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;
}

View file

@ -44,7 +44,7 @@ var components = map[string]*template.Template{
"editlinks": template.Must(template.ParseFiles(filepath.Join("admin", "components", "links", "editlinks.html"))), "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"))), "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"))),
} }

View file

@ -45,7 +45,7 @@
name="Description" name="Description"
value="{{.Description}}" value="{{.Description}}"
placeholder="No description provided." placeholder="No description provided."
rows="1" rows="3"
id="description" id="description"
>{{.Description}}</textarea> >{{.Description}}</textarea>
</td> </td>
@ -79,7 +79,7 @@
</tr> </tr>
</table> </table>
<div class="release-actions"> <div class="release-actions">
<a href="/music/{{.ID}}" class="button" target="_blank">Gateway <img src="/img/external-link.svg"/></a> <a href="/music/{{.ID}}" class="button" target="_blank">Gateway <img class="icon" src="/img/external-link.svg"/></a>
<button type="submit" class="save" id="save" disabled>Save</button> <button type="submit" class="save" id="save" disabled>Save</button>
</div> </div>
</div> </div>
@ -125,7 +125,7 @@
</div> </div>
<div class="card links"> <div class="card links">
{{range .Links}} {{range .Links}}
<a href="{{.URL}}" target="_blank" class="button" data-name="{{.Name}}">{{.Name}} <img src="/img/external-link.svg"/></a> <a href="{{.URL}}" target="_blank" class="button" data-name="{{.Name}}">{{.Name}} <img class="icon" src="/img/external-link.svg"/></a>
{{end}} {{end}}
</div> </div>

View file

@ -6,16 +6,16 @@
{{define "content"}} {{define "content"}}
<main> <main>
<h1>Editing Track "{{.Title}}"</h1> <h1>Editing Track</h1>
<div id="track" data-id="{{.ID}}"> <div id="track" data-id="{{.ID}}">
<div class="track-info"> <div class="track-info">
<p class="track-title-header">Title</p> <p class="attribute-header">Title</p>
<h2 class="track-title"> <h2 class="track-title">
<input type="text" id="title" name="Title" value="{{.Title}}"> <input type="text" id="title" name="Title" value="{{.Title}}">
</h2> </h2>
<h2>Description</h2> <p class="attribute-header">Description</p>
<textarea <textarea
name="Description" name="Description"
value="{{.Description}}" value="{{.Description}}"
@ -24,7 +24,7 @@
id="description" id="description"
>{{.Description}}</textarea> >{{.Description}}</textarea>
<h2>Lyrics</h2> <p class="attribute-header">Lyrics</p>
<textarea <textarea
name="Lyrics" name="Lyrics"
value="{{.Lyrics}}" value="{{.Lyrics}}"

View file

@ -256,7 +256,6 @@ func UpdateRelease() http.Handler {
fmt.Printf("WARN: Error while cleaning up artwork files: %s\n", err) fmt.Printf("WARN: Error while cleaning up artwork files: %s\n", err)
} }
fmt.Printf("Artwork for %s updated.\n", update.ID)
update.Artwork = fmt.Sprintf("/uploads/musicart/%s.%s", update.ID, ext) update.Artwork = fmt.Sprintf("/uploads/musicart/%s.%s", update.ID, ext)
} else { } else {
update.Artwork = *data.Artwork update.Artwork = *data.Artwork

View file

@ -55,9 +55,8 @@ a.link-button:hover {
box-shadow: 0 0 1em var(--links); box-shadow: 0 0 1em var(--links);
} }
a img { a img.icon {
height: .9em; height: .8em;
transform: translateY(.1em);
} }
small { small {

View file

@ -390,6 +390,13 @@ ul#links a:hover {
animation: share-after 2s cubic-bezier(.5,0,1,.5) forwards animation: share-after 2s cubic-bezier(.5,0,1,.5) forwards
} }
h2 {
width: fit-content;
padding: .3em 1em;
font-size: 1em;
background: #101010;
}
div#extras ul { div#extras ul {
height: 100%; height: 100%;
display: flex; display: flex;

View file

@ -80,19 +80,17 @@
</ul> </ul>
{{end}} {{end}}
{{if .IsSingle}} {{if .Description}}
<p id="description">{{.Description}}</p>
{{else if .IsSingle}}
{{$Track := index .Tracks 0}} {{$Track := index .Tracks 0}}
{{if $Track.Description}} {{if $Track.Description}}
<p id="description">{{$Track.Description}}</p> <p id="description">{{$Track.Description}}</p>
{{end}} {{end}}
{{else}}
{{if .Description}}<p id="description">{{.Description}}
</p>
{{end}}
{{end}} {{end}}
<button id="share">share</button> <button id="share">share</button>
@ -102,7 +100,7 @@
{{if .Credits}} {{if .Credits}}
<div id="credits"> <div id="credits">
<h2>credits:</h2> <h2>CREDITS</h2>
<ul> <ul>
{{range .Credits}} {{range .Credits}}
{{$Artist := .Artist}} {{$Artist := .Artist}}
@ -132,7 +130,7 @@
{{else if .Tracks}} {{else if .Tracks}}
<div id="tracks"> <div id="tracks">
<h2>tracks:</h2> <h2>TRACKS</h2>
{{range $i, $track := .Tracks}} {{range $i, $track := .Tracks}}
<details> <details>
<summary class="album-track-title">{{$track.Number}}. {{$track.Title}}</summary> <summary class="album-track-title">{{$track.Number}}. {{$track.Title}}</summary>