neiam
/recourse
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
Visual mode fills the screen, as pin_flip's wide layout and cartosnap's share view do
4fe8b36 · gmorell · 2026-12-02 18:47
Message
{commit_body(@commit)}
Files changed
modified
templates/forum/_reader.html
+5
−3
@@ -8,7 +8,7 @@
| 8 | 8 | hx-get="{{ base }}" hx-target="#reader" hx-select="#reader" hx-swap="outerHTML" hx-push-url="true" |
| 9 | 9 | class="fixed inset-0 z-40 bg-neutral/70 backdrop-blur-sm"></a> |
| 10 | 10 | <div role="dialog" aria-modal="true" aria-labelledby="reader-title" data-reader="{{ reader.topic.id }}" |
| 11 | − class="fixed inset-x-0 bottom-0 top-0 z-50 mx-auto flex max-w-4xl flex-col bg-base-100 shadow-2xl sm:inset-y-4 sm:rounded-box"> | |
| 11 | + class="fixed inset-0 z-50 flex flex-col bg-base-100 shadow-2xl sm:inset-3 sm:rounded-box"> | |
| 12 | 12 | <header class="flex items-start gap-2 border-b border-base-300 p-3 sm:p-4"> |
| 13 | 13 | <div class="min-w-0 flex-1"> |
| 14 | 14 | <p class="text-xs opacity-60"> |
@@ -30,7 +30,8 @@
| 30 | 30 | class="btn btn-ghost btn-sm btn-square"><i class="fas fa-xmark"></i></a> |
| 31 | 31 | </header> |
| 32 | 32 | |
| 33 | − <div class="relative min-h-0 flex-1 overflow-y-auto p-3 sm:p-4 space-y-3" id="reader-posts"> | |
| 33 | + <div class="relative min-h-0 flex-1 overflow-y-auto p-3 sm:p-4" id="reader-posts"> | |
| 34 | + <div class="mx-auto max-w-4xl space-y-3"> | |
| 34 | 35 | {% for post in reader.posts %}{% include "forum/_post.html" %}{% endfor %} |
| 35 | 36 | <p class="text-center text-sm opacity-70"> |
| 36 | 37 | {% if reader.topic.is_closed %}This topic is closed. |
@@ -38,6 +39,7 @@
| 38 | 39 | {% elif user %}<a href="/profile#email-verification" class="link">Verify your email address to reply.</a> |
| 39 | 40 | {% else %}<a href="/login" class="link">Log in to reply.</a>{% endif %} |
| 40 | 41 | </p> |
| 42 | + </div> | |
| 41 | 43 | </div> |
| 42 | 44 | |
| 43 | 45 | <footer class="border-t border-base-300 p-2 sm:p-3 space-y-2"> |
@@ -60,7 +62,7 @@
| 60 | 62 | <a href="{{ base }}&topic={{ s.id }}" id="strip-{{ s.id }}" |
| 61 | 63 | hx-get="{{ base }}&topic={{ s.id }}" hx-target="#reader" hx-select="#reader" hx-swap="outerHTML" hx-push-url="true" |
| 62 | 64 | {% if s.current %}aria-current="true"{% endif %} aria-label="Topic {{ loop.index }}: {{ s.title }}" title="{{ s.title }}" |
| 63 | − class="relative flex size-14 flex-col justify-end overflow-hidden rounded-field border bg-base-200 p-1 text-[0.55rem] leading-tight transition {% if s.current %}-translate-y-1 border-primary ring-2 ring-primary ring-offset-2 ring-offset-base-100 shadow-md{% else %}border-base-300 opacity-70 hover:-translate-y-1 hover:opacity-100 focus-visible:opacity-100{% endif %}"> | |
| 65 | + class="relative flex size-16 flex-col justify-end overflow-hidden rounded-field border bg-base-200 p-1 text-[0.55rem] leading-tight transition {% if s.current %}-translate-y-1 border-primary ring-2 ring-primary ring-offset-2 ring-offset-base-100 shadow-md{% else %}border-base-300 opacity-70 hover:-translate-y-1 hover:opacity-100 focus-visible:opacity-100{% endif %}"> | |
| 64 | 66 | <span class="absolute inset-x-0 top-0 h-1" style="background: {{ s.widget_bg }}" aria-hidden="true"></span> |
| 65 | 67 | {% if s.unread %}<span class="absolute right-1 top-1.5 size-1.5 rounded-full bg-primary" aria-hidden="true"></span>{% endif %} |
| 66 | 68 | <span class="line-clamp-3">{{ s.title }}</span> |
modified
templates/forum/focus.html
+8
−7
@@ -2,9 +2,10 @@
| 2 | 2 | {# Visual mode for one category (src/handlers/focus.rs): a rail of the |
| 3 | 3 | categories beside it, its topics as tiles, each subcategory as a column of |
| 4 | 4 | compact squares, and the reader over it all when ?topic= is set. #} |
| 5 | −{% block width %}max-w-7xl{% endblock %} | |
| 5 | +{% block width %}w-full max-w-none{% endblock %} | |
| 6 | +{% block main_class %}px-3 py-3 sm:px-4 lg:px-5{% endblock %} | |
| 6 | 7 | {% block content %} |
| 7 | −<div class="space-y-4 text-left" id="focus" data-focus="{{ category.slug }}"> | |
| 8 | +<div class="flex min-h-[calc(100dvh-5.5rem)] flex-col gap-4 text-left" id="focus" data-focus="{{ category.slug }}"> | |
| 8 | 9 | <nav class="text-sm opacity-70" aria-label="Breadcrumb"> |
| 9 | 10 | <a href="/?view=focus" class="link link-hover">Categories</a> |
| 10 | 11 | {% for a in ancestors %} / <a href="{{ a.href }}" class="link link-hover">{{ a.name }}</a>{% endfor %} |
@@ -28,10 +29,10 @@
| 28 | 29 | </div> |
| 29 | 30 | </div> |
| 30 | 31 | |
| 31 | − <div class="flex flex-col gap-4 md:flex-row md:items-start"> | |
| 32 | + <div class="flex flex-1 flex-col gap-4 md:flex-row md:items-stretch"> | |
| 32 | 33 | {# The rail: a horizontal strip on small screens, a column beside the page from md up. #} |
| 33 | 34 | <nav id="focus-rail" aria-label="Other categories" |
| 34 | − class="flex shrink-0 gap-2 overflow-x-auto pb-1 md:sticky md:top-4 md:w-20 md:flex-col md:overflow-visible md:pb-0"> | |
| 35 | + class="flex shrink-0 gap-2 overflow-x-auto pb-1 md:sticky md:top-4 md:self-start md:max-h-[calc(100dvh-6rem)] md:overflow-y-auto md:w-20 md:flex-col md:pb-0"> | |
| 35 | 36 | <a id="focus-up" href="{{ up.href }}" title="Up to {{ up.name }}" aria-label="Up to {{ up.name }}" |
| 36 | 37 | class="flex aspect-square w-16 shrink-0 flex-col items-center justify-center rounded-box border border-base-300 bg-base-200 font-mono text-lg font-bold transition-all hover:-translate-y-0.5 hover:border-primary/60 focus-visible:outline-2 focus-visible:outline-primary md:w-full"> |
| 37 | 38 | .. |
@@ -69,7 +70,7 @@
| 69 | 70 | </div> |
| 70 | 71 | |
| 71 | 72 | {% if topics %} |
| 72 | − <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4"> | |
| 73 | + <div class="grid grid-cols-[repeat(auto-fill,minmax(17rem,1fr))] gap-3"> | |
| 73 | 74 | {% for t in topics %}{% include "forum/_topic_tile.html" %}{% endfor %} |
| 74 | 75 | </div> |
| 75 | 76 | {% elif not columns %} |
@@ -82,7 +83,7 @@
| 82 | 83 | {# In focus, subcategories sit side by side as columns (pin_flip). #} |
| 83 | 84 | <div class="flex items-start gap-4 overflow-x-auto pb-2"> |
| 84 | 85 | {% for col in columns %} |
| 85 | − <section id="focus-sub-{{ col.slug }}" class="w-56 shrink-0 space-y-2 rounded-box border border-base-300 bg-base-100 p-3" aria-label="{{ col.name }}"> | |
| 86 | + <section id="focus-sub-{{ col.slug }}" class="min-w-56 flex-1 basis-56 space-y-2 rounded-box border border-base-300 bg-base-100 p-3" aria-label="{{ col.name }}"> | |
| 86 | 87 | <a id="focus-link-{{ col.slug }}" href="{{ col.href }}" title="Focus on {{ col.name }}" aria-label="Focus on {{ col.name }}" |
| 87 | 88 | class="group flex items-center gap-1.5 text-sm font-semibold hover:text-primary focus-visible:outline-2 focus-visible:outline-primary rounded"> |
| 88 | 89 | <span class="size-4 shrink-0 rounded-full border border-base-content/20" style="background: {{ col.widget_bg }}" aria-hidden="true"></span> |
@@ -91,7 +92,7 @@
| 91 | 92 | <i class="fas fa-up-right-and-down-left-from-center ml-auto text-xs opacity-0 transition-opacity group-hover:opacity-60 group-focus-visible:opacity-60" aria-hidden="true"></i> |
| 92 | 93 | </a> |
| 93 | 94 | {% if col.topics %} |
| 94 | − <div class="grid grid-cols-3 gap-1.5"> | |
| 95 | + <div class="grid grid-cols-[repeat(auto-fill,minmax(4.5rem,1fr))] gap-1.5"> | |
| 95 | 96 | {% for t in col.topics %}{% set href = base ~ "&topic=" ~ t.id %}{% set reader_swap = true %}{% include "forum/_topic_square.html" %}{% endfor %} |
| 96 | 97 | </div> |
| 97 | 98 | {% if col.more %}<a href="{{ col.href }}" class="link link-hover text-xs opacity-70">+{{ col.more }} more</a>{% endif %} |
modified
templates/forum/home_visual.html
+4
−3
@@ -1,7 +1,8 @@
| 1 | 1 | {% extends "root.html" %} |
| 2 | 2 | {# Visual home: a tile per top-level category (src/handlers/focus.rs |
| 3 | 3 | home_focus). Each opens that category in focus; its squares open the reader. #} |
| 4 | −{% block width %}max-w-7xl{% endblock %} | |
| 4 | +{% block width %}w-full max-w-none{% endblock %} | |
| 5 | +{% block main_class %}px-3 py-3 sm:px-4 lg:px-5{% endblock %} | |
| 5 | 6 | {% block content %} |
| 6 | 7 | <div class="space-y-6 text-left"> |
| 7 | 8 | <div class="flex flex-wrap items-center justify-between gap-3"> |
@@ -18,7 +19,7 @@
| 18 | 19 | {% if not categories %} |
| 19 | 20 | <p class="opacity-70">No categories yet.</p> |
| 20 | 21 | {% else %} |
| 21 | − <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3"> | |
| 22 | + <div class="grid grid-cols-[repeat(auto-fill,minmax(22rem,1fr))] gap-4"> | |
| 22 | 23 | {% for c in categories %} |
| 23 | 24 | <section id="home-{{ c.slug }}" aria-label="{{ c.name }}" class="flex flex-col gap-3 rounded-box border border-base-300 bg-base-200 p-4"> |
| 24 | 25 | <a href="{{ c.href }}" id="focus-link-{{ c.slug }}" title="Focus on {{ c.name }}" aria-label="Focus on {{ c.name }}" |
@@ -41,7 +42,7 @@
| 41 | 42 | </div> |
| 42 | 43 | {% endif %} |
| 43 | 44 | {% if c.topics %} |
| 44 | − <div class="grid grid-cols-3 gap-1.5 sm:grid-cols-6 xl:grid-cols-3"> | |
| 45 | + <div class="grid grid-cols-[repeat(auto-fill,minmax(4.5rem,1fr))] gap-1.5"> | |
| 45 | 46 | {% for t in c.topics %}{% set href = c.href ~ "&topic=" ~ t.id %}{% set reader_swap = false %}{% include "forum/_topic_square.html" %}{% endfor %} |
| 46 | 47 | </div> |
| 47 | 48 | {% else %} |
modified
templates/root.html
+3
−1
@@ -132,7 +132,9 @@
| 132 | 132 | </div> |
| 133 | 133 | </header> |
| 134 | 134 | |
| 135 | −<main id="content" class="px-4 py-12 sm:px-6 lg:px-8"> | |
| 135 | +{# `main_class` and `width` let a page fill the viewport, as pin_flip's | |
| 136 | + Layouts.app `wide` does (visual mode). #} | |
| 137 | +<main id="content" class="{% block main_class %}px-4 py-12 sm:px-6 lg:px-8{% endblock %}"> | |
| 136 | 138 | {# Pages can widen the column (visual mode fills the page). #} |
| 137 | 139 | <div class="mx-auto {% block width %}max-w-3xl{% endblock %} space-y-4"> |
| 138 | 140 | {# Unverified accounts can read but not write. Inside #content so a |
Parents: da3a685