From 827f5241072b847073e0bc71cc8450b8b7dc0d9b Mon Sep 17 00:00:00 2001 From: esefxdz Date: Wed, 23 Sep 2026 17:21:50 +0300 Subject: [PATCH] website is now phone --- AGENTS.md | 1 + generate_thumbnails.py | 25 +++----- index.html | 37 ++++++------ js/bucketlist.js | 23 ++----- js/calendar.js | 12 ++-- js/comments.js | 24 +++----- js/gallery.js | 8 +-- js/tabs.js | 49 ++++++++++----- js/yuukabot.js | 12 ++-- style/bucketlist.css | 27 ++++++--- style/calendar.css | 27 +++++++-- style/comments.css | 51 +++++++++++----- style/gallery.css | 15 ++++- style/services.css | 33 +++++++--- style/styles.css | 133 ++++++++++++++++++++++++++++++++++++++--- style/yuukabot.css | 57 +++++++++++------- 16 files changed, 359 insertions(+), 175 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c705ee3..bfb5e47 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,6 +53,7 @@ There are **no automated tests** in this project. ## Coding Style & Naming Conventions - **HTML:** Semantic elements where practical. Tab contents use `
`. IDs are kebab-case. +- **Responsive:** modelled on userevolt.app. `styles.css` owns the breakpoints: ≤1300px tightens the nav buttons, ≤900px switches to a 56px bar with a hamburger dropdown (`#nav-hamburger`, `.nav-open` on `#top-line`, handled in `tabs.js`). Each tab stylesheet ends with its own `@media (max-width: 900px)` block (top offsets drop from ~120px to ~72px there). Tab buttons live in `#nav-tabs`, so style them as `#nav-tabs button`. - **CSS:** Each tab has its own stylesheet under `style/`. Class names follow BEM-lite (`cal-day`, `dash-card`). CSS variables define layout knobs (`--dash-columns`, `--dash-gap`). - **JavaScript:** Vanilla ES6+, no transpilation. Functions are `camelCase`, DOM-referencing IDs match kebab-case HTML IDs. Each script is self-contained with a `DOMContentLoaded` guard, and Firestore-backed scripts are wrapped in an IIFE so their helpers don't leak into (and clobber each other in) the global scope. Firebase config is repeated per-file (same values) — keep this pattern. - **Whitespace:** 4-space indentation in JS/CSS, 2-space in HTML. No trailing semicolons are required but consistency within each file is expected. diff --git a/generate_thumbnails.py b/generate_thumbnails.py index ebc1c9f..748fc96 100644 --- a/generate_thumbnails.py +++ b/generate_thumbnails.py @@ -1,14 +1,5 @@ -"""Build gallery thumbnails + manifest. - -Run after adding images to gallery/: - python generate_thumbnails.py - -- Converts animated GIFs to MP4 (needs ffmpeg on PATH). Same animation at a - few % of the size; the GIF stays as the source but the site uses the MP4. -- Creates gallery/thumbnails/.jpg (max 400x400) for any item missing one. -- Rewrites gallery/manifest.json: the ordered list of full-size filenames - that js/gallery.js renders (the MP4 wins when a GIF has one). -""" +# run this after adding images to gallery/ +# makes thumbnails, turns gifs into way smaller mp4s (needs ffmpeg) and updates manifest.json import json import os import shutil @@ -23,7 +14,7 @@ FFMPEG = shutil.which("ffmpeg") def sort_key(filename): - # Numeric names sort numerically (1, 2, ..., 10), anything else after, alphabetically + # so 10.jpg comes after 9.jpg stem = os.path.splitext(filename)[0] return (0, int(stem), "") if stem.isdigit() else (1, 0, stem.lower()) @@ -48,10 +39,10 @@ def convert_gifs(base_folder): continue with Image.open(src) as img: if getattr(img, "n_frames", 1) < 2: - continue # still image, keep as GIF + continue # not animated subprocess.run([ FFMPEG, "-hide_banner", "-loglevel", "error", "-y", "-i", src, - "-vf", "scale=trunc(iw/2)*2:trunc(ih/2)*2", # h264 needs even sizes + "-vf", "scale=trunc(iw/2)*2:trunc(ih/2)*2", # mp4 needs even width/height "-c:v", "libx264", "-crf", "23", "-pix_fmt", "yuv420p", "-an", "-movflags", "+faststart", dst, ], check=True) @@ -69,10 +60,9 @@ def make_thumbnail(src, thumb_path): ], check=True) return with Image.open(src) as img: - # JPEG needs RGB (e.g. for RGBA PNGs or palette GIFs) if img.mode != "RGB": img = img.convert("RGB") - img.thumbnail(THUMB_SIZE) # keeps aspect ratio + img.thumbnail(THUMB_SIZE) img.save(thumb_path, "JPEG", quality=85) @@ -82,7 +72,6 @@ def create_thumbnails(base_folder, files): count = 0 for filename in files: - # Always save thumbnail as jpg stem = os.path.splitext(filename)[0] thumb_path = os.path.join(thumb_dir, f"{stem}.jpg") if os.path.exists(thumb_path): @@ -98,7 +87,7 @@ def create_thumbnails(base_folder, files): def pick_for_site(files): - # One entry per name; prefer the MP4 over its source GIF + # use the mp4 instead of the gif when both exist chosen = {} for f in files: stem, ext = os.path.splitext(f) diff --git a/index.html b/index.html index 77a24d6..b304101 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ + @@ -28,17 +29,22 @@
- - - - - - + + +
-
Click Me! @@ -52,20 +58,17 @@
- +
-
COMMENTS
-

Leave a comment:

-
Avatar: @@ -101,10 +104,8 @@
-
-
@@ -122,7 +123,6 @@
-
Uptime

—

@@ -142,7 +142,6 @@ 1m / 5m / 15m
-
Network

—

@@ -162,7 +161,6 @@
-
CPU

—

@@ -179,7 +177,6 @@
-
System Info
—
@@ -213,7 +210,7 @@
- +
@@ -225,7 +222,7 @@
- +