
Paperchan.club

From 767c21188b3ca0cebda5a05a78eff0f72105256d Mon Sep 17 00:00:00 2001 From: vulonkaaz <7442677+vulonkaaz@users.noreply.github.com> Date: Sat, 31 May 2025 13:54:49 +0200 Subject: banner --- controllers/pages.go | 4 ++++ static/banner/1.png | Bin 0 -> 2404 bytes static/banner/10.png | Bin 0 -> 4709 bytes static/banner/11.png | Bin 0 -> 2578 bytes static/banner/12.png | Bin 0 -> 4359 bytes static/banner/2.png | Bin 0 -> 2339 bytes static/banner/3.png | Bin 0 -> 4248 bytes static/banner/4.png | Bin 0 -> 3869 bytes static/banner/5.png | Bin 0 -> 3995 bytes static/banner/6.png | Bin 0 -> 2738 bytes static/banner/7.png | Bin 0 -> 3487 bytes static/banner/8.png | Bin 0 -> 2588 bytes static/banner/9.png | Bin 0 -> 2550 bytes static/style.css | 5 +++++ views/index.html | 1 + views/thread.html | 1 + 16 files changed, 11 insertions(+) create mode 100644 static/banner/1.png create mode 100644 static/banner/10.png create mode 100644 static/banner/11.png create mode 100644 static/banner/12.png create mode 100644 static/banner/2.png create mode 100644 static/banner/3.png create mode 100644 static/banner/4.png create mode 100644 static/banner/5.png create mode 100644 static/banner/6.png create mode 100644 static/banner/7.png create mode 100644 static/banner/8.png create mode 100644 static/banner/9.png 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 Binary files /dev/null and b/static/banner/1.png differ diff --git a/static/banner/10.png b/static/banner/10.png new file mode 100644 index 0000000..cd945b0 Binary files /dev/null and b/static/banner/10.png differ diff --git a/static/banner/11.png b/static/banner/11.png new file mode 100644 index 0000000..815ff3c Binary files /dev/null and b/static/banner/11.png differ diff --git a/static/banner/12.png b/static/banner/12.png new file mode 100644 index 0000000..900a298 Binary files /dev/null and b/static/banner/12.png differ diff --git a/static/banner/2.png b/static/banner/2.png new file mode 100644 index 0000000..a76328f Binary files /dev/null and b/static/banner/2.png differ diff --git a/static/banner/3.png b/static/banner/3.png new file mode 100644 index 0000000..85a495e Binary files /dev/null and b/static/banner/3.png differ diff --git a/static/banner/4.png b/static/banner/4.png new file mode 100644 index 0000000..133e2b5 Binary files /dev/null and b/static/banner/4.png differ diff --git a/static/banner/5.png b/static/banner/5.png new file mode 100644 index 0000000..bc3c752 Binary files /dev/null and b/static/banner/5.png differ diff --git a/static/banner/6.png b/static/banner/6.png new file mode 100644 index 0000000..fffefa6 Binary files /dev/null and b/static/banner/6.png differ diff --git a/static/banner/7.png b/static/banner/7.png new file mode 100644 index 0000000..33ec724 Binary files /dev/null and b/static/banner/7.png differ diff --git a/static/banner/8.png b/static/banner/8.png new file mode 100644 index 0000000..432344d Binary files /dev/null and b/static/banner/8.png differ diff --git a/static/banner/9.png b/static/banner/9.png new file mode 100644 index 0000000..f8a7e7a Binary files /dev/null and b/static/banner/9.png 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 @@