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

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

fix(ios): safe-area top for fullscreen editor toolbar + fedi tabs on mobile

  1. Fullscreen post-editor toolbar (Done + format icons) sat under the camera/Dynamic Island -> padding-top with env(safe-area-inset-top).
  2. Fediverse tabs on mobile (no desktop top-nav there) sat under the notch -> margin-top with safe-area inset + extra headroom.
  • Property mode set to 100644
File size: 3.1 KB
Line 
1<%# Shared tab bar for the unified Fediverse section. Owner/admin-only.
2 Param: active = 'feed' | 'following' | 'reacties' | 'meldingen' | 'blokkeren'.
3 All tabs share the content width equally (flex:1) and always fit (ellipsis).
4 "Back to site" lives in the top nav, not here. %>
5<% var _a = (typeof active !== 'undefined') ? active : ''; %>
6<% var _nu = (typeof notifUnread !== 'undefined') ? notifUnread : 0; %>
7<nav class="fedi-tabs" aria-label="Fediverse">
8 <a href="/timeline" class="fedi-tab<%= _a === 'feed' ? ' is-active' : '' %>"
9 hx-get="/timeline?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/timeline" hx-indicator="#pcms-loading"><%= t('tl.tab_feed') %></a>
10 <a href="/following" class="fedi-tab<%= _a === 'following' ? ' is-active' : '' %>"
11 hx-get="/following?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/following" hx-indicator="#pcms-loading"><%= t('tl.tab_following') %></a>
12 <a href="/fediverse" class="fedi-tab<%= _a === 'reacties' ? ' is-active' : '' %>"
13 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>
14 <a href="/notifications" class="fedi-tab<%= _a === 'meldingen' ? ' is-active' : '' %>"
15 hx-get="/notifications?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/notifications" hx-indicator="#pcms-loading"><span class="fedi-tab-label"><%= t('notif.title') %></span><% if (_nu > 0) { %><span class="fedi-tab-badge"><%= _nu > 9 ? '9+' : _nu %></span><% } %></a>
16 <a href="/blocking" class="fedi-tab<%= _a === 'blokkeren' ? ' is-active' : '' %>"
17 hx-get="/blocking?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/blocking" hx-indicator="#pcms-loading"><%= t('blk.title') %></a>
18</nav>
19<style>
20/* All 5 tabs share the width equally and always fit (truncate with ellipsis if needed). */
21.fedi-tabs { display: flex; margin: 1.25rem 0 1.5rem;
22 border-bottom: 1px solid color-mix(in srgb, var(--ink, #000) 10%, transparent); }
23.fedi-tab { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
24 padding: .6rem .4rem; text-decoration: none; font-weight: 600; font-size: .95rem;
25 color: var(--ink-soft, #888); border-bottom: 2px solid transparent; margin-bottom: -1px;
26 display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
27.fedi-tab:hover { color: var(--ink, #000); }
28.fedi-tab.is-active { color: var(--accent, #06c); border-bottom-color: var(--accent, #06c); }
29.fedi-tab-label { overflow: hidden; text-overflow: ellipsis; }
30.fedi-tab-badge { flex: 0 0 auto; min-width: 1.15em; padding: 0 .3em; border-radius: 999px;
31 background: var(--accent, #e8b04b); color: #fff; font-size: .66rem; line-height: 1.5; text-align: center; }
32/* Mobile: no desktop top-nav here, so clear the camera/notch + give headroom. */
33@media (max-width: 767px) { .fedi-tabs { margin-top: calc(1.5rem + env(safe-area-inset-top, 0px)); } }
34@media (max-width: 520px) { .fedi-tab { padding: .55rem .25rem; font-size: .82rem; } }
35@media (max-width: 380px) { .fedi-tab { font-size: .74rem; } }
36</style>
Note: See TracBrowser for help on using the repository browser.