aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--controllers/pages.go4
-rw-r--r--static/banner/1.pngbin0 -> 2404 bytes
-rw-r--r--static/banner/10.pngbin0 -> 4709 bytes
-rw-r--r--static/banner/11.pngbin0 -> 2578 bytes
-rw-r--r--static/banner/12.pngbin0 -> 4359 bytes
-rw-r--r--static/banner/2.pngbin0 -> 2339 bytes
-rw-r--r--static/banner/3.pngbin0 -> 4248 bytes
-rw-r--r--static/banner/4.pngbin0 -> 3869 bytes
-rw-r--r--static/banner/5.pngbin0 -> 3995 bytes
-rw-r--r--static/banner/6.pngbin0 -> 2738 bytes
-rw-r--r--static/banner/7.pngbin0 -> 3487 bytes
-rw-r--r--static/banner/8.pngbin0 -> 2588 bytes
-rw-r--r--static/banner/9.pngbin0 -> 2550 bytes
-rw-r--r--static/style.css5
-rw-r--r--views/index.html1
-rw-r--r--views/thread.html1
16 files changed, 11 insertions, 0 deletions
diff --git a/controllers/pages.go b/controllers/pages.go
index fd87570..cb1b82b 100644
--- a/controllers/pages.go
+++ b/controllers/pages.go
@@ -5,9 +5,11 @@ import (
"paperchan.club/models"
"github.com/gofiber/fiber/v2"
"log"
+ "math/rand"
)
const maxThreadsPerPage = 24
+const maxBanner = 12 // dont forget to increment whenever we add more
func ThreadList(c *fiber.Ctx) error {
db := database.DB
@@ -35,6 +37,7 @@ func ThreadList(c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
"posts": threads,
"pages": pages,
+ "banner": rand.Intn(maxBanner)+1,
})
}
@@ -49,5 +52,6 @@ func Thread(c *fiber.Ctx) error {
return c.Render("thread", fiber.Map{
"threadId": id,
"posts": posts,
+ "banner": rand.Intn(maxBanner)+1,
})
}
diff --git a/static/banner/1.png b/static/banner/1.png
new file mode 100644
index 0000000..5a2eb50
--- /dev/null
+++ b/static/banner/1.png
Binary files differ
diff --git a/static/banner/10.png b/static/banner/10.png
new file mode 100644
index 0000000..cd945b0
--- /dev/null
+++ b/static/banner/10.png
Binary files differ
diff --git a/static/banner/11.png b/static/banner/11.png
new file mode 100644
index 0000000..815ff3c
--- /dev/null
+++ b/static/banner/11.png
Binary files differ
diff --git a/static/banner/12.png b/static/banner/12.png
new file mode 100644
index 0000000..900a298
--- /dev/null
+++ b/static/banner/12.png
Binary files differ
diff --git a/static/banner/2.png b/static/banner/2.png
new file mode 100644
index 0000000..a76328f
--- /dev/null
+++ b/static/banner/2.png
Binary files differ
diff --git a/static/banner/3.png b/static/banner/3.png
new file mode 100644
index 0000000..85a495e
--- /dev/null
+++ b/static/banner/3.png
Binary files differ
diff --git a/static/banner/4.png b/static/banner/4.png
new file mode 100644
index 0000000..133e2b5
--- /dev/null
+++ b/static/banner/4.png
Binary files differ
diff --git a/static/banner/5.png b/static/banner/5.png
new file mode 100644
index 0000000..bc3c752
--- /dev/null
+++ b/static/banner/5.png
Binary files differ
diff --git a/static/banner/6.png b/static/banner/6.png
new file mode 100644
index 0000000..fffefa6
--- /dev/null
+++ b/static/banner/6.png
Binary files differ
diff --git a/static/banner/7.png b/static/banner/7.png
new file mode 100644
index 0000000..33ec724
--- /dev/null
+++ b/static/banner/7.png
Binary files differ
diff --git a/static/banner/8.png b/static/banner/8.png
new file mode 100644
index 0000000..432344d
--- /dev/null
+++ b/static/banner/8.png
Binary files differ
diff --git a/static/banner/9.png b/static/banner/9.png
new file mode 100644
index 0000000..f8a7e7a
--- /dev/null
+++ b/static/banner/9.png
Binary files differ
diff --git a/static/style.css b/static/style.css
index e82190c..419c3b6 100644
--- a/static/style.css
+++ b/static/style.css
@@ -15,6 +15,11 @@ h1 {
text-align: center;
}
+.banner {
+ display: block;
+ margin: auto;
+}
+
.threadlist {
display: flex;
flex-wrap: wrap;
diff --git a/views/index.html b/views/index.html
index 34a6f55..3f3e089 100644
--- a/views/index.html
+++ b/views/index.html
@@ -9,6 +9,7 @@
<body>
<main>
+ <img src="/banner/{{.banner}}.png" alt="Paperchan banner" class="banner" />
<h1>Paperchan.club</h1>
<section class="threadlist">
{{ range .posts }}
diff --git a/views/thread.html b/views/thread.html
index 0611c26..7983d9e 100644
--- a/views/thread.html
+++ b/views/thread.html
@@ -9,6 +9,7 @@
<body>
<main>
+ <a href="/"><img src="/banner/{{.banner}}.png" alt="Paperchan banner" class="banner" /></a>
<h1>Paperchan.club</h1>
<p><a href="/">Home</a></p>
<section class="thread">