source: Klonkt/src/views/partials/fedi-tabs.ejs@ 9e5438e

main
Last change on this file since 9e5438e was 9e5438e, checked in by Robin Genis <roboburr@…>, 3 months ago

feat(fedi): unify Timeline/Following/Replies/Notifications/Blocking under one tabbed Fediverse section

Shared responsive fedi-tabs bar (5 tabs + back-to-site) on all fediverse pages, with
htmx nav so switching tabs swaps #pcms-main (feels like one page; URL stays bookmarkable
per tab; tab bar scrolls horizontally on narrow screens). Added a 'Fediverse' entry to
the user dropdown + mobile sheet (-> /tijdlijn), removed the separate Timeline nav icon
(kept the notification bell). Replaced the old 2-tab tl-tabs (removed). i18n nav.fediverse
+ tl.tab_replies (nl/en/de).

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[9e5438e]1<%# Shared tab bar for the unified Fediverse section. Owner/admin-only.
2 Param: active = 'feed' | 'following' | 'reacties' | 'meldingen' | 'blokkeren'.
3 Responsive: horizontal tabs that scroll on narrow screens. %>
4<% var _a = (typeof active !== 'undefined') ? active : ''; %>
5<% var _nu = (typeof notifUnread !== 'undefined') ? notifUnread : 0; %>
6<div class="fedi-bar">
7 <a class="btn btn-primary fedi-bar-back" href="/"><%= t('nav.back_to_site') %></a>
8 <nav class="fedi-tabs" aria-label="Fediverse">
9 <a href="/tijdlijn" class="fedi-tab<%= _a === 'feed' ? ' is-active' : '' %>"
10 hx-get="/tijdlijn?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/tijdlijn" hx-indicator="#pcms-loading"><%= t('tl.tab_feed') %></a>
11 <a href="/volgend" class="fedi-tab<%= _a === 'following' ? ' is-active' : '' %>"
12 hx-get="/volgend?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/volgend" hx-indicator="#pcms-loading"><%= t('tl.tab_following') %></a>
13 <a href="/fediverse" class="fedi-tab<%= _a === 'reacties' ? ' is-active' : '' %>"
14 hx-get="/fediverse?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/fediverse" hx-indicator="#pcms-loading"><%= t('tl.tab_replies') %></a>
15 <a href="/meldingen" class="fedi-tab<%= _a === 'meldingen' ? ' is-active' : '' %>"
16 hx-get="/meldingen?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/meldingen" hx-indicator="#pcms-loading"><%= t('notif.title') %><% if (_nu > 0) { %> <span class="fedi-tab-badge"><%= _nu > 9 ? '9+' : _nu %></span><% } %></a>
17 <a href="/blokkeren" class="fedi-tab<%= _a === 'blokkeren' ? ' is-active' : '' %>"
18 hx-get="/blokkeren?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/blokkeren" hx-indicator="#pcms-loading"><%= t('blk.title') %></a>
19 </nav>
20</div>
21<style>
22.fedi-bar { margin: 0 0 1.25rem; }
23.fedi-bar-back { margin: 0 0 1rem; }
24.fedi-tabs { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
25 border-bottom: 1px solid color-mix(in srgb, var(--ink, #000) 10%, transparent); }
26.fedi-tabs::-webkit-scrollbar { height: 4px; }
27.fedi-tab { flex: 0 0 auto; padding: .55rem .85rem; white-space: nowrap; text-decoration: none;
28 color: var(--ink-soft, #888); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
29.fedi-tab:hover { color: var(--ink, #000); }
30.fedi-tab.is-active { color: var(--accent, #06c); border-bottom-color: var(--accent, #06c); }
31.fedi-tab-badge { display: inline-block; min-width: 1.15em; padding: 0 .3em; border-radius: 999px;
32 background: var(--accent, #e8b04b); color: #fff; font-size: .68rem; line-height: 1.5; text-align: center; vertical-align: middle; }
33@media (max-width: 520px) { .fedi-tab { padding: .55rem .7rem; font-size: .92rem; } }
34</style>
Note: See TracBrowser for help on using the repository browser.