Changeset 2f42b60 in Klonkt


Ignore:
Timestamp:
06/26/2026 11:41:24 PM (2 months ago)
Author:
Robin Genis <roboburr@โ€ฆ>
Branches:
main
Children:
c7ecaf9
Parents:
3d37c67
Message:

style(fedi): nicer card layout for Notifications + My-replies

Notifications: emoji type-icons -> coloured SVG icons in tinted circles (gold like /
green boost / accent follow+reply), two-line hierarchy (who+time, then action+post),
reply preview in a tinted block, hover lift. My-replies: reply-arrow head with
'to @handle' + time, content indented, pill delete button with trash icon, hover lift.

Location:
src/views/pages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/authorize-interaction.ejs

    r3d37c67 r2f42b60  
    99        <% manage.forEach(function(m){ %>
    1010          <li class="fedi-manage-item">
     11            <div class="fedi-manage-head">
     12              <span class="fedi-manage-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg></span>
     13              <% if (m.to_handle) { %><span class="fedi-manage-to"><%= m.to_handle %></span><% } %>
     14              <% if (m.created_at && typeof formatDateTime === 'function') { %><span class="fedi-manage-time"><%= formatDateTime(m.created_at) %></span><% } %>
     15            </div>
    1116            <div class="fedi-manage-content"><%- m.content %></div>
    1217            <div class="fedi-manage-foot">
    13               <span class="fedi-manage-meta"><% if (m.to_handle) { %>โ†’ <%= m.to_handle %><% } %><% if (m.created_at && typeof formatDateTime === 'function') { %> ยท <%= formatDateTime(m.created_at) %><% } %></span>
    1418              <form method="post" action="/fediverse/<%= m.id %>/delete" onsubmit="return confirm('<%= t('fedi.delete_confirm') %>')">
    15                 <button type="submit" class="fedi-del-btn"><%= t('comments.delete') %></button>
     19                <button type="submit" class="fedi-del-btn"><svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg> <%= t('comments.delete') %></button>
    1620              </form>
    1721            </div>
     
    165169  .fedi-bigact-boost:hover, .fedi-bigact-boost.is-on { background: color-mix(in srgb, #2fa85a 16%, transparent); border-color: color-mix(in srgb, #2fa85a 55%, transparent); }
    166170  .fedi-manage { list-style: none; padding: 0; margin: 1.25rem 0 1rem; display: flex; flex-direction: column; gap: .7rem; }
    167   .fedi-manage-item { padding: .85rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); border: 1px solid color-mix(in srgb, var(--ink, #000) 9%, transparent); }
    168   .fedi-manage-content { line-height: 1.5; overflow-wrap: anywhere; }
     171  .fedi-manage-item { padding: .9rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--ink, #000) 3.5%, transparent); border: 1px solid color-mix(in srgb, var(--ink, #000) 9%, transparent); transition: border-color .15s ease, box-shadow .15s ease; }
     172  .fedi-manage-item:hover { border-color: color-mix(in srgb, var(--accent, #888) 28%, transparent); box-shadow: 0 2px 12px color-mix(in srgb, var(--ink, #000) 6%, transparent); }
     173  .fedi-manage-head { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
     174  .fedi-manage-icon { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
     175    background: color-mix(in srgb, var(--accent, #888) 16%, transparent); color: var(--accent, #06c); }
     176  .fedi-manage-icon svg { width: 14px; height: 14px; }
     177  .fedi-manage-to { font-weight: 600; color: var(--ink, inherit); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
     178  .fedi-manage-time { color: var(--ink-soft, #999); font-size: .76rem; margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
     179  .fedi-manage-content { line-height: 1.55; overflow-wrap: anywhere; padding-left: calc(26px + .5rem); }
    169180  .fedi-manage-content p { margin: .15rem 0; }
    170181  .fedi-manage-content p:first-child { margin-top: 0; }
    171182  .fedi-manage-content p:last-child { margin-bottom: 0; }
    172   .fedi-manage-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; flex-wrap: wrap; }
    173   .fedi-manage-meta { color: var(--ink-soft, #999); font-size: .8rem; }
    174   .fedi-del-btn { border: 1px solid color-mix(in srgb, #d9534f 50%, transparent); background: color-mix(in srgb, #d9534f 12%, transparent); color: #e06b66; border-radius: 8px; padding: .3rem .75rem; font-size: .82rem; cursor: pointer; transition: background .15s ease; }
     183  .fedi-manage-foot { display: flex; justify-content: flex-end; margin-top: .65rem; }
     184  .fedi-del-btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid color-mix(in srgb, #d9534f 45%, transparent); background: color-mix(in srgb, #d9534f 12%, transparent); color: #e06b66; border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .82rem; cursor: pointer; transition: background .15s ease; }
    175185  .fedi-del-btn:hover { background: color-mix(in srgb, #d9534f 24%, transparent); }
    176186</style>
  • src/views/pages/fedi-notifications.ejs

    r3d37c67 r2f42b60  
    66  <% } else { %>
    77    <ul class="nt-list">
    8       <% items.forEach(function(n){ %>
    9         <li class="nt-item">
    10           <span class="nt-icon"><%= n.type === 'follow' ? '๐Ÿ‘ค' : (n.type === 'like' ? 'โญ' : (n.type === 'announce' ? '๐Ÿ”' : '๐Ÿ’ฌ')) %></span>
     8      <% items.forEach(function(n){
     9           var _ic = n.type === 'follow' ? 'follow' : (n.type === 'like' ? 'like' : (n.type === 'announce' ? 'boost' : 'reply'));
     10      %>
     11        <li class="nt-item nt-<%= _ic %>">
     12          <span class="nt-icon" aria-hidden="true">
     13            <% if (_ic === 'like') { %><svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.6l2.9 5.88 6.49.95-4.7 4.58 1.11 6.46L12 17.96l-5.8 3.06 1.1-6.46-4.69-4.58 6.49-.95z"/></svg>
     14            <% } else if (_ic === 'boost') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 0 1 4-4h14"/><polyline points="7 23 3 19 7 15"/><path d="M21 13v2a4 4 0 0 1-4 4H3"/></svg>
     15            <% } else if (_ic === 'follow') { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><line x1="19" y1="8" x2="19" y2="14"/><line x1="22" y1="11" x2="16" y2="11"/></svg>
     16            <% } else { %><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg><% } %>
     17          </span>
    1118          <div class="nt-body">
    1219            <div class="nt-line">
    1320              <a class="nt-who" href="<%= n.url %>" target="_blank" rel="nofollow noopener"><%= n.name || n.handle %></a>
    1421              <% if (n.handle && n.name) { %><span class="nt-handle"><%= n.handle %></span><% } %>
    15               <span class="nt-what">
    16                 <% if (n.type === 'follow') { %><%= t('notif.followed') %>
    17                 <% } else if (n.type === 'like') { %><%= t('notif.liked') %>
    18                 <% } else if (n.type === 'announce') { %><%= t('notif.boosted') %>
    19                 <% } else { %><%= t('notif.replied') %><% } %>
    20                 <% if (n.post_slug) { %><a href="/<%= n.post_slug %>"><%= n.post_title || n.post_slug %></a><% } %>
    21               </span>
    2222              <% if (n.created_at) { %><span class="nt-time"><%= formatDateTime(n.created_at) %></span><% } %>
     23            </div>
     24            <div class="nt-what">
     25              <% if (n.type === 'follow') { %><%= t('notif.followed') %>
     26              <% } else if (n.type === 'like') { %><%= t('notif.liked') %>
     27              <% } else if (n.type === 'announce') { %><%= t('notif.boosted') %>
     28              <% } else { %><%= t('notif.replied') %><% } %>
     29              <% if (n.post_slug) { %><a class="nt-post" href="/<%= n.post_slug %>"><%= n.post_title || n.post_slug %></a><% } %>
    2330            </div>
    2431            <% if (n.type === 'reply' && n.content) { %><div class="nt-content"><%- n.content %></div><% } %>
     
    3542  .nt-title { margin: 0 0 1.25rem; }
    3643  .nt-empty { color: var(--ink-soft, #888); }
    37   .nt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
    38   .nt-item { display: flex; gap: .7rem; padding: .7rem .9rem; border-radius: 12px; background: color-mix(in srgb, var(--ink, #000) 4%, transparent); border: 1px solid color-mix(in srgb, var(--ink, #000) 8%, transparent); }
    39   .nt-icon { font-size: 1.1rem; flex: 0 0 1.4rem; text-align: center; }
     44  .nt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
     45  .nt-item { display: flex; gap: .85rem; padding: .9rem 1rem; border-radius: 14px; align-items: flex-start;
     46    background: color-mix(in srgb, var(--ink, #000) 3.5%, transparent);
     47    border: 1px solid color-mix(in srgb, var(--ink, #000) 9%, transparent);
     48    transition: border-color .15s ease, box-shadow .15s ease; }
     49  .nt-item:hover { border-color: color-mix(in srgb, var(--accent, #888) 30%, transparent);
     50    box-shadow: 0 2px 12px color-mix(in srgb, var(--ink, #000) 6%, transparent); }
     51  .nt-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
     52    display: inline-flex; align-items: center; justify-content: center; }
     53  .nt-icon svg { width: 18px; height: 18px; }
     54  .nt-like .nt-icon { background: color-mix(in srgb, #e8b04b 16%, transparent); color: #e8b04b; }
     55  .nt-boost .nt-icon { background: color-mix(in srgb, #2fa85a 16%, transparent); color: #2fa85a; }
     56  .nt-follow .nt-icon, .nt-reply .nt-icon { background: color-mix(in srgb, var(--accent, #888) 16%, transparent); color: var(--accent, #06c); }
    4057  .nt-body { flex: 1; min-width: 0; }
    41   .nt-line { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; }
    42   .nt-who { font-weight: 600; color: var(--ink, inherit); text-decoration: none; }
     58  .nt-line { display: flex; align-items: baseline; gap: .4rem; }
     59  .nt-who { font-weight: 700; color: var(--ink, inherit); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    4360  .nt-who:hover { text-decoration: underline; }
    44   .nt-handle { color: var(--ink-soft, #888); font-size: .82rem; }
    45   .nt-what { color: var(--ink-soft, #aaa); }
    46   .nt-what a { color: var(--accent, #06c); }
    47   .nt-time { color: var(--ink-soft, #999); font-size: .78rem; margin-left: auto; }
    48   .nt-content { margin: .3rem 0 0; line-height: 1.45; color: var(--ink, inherit); overflow-wrap: anywhere; }
    49   .nt-content p { margin: .2rem 0; } .nt-content p:first-child { margin-top: 0; }
     61  .nt-handle { color: var(--ink-soft, #888); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
     62  .nt-time { color: var(--ink-soft, #999); font-size: .76rem; margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
     63  .nt-what { color: var(--ink-soft, #aaa); margin-top: .12rem; line-height: 1.4; }
     64  .nt-post { color: var(--accent, #06c); font-weight: 600; }
     65  .nt-content { margin: .45rem 0 0; padding: .55rem .75rem; border-radius: 10px; line-height: 1.5;
     66    background: color-mix(in srgb, var(--ink, #000) 4%, transparent); color: var(--ink, inherit); overflow-wrap: anywhere; }
     67  .nt-content p { margin: .2rem 0; } .nt-content p:first-child { margin-top: 0; } .nt-content p:last-child { margin-bottom: 0; }
    5068</style>
Note: See TracChangeset for help on using the changeset viewer.