style: more "kobo-native" appearance

This commit is contained in:
Evan Buss
2024-07-06 13:12:43 -04:00
parent 5b68923ba9
commit 4ba16c728d
5 changed files with 64 additions and 29 deletions

View File

@@ -15,11 +15,14 @@
<img src="/acquisition{{.ImageURL}}" alt="{{.Title}}" height="40">
{{end}}
{{if .IsDownload}}
<a href="/acquisition{{.Href}}" download>{{.Title}}</a>
{{else}}
<a href="{{.Href}}">{{.Title}}</a>
{{end}}
<div class="info">
{{if .IsDownload}}
<a href="/acquisition{{.Href}}" download>{{.Title}}</a>
{{else}}
<a href="{{.Href}}">{{.Title}}</a>
{{end}}
<p>{{.Author}}</p>
</div>
</li>
{{end}}
</ul>

View File

@@ -37,6 +37,7 @@ type NavigationViewModel struct {
type LinkViewModel struct {
Title string
Author string
ImageURL string
Content string
Href string
@@ -77,6 +78,12 @@ func constructLink(entry opds.Entry) LinkViewModel {
Content: entry.Content.Content,
}
authors := make([]string, 0)
for _, author := range entry.Author {
authors = append(authors, author.Name)
}
vm.Author = strings.Join(authors, ", ")
for _, link := range entry.Links {
if link.IsNavigation() || link.IsDownload() {
vm.Href = link.Href

View File

@@ -3,31 +3,11 @@
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
font-family: serif, sans-serif;
font-style: italic;
font-size: 1.25rem;
}
#container {
border: 1px solid rgba(0, 0, 0, 0.5);
min-width: 1200px;
}
#container > ul {
list-style-type: none;
}
#container > ul > li {
display: flex;
justify-content: start;
gap: 16px;
align-items: center;
padding: 0.5rem 1rem;
}
#container > ul > li:not(:last-child) {
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
body {
display: flex;
justify-content: center;
@@ -35,7 +15,47 @@ body {
min-height: 100vh;
}
a {
#container {
padding: 2rem;
border: 1px solid rgba(0, 0, 0, 0.5);
width: 100%;
}
#container > ul {
list-style-type: none;
}
#container > ul > li {
padding: 1rem 1rem;
display: block;
}
#container > ul > li > img {
display: inline-block;
height: 75px;
object-fit: cover;
margin-right: 1rem;
}
#container > ul > li > .info {
display: inline-block;
vertical-align: top;
}
.info > p {
font-size: 1rem;
}
#container > ul > li a {
display: inline-block;
text-decoration: none;
color: black;
vertical-align: top;
}
#container > ul > li a:active {
background-color: black;
}
#container > ul > li:not(:last-child) {
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}