Changeset 99989f9 in Klonkt


Ignore:
Timestamp:
06/28/2026 04:57:19 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
201ec06
Parents:
74c5abc
Message:

feat(images): route all remaining avatars through avatar() (downscaled)

Wrap every avatar/profile-photo <img> src in avatar(): feed/comment/follow + nav, profile
header/sheet/bottom-tab, account, EPK hero, admin user list, site-edit preview. Local avatars
go through the thumb route, remote ones through the signed proxy. Covers (thumb()) untouched.

Location:
src/views
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/account.ejs

    r74c5abc r99989f9  
    3030        <% var _av = (typeof siteAvatar !== 'undefined' ? siteAvatar : null); %>
    3131        <% if (_av) { %>
    32           <img src="<%= _av %>" alt="">
     32          <img src="<%= avatar(_av, 128) %>" alt="">
    3333        <% } else { %>
    3434          <span><%= account.username.charAt(0).toUpperCase() %></span>
  • src/views/pages/admin-site-edit.ejs

    r74c5abc r99989f9  
    5050        <div class="photo-picker" id="photo-picker">
    5151          <div class="photo-thumb" id="photo-thumb" <%= site.profile_photo ? '' : 'data-empty' %>>
    52             <img id="photo-preview" src="<%= site.profile_photo || '' %>" alt="" <%= site.profile_photo ? '' : 'hidden' %>>
     52            <img id="photo-preview" src="<%= avatar(site.profile_photo || '', 128) %>" alt="" <%= site.profile_photo ? '' : 'hidden' %>>
    5353            <span class="photo-empty" aria-hidden="true">
    5454              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
  • src/views/pages/admin-users.ejs

    r74c5abc r99989f9  
    4242          <div class="ax-user-id">
    4343            <% if (u.avatar_url) { %>
    44               <img class="ax-avatar" src="<%= u.avatar_url %>" alt="">
     44              <img class="ax-avatar" src="<%= avatar(u.avatar_url, 128) %>" alt="">
    4545            <% } else { %>
    4646              <span class="ax-avatar ax-avatar-empty"><%= u.username.charAt(0).toUpperCase() %></span>
  • src/views/pages/epk.ejs

    r74c5abc r99989f9  
    99<section class="epk" <%= _accent ? ('style="--epk-accent:' + _accent + '"') : '' %>>
    1010  <header class="epk-hero">
    11     <% if (_photo) { %><div class="epk-photo"><img src="<%= _photo %>" alt="<%= site.title %>"></div><% } %>
     11    <% if (_photo) { %><div class="epk-photo"><img src="<%= avatar(_photo, 320) %>" alt="<%= site.title %>"></div><% } %>
    1212    <div class="epk-hero-text">
    1313      <div class="epk-kicker"><%= t('epk.kicker') %><% if (typeof user !== 'undefined' && user && user.role === 'god') { %> <a class="epk-edit-link" href="/admin/epk">✎ <%= t('epk.edit') %></a><% } %></div>
  • src/views/pages/user.ejs

    r74c5abc r99989f9  
    33    <div class="user-avatar-large">
    44      <% if (author.avatar_url) { %>
    5         <img src="<%= author.avatar_url %>" alt="">
     5        <img src="<%= avatar(author.avatar_url, 320) %>" alt="">
    66      <% } else { %>
    77        <span><%= author.username.charAt(0).toUpperCase() %></span>
  • src/views/partials/bottom-tab.ejs

    r74c5abc r99989f9  
    8585            aria-label="Profiel menu" aria-haspopup="dialog">
    8686      <% if (user.avatar_url) { %>
    87         <img class="bottom-tab-avatar bottom-tab-avatar-img" src="<%= user.avatar_url %>" alt="">
     87        <img class="bottom-tab-avatar bottom-tab-avatar-img" src="<%= avatar(user.avatar_url, 128) %>" alt="">
    8888      <% } else { %>
    8989        <span class="bottom-tab-avatar"><%= user.username.charAt(0).toUpperCase() %></span>
  • src/views/partials/profile-header.ejs

    r74c5abc r99989f9  
    4444    <button type="button" class="profile-photo" data-pf-summary aria-label="<%= _displayName || 'Profile' %>">
    4545      <% if (_avatarUrl) { %>
    46         <img src="<%= _avatarUrl %>" alt="">
     46        <img src="<%= avatar(_avatarUrl, 320) %>" alt="">
    4747      <% } else if (site.enable_audio_player && (typeof audioEnabled === 'undefined' || audioEnabled)) { %>
    4848        <span class="profile-photo-fallback profile-photo-fallback--music" aria-hidden="true">
     
    112112    <button type="button" class="pf-summary-close" aria-label="Sluiten">&times;</button>
    113113    <% if (_avatarUrl) { %>
    114       <img class="pf-summary-photo" src="<%= _avatarUrl %>" alt="">
     114      <img class="pf-summary-photo" src="<%= avatar(_avatarUrl, 128) %>" alt="">
    115115    <% } else { %>
    116116      <div class="pf-summary-photo pf-summary-photo--ph" aria-hidden="true">
  • src/views/partials/profile-sheet.ejs

    r74c5abc r99989f9  
    3737    <div class="profile-sheet-header">
    3838      <% if (user.avatar_url) { %>
    39         <img class="profile-sheet-avatar profile-sheet-avatar-img" src="<%= user.avatar_url %>" alt="" aria-hidden="true">
     39        <img class="profile-sheet-avatar profile-sheet-avatar-img" src="<%= avatar(user.avatar_url, 128) %>" alt="" aria-hidden="true">
    4040      <% } else { %>
    4141        <div class="profile-sheet-avatar" aria-hidden="true"><%= user.username.charAt(0).toUpperCase() %></div>
  • src/views/partials/topnav.ejs

    r74c5abc r99989f9  
    113113          <summary class="nav-btn user-toggle" aria-label="Gebruikersmenu">
    114114            <% if (user.avatar_url) { %>
    115               <img class="user-avatar user-avatar-img" src="<%= user.avatar_url %>" alt="">
     115              <img class="user-avatar user-avatar-img" src="<%= avatar(user.avatar_url, 128) %>" alt="">
    116116            <% } else { %>
    117117              <span class="user-avatar"><%= user.username.charAt(0).toUpperCase() %></span>
     
    121121            <div class="user-dropdown-header">
    122122              <% if (user.avatar_url) { %>
    123                 <img class="udh-avatar" src="<%= user.avatar_url %>" alt="">
     123                <img class="udh-avatar" src="<%= avatar(user.avatar_url, 128) %>" alt="">
    124124              <% } else { %>
    125125                <span class="udh-avatar udh-avatar-fallback"><%= user.username.charAt(0).toUpperCase() %></span>
Note: See TracChangeset for help on using the changeset viewer.