From 48bdd1174ec0cc76c471fb2727db9c10a542ec7f Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 1 Mar 2026 11:14:45 +0000 Subject: [PATCH] Update template to support showing top 5 for each category Signed-off-by: Marcus Noble --- templates/index.html | 131 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/templates/index.html b/templates/index.html index 048e9c4..6f4d7a3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -43,6 +43,35 @@ padding: 6px; } + .modal { + display: none; + position: absolute; + top: 25%; + left: 25%; + height: 430px; + width: 50%; + border: 1px solid #ccc; + border-radius: 5px; + background-color: #f9f9f9; + box-shadow: 2px 2px 2px #ccc; + padding: 4px; + } + .modal.show { + display: block; + } + .modal .books { + display: flex; + flex-direction: row; + width: 100%; + height: 400px; + overflow-x: scroll; + } + .modal .books div { + margin: 6px; + display: flex; + flex-direction: column; + } + main > .category:nth-of-type(1), main > .category:nth-of-type(2), main > .category:nth-of-type(3) { @@ -59,6 +88,10 @@ main > .category:nth-of-type(3) { grid-column: span 2; } + + .modal .books { + flex-direction: column; + } } @@ -86,7 +119,29 @@ {{ $book.Name }}
⭐ {{ $book.Rating }}
+ + + {{ $cat := "Non-Fiction" }} {{ $book := index (index .Books $cat) 0 }}
@@ -96,7 +151,29 @@ {{ $book.Name }}
⭐ {{ $book.Rating }}
+ +
+ {{ $cat := "Comics" }} {{ $book := index (index .Books $cat) 0 }}
@@ -106,6 +183,27 @@ {{ $book.Name }}
⭐ {{ $book.Rating }}
+ +
{{ range $cat, $Books := .Books }} @@ -120,9 +218,42 @@ {{ $book.Name }}
⭐ {{ $book.Rating }}
+ + {{ end }} + + {{ else }}

Still loading book recommendations...