diff options
author | vulonkaaz <7442677+vulonkaaz@users.noreply.github.com> | 2025-05-31 13:54:49 +0200 |
---|---|---|
committer | vulonkaaz <7442677+vulonkaaz@users.noreply.github.com> | 2025-05-31 13:54:49 +0200 |
commit | 767c21188b3ca0cebda5a05a78eff0f72105256d (patch) | |
tree | dddcabdd90665a334ca8eeb8ef91c64a4a98842f | |
parent | 148baefc06c1558776928dd635394dbfdad63da7 (diff) |
-rw-r--r-- | controllers/pages.go | 4 | ||||
-rw-r--r-- | static/banner/1.png | bin | 0 -> 2404 bytes | |||
-rw-r--r-- | static/banner/10.png | bin | 0 -> 4709 bytes | |||
-rw-r--r-- | static/banner/11.png | bin | 0 -> 2578 bytes | |||
-rw-r--r-- | static/banner/12.png | bin | 0 -> 4359 bytes | |||
-rw-r--r-- | static/banner/2.png | bin | 0 -> 2339 bytes | |||
-rw-r--r-- | static/banner/3.png | bin | 0 -> 4248 bytes | |||
-rw-r--r-- | static/banner/4.png | bin | 0 -> 3869 bytes | |||
-rw-r--r-- | static/banner/5.png | bin | 0 -> 3995 bytes | |||
-rw-r--r-- | static/banner/6.png | bin | 0 -> 2738 bytes | |||
-rw-r--r-- | static/banner/7.png | bin | 0 -> 3487 bytes | |||
-rw-r--r-- | static/banner/8.png | bin | 0 -> 2588 bytes | |||
-rw-r--r-- | static/banner/9.png | bin | 0 -> 2550 bytes | |||
-rw-r--r-- | static/style.css | 5 | ||||
-rw-r--r-- | views/index.html | 1 | ||||
-rw-r--r-- | views/thread.html | 1 |
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 Binary files differnew file mode 100644 index 0000000..5a2eb50 --- /dev/null +++ b/static/banner/1.png diff --git a/static/banner/10.png b/static/banner/10.png Binary files differnew file mode 100644 index 0000000..cd945b0 --- /dev/null +++ b/static/banner/10.png diff --git a/static/banner/11.png b/static/banner/11.png Binary files differnew file mode 100644 index 0000000..815ff3c --- /dev/null +++ b/static/banner/11.png diff --git a/static/banner/12.png b/static/banner/12.png Binary files differnew file mode 100644 index 0000000..900a298 --- /dev/null +++ b/static/banner/12.png diff --git a/static/banner/2.png b/static/banner/2.png Binary files differnew file mode 100644 index 0000000..a76328f --- /dev/null +++ b/static/banner/2.png diff --git a/static/banner/3.png b/static/banner/3.png Binary files differnew file mode 100644 index 0000000..85a495e --- /dev/null +++ b/static/banner/3.png diff --git a/static/banner/4.png b/static/banner/4.png Binary files differnew file mode 100644 index 0000000..133e2b5 --- /dev/null +++ b/static/banner/4.png diff --git a/static/banner/5.png b/static/banner/5.png Binary files differnew file mode 100644 index 0000000..bc3c752 --- /dev/null +++ b/static/banner/5.png diff --git a/static/banner/6.png b/static/banner/6.png Binary files differnew file mode 100644 index 0000000..fffefa6 --- /dev/null +++ b/static/banner/6.png diff --git a/static/banner/7.png b/static/banner/7.png Binary files differnew file mode 100644 index 0000000..33ec724 --- /dev/null +++ b/static/banner/7.png diff --git a/static/banner/8.png b/static/banner/8.png Binary files differnew file mode 100644 index 0000000..432344d --- /dev/null +++ b/static/banner/8.png diff --git a/static/banner/9.png b/static/banner/9.png Binary files differnew file mode 100644 index 0000000..f8a7e7a --- /dev/null +++ b/static/banner/9.png 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"> |