source: Klonkt/src/views/partials/shared-styles.ejs@ 1dca23b

main
Last change on this file since 1dca23b was 1dca23b, checked in by roboburr <roboburr@…>, 3 months ago

View-switcher: margin-top back to 0.5rem (tight under the profile header line)

The symmetric 1.5rem made the pills float too far from the divider line.
The 8px was intentional: pills align with the line, the larger space below
is breathing room toward the feed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>

  • Property mode set to 100644
File size: 7.3 KB
RevLine 
[7bc636b]1<style>
2/* ─────────────────────────────────────────────────
3 View switcher (timeline ↔ grid + grid-cols picker)
4 ───────────────────────────────────────────────── */
5.view-switcher-wrap {
6 border-bottom: 1px solid var(--rule);
7 background: var(--paper);
[1dca23b]8 /* Strakke ruimte (8px) tussen de profielkop-streep en de pills — bewust klein
9 zodat de pills aansluiten op de lijn. De grotere margin-bottom (1.5rem in
10 style.css) is lucht naar de feed; dat hoort niet symmetrisch te zijn. */
11 margin-top: 0.5rem;
[7bc636b]12}
13.view-switcher-wrap .container {
14 display: flex; align-items: center; justify-content: center; gap: 0.75rem;
15 /* Slimmer bar: was 0.4rem (≈12px total chrome above pill); now 0.25rem. */
16 padding: 0.25rem 1rem;
17 max-width: 1200px; margin: 0 auto;
18 flex-wrap: wrap;
19}
20.view-switcher {
21 display: inline-flex;
22 background: var(--paper-2);
23 border: 1px solid var(--rule);
24 border-radius: 999px;
25 padding: 0.15rem;
26}
27.view-switch-btn {
28 display: inline-flex; align-items: center; gap: 0.35rem;
29 padding: 0.35rem 0.85rem;
30 border: 0; background: transparent; color: var(--ink-muted, var(--ink-soft));
31 cursor: pointer; border-radius: 999px;
32 font-size: 0.85rem; font-family: inherit;
33 transition: background 120ms, color 120ms;
34}
35.view-switch-btn:hover { color: var(--ink); }
36.view-switch-btn[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
37
38.grid-cols-picker {
39 display: none; /* desktop-only, see media query */
40 gap: 0.2rem;
41}
42.grid-cols-btn {
43 width: 28px; height: 28px;
44 border: 1px solid var(--rule);
45 background: var(--paper-2);
46 color: var(--ink-muted, var(--ink-soft));
47 border-radius: 4px;
48 font-size: 0.8rem; font-weight: 600;
49 cursor: pointer;
50 font-variant-numeric: tabular-nums;
51}
52.grid-cols-btn:hover { color: var(--ink); border-color: var(--accent); }
53.grid-cols-btn.is-active { background: var(--accent); color: white; border-color: var(--accent); }
54
55/* Show grid-cols picker only on grid view + desktop */
56@media (min-width: 720px) {
57 body[data-feed-view="grid"] .grid-cols-picker { display: inline-flex; }
58}
59
60/* Switcher is hidden only on admin pages — admin has a dedicated layout
61 and its own back-button flow where Tijdlijn/Grid is irrelevant. On
62 every other page (home, post, tag, archive, search, account) it stays
63 visible so the user keeps a consistent return-to-feed control. */
64.on-admin .view-switcher-wrap { display: none; }
65
[af5407f]66/* Op een losse post is er geen feed om te schakelen, dus geen knop hoort "actief"
67 (gekleurd) te ogen. De actieve staat zit in style.css op body[data-feed-view]
68 / body[data-grid-cols] (background:var(--ink)); we overrulen die SPECIFIEKER
69 via body.on-post zodat de knoppen neutraal/grijs worden — maar wél klikbaar
70 blijven (de klik-handler navigeert dan naar de feed in die weergave). De
71 body-class wisselt client-side bij HTMX-nav, dus dit werkt ook zonder reload. */
72body.on-post[data-feed-view="timeline"] .view-switch-btn[data-view="timeline"],
73body.on-post[data-feed-view="grid"] .view-switch-btn[data-view="grid"],
74body.on-post[data-grid-cols="2"] .grid-cols-btn[data-cols="2"],
75body.on-post[data-grid-cols="3"] .grid-cols-btn[data-cols="3"],
76body.on-post[data-grid-cols="4"] .grid-cols-btn[data-cols="4"] {
77 background: transparent;
78 color: var(--ink-muted, var(--ink-soft));
79 border-color: var(--rule);
[11a6871]80}
81
[7bc636b]82/* Spacing between switcher-bar and the page content below.
83 .feed-timeline (used on home + archive + post-list pages) gets a top
84 margin so the first post doesn't collide with the switcher's border.
85 .feed-grid already has its own top spacing from grid-tile padding. */
86.view-switcher-wrap + #pcms-main .feed-timeline,
87.view-switcher-wrap + #pcms-main .container:first-child {
88 margin-top: 1.5rem;
89}
90
91/* Feed layout switching is in the v9 style.css (style.css):
92 .feed-timeline always rendered, .feed-grid hidden unless on-home + grid-mode. */
93
94/* ─────────────────────────────────────────────────
95 PWA install button (lives in topnav, hidden by default)
96 ───────────────────────────────────────────────── */
97#pwa-install-btn { color: var(--accent); }
98#pwa-install-btn:hover { background: var(--paper-2); }
99
100/* Shared button + form styles (used across pages) */
101.btn {
102 display: inline-flex;
103 align-items: center;
104 gap: 0.4rem;
105 padding: 0.55rem 1rem;
106 border: 1px solid var(--rule);
107 background: var(--paper-2);
108 color: var(--ink);
109 font-family: var(--font-ui, system-ui), sans-serif;
110 font-size: 0.9rem;
111 font-weight: 500;
112 text-decoration: none;
113 border-radius: 5px;
114 cursor: pointer;
115 transition: background 150ms, border-color 150ms;
116}
117.btn:hover { border-color: var(--accent); }
118.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
119.btn-primary:hover { opacity: 0.92; border-color: var(--accent); }
120.btn-success { background: #16a34a; color: white; border-color: #16a34a; }
121.btn-danger { background: #dc2626; color: white; border-color: #dc2626; }
122
123.alert { padding: 0.75rem 1rem; border-radius: 5px; margin-bottom: 1rem; }
124.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
125.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
126
127.auth-page { max-width: 420px; margin: 3rem auto; padding: 0 1rem; }
128.auth-page h1 { font-family: var(--font-display, serif); text-align: center; margin: 0 0 1.5rem; }
129.auth-form { display: flex; flex-direction: column; gap: 1rem; }
130.auth-form label { display: flex; flex-direction: column; gap: 0.3rem; }
131.auth-form label > span { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
132.auth-form input { padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 1rem; }
133.auth-form .btn { justify-content: center; padding: 0.7rem; font-size: 1rem; margin-top: 0.5rem; }
134.auth-link { text-align: center; color: var(--ink-muted); font-size: 0.9rem; margin: 1rem 0 0; }
135.auth-link a { color: var(--accent); }
[c80e78b]136.auth-google { align-items: stretch; }
137.auth-intro { text-align: center; color: var(--ink-muted); font-size: 0.95rem; margin: 0 0 1rem; }
138.btn-google {
[e2a8e31]139 display: flex; justify-content: center; gap: 0.6rem; padding: 0.7rem; font-size: 1rem;
[c80e78b]140 background: #fff; color: #1f1f1f; border: 1px solid #dadce0;
141}
142.btn-google:hover { background: #f7f8f8; border-color: #dadce0; }
143.btn-google .g-icon { flex-shrink: 0; }
[9e27d64]144.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0; color: var(--ink-muted); font-size: 0.85rem; }
145.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
[7bc636b]146
147/* HTMX loading indicator */
148.pcms-loading {
149 display: none;
150 position: fixed;
151 top: 60px;
152 right: 1rem;
153 width: 24px;
154 height: 24px;
155 border: 3px solid var(--paper-2);
156 border-top-color: var(--accent);
157 border-radius: 50%;
158 animation: spin 0.8s linear infinite;
159 z-index: 1000;
160}
161.htmx-request .pcms-loading { display: block; }
162@keyframes spin { to { transform: rotate(360deg); } }
163</style>
Note: See TracBrowser for help on using the repository browser.