main
|
Last change
on this file since c16e0a5 was 1f0c85b, checked in by roboburr <roboburr@…>, 3 months ago |
|
ui(grid): show source site on hover on circle feed tiles
Grid tiles now show "from <site>" (post.source_name) in the hover overlay
(and on gradient tiles below the title), so in the circle feed it is clear
which site a post comes from. style.css?v=14.
Co-Authored-By: Claude <noreply@…>
|
-
Property mode
set to
100644
|
|
File size:
1.8 KB
|
| Rev | Line | |
|---|
| [7bc636b] | 1 | <%
|
|---|
| 2 | // Square Instagram-style tile for the .feed-grid view (v9 pattern).
|
|---|
| 3 | // - With cover → background-image, dark gradient overlay reveals title on hover/touch
|
|---|
| 4 | // - No cover → .grid-tile-gradient with the title centered (random hue per tile)
|
|---|
| 5 | const _tileHue = ((post.id || post.slug || '0').charCodeAt(0) * 7) % 360;
|
|---|
| 6 | const _isPinned = !!post.pinned;
|
|---|
| 7 | const _hasCover = !!post.cover_image_url;
|
|---|
| 8 | const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
|
|---|
| [1f0c85b] | 9 | const _src = post.source_name || ''; // bron-site (cirkel-feed: van welke site komt deze post)
|
|---|
| [7963a6e] | 10 | const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
|
|---|
| [43dbf9c] | 11 | const _external = post.external_url || null;
|
|---|
| 12 | const _href = _external || (_base + '/' + post.slug);
|
|---|
| 13 | const _ext = !!_external;
|
|---|
| [7bc636b] | 14 | %>
|
|---|
| 15 | <a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= _isPinned ? ' is-pinned' : '' %>"
|
|---|
| [7963a6e] | 16 | href="<%= _href %>"
|
|---|
| [7bc636b] | 17 | <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
|
|---|
| [43dbf9c] | 18 | <% if (_ext) { %>target="_blank" rel="noopener"<% } else { %>hx-get="<%= _href %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="<%= _href %>" hx-indicator="#pcms-loading"<% } %>>
|
|---|
| [7bc636b] | 19 |
|
|---|
| 20 | <% if (_typeLabel) { %>
|
|---|
| 21 | <span class="grid-tile-type"><%= _typeLabel %></span>
|
|---|
| 22 | <% } %>
|
|---|
| 23 | <% if (_isPinned) { %>
|
|---|
| 24 | <span class="grid-tile-pin">Pinned</span>
|
|---|
| 25 | <% } %>
|
|---|
| 26 |
|
|---|
| 27 | <% if (_hasCover) { %>
|
|---|
| 28 | <div class="grid-tile-overlay">
|
|---|
| 29 | <strong><%= post.title || '(untitled)' %></strong>
|
|---|
| [1f0c85b] | 30 | <% if (_src) { %><span class="grid-tile-overlay-src">van <%= _src %></span><% } %>
|
|---|
| [7bc636b] | 31 | </div>
|
|---|
| 32 | <% } else { %>
|
|---|
| 33 | <span class="grid-tile-title"><%= post.title || '(untitled)' %></span>
|
|---|
| [1f0c85b] | 34 | <% if (_src) { %><span class="grid-tile-gradient-src">van <%= _src %></span><% } %>
|
|---|
| [7bc636b] | 35 | <% } %>
|
|---|
| 36 | </a>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.