Changeset 1f640ff in Klonkt
- Timestamp:
- 07/30/2026 12:04:21 PM (6 weeks ago)
- Branches:
- main
- Children:
- f9b1c5c
- Parents:
- 6dd26e5
- Location:
- src
- Files:
-
- 3 edited
-
assets/css/style.css (modified) (1 diff)
-
routes/activitypub.js (modified) (2 diffs)
-
views/partials/post-tile.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/css/style.css
r6dd26e5 r1f640ff 2423 2423 /* Audio tile (Shaer, Robins vraag 30-7): the waveform PNG is white on 2424 2424 transparent and floats OVER the tile's own hue gradient, so every audio 2425 post keeps its color and gets its shape. Contain + padding leaves the 2426 centered title readable. */ 2425 post keeps its color and gets its shape. Wave and title each get their 2426 own band (wave upper, title lower): centering both stacked them right 2427 through each other (Robins schermafdruk). */ 2427 2428 .grid-tile-img.grid-tile-wave { 2428 2429 background-color: transparent; 2429 2430 object-fit: contain; 2430 padding: 26% 10%; 2431 /* explicit box, not auto: an absolutely positioned img falls back to its 2432 intrinsic size when width/height are auto, collapsing the band */ 2433 top: 8%; left: 8%; right: auto; bottom: auto; 2434 width: 84%; height: 46%; 2431 2435 opacity: .85; 2432 2436 } 2437 .grid-tile-audio .grid-tile-title { position: absolute; left: 10%; right: 10%; top: 60%; } 2438 .grid-tile-audio .grid-tile-gradient-src { position: absolute; left: 10%; right: 10%; top: 76%; } 2433 2439 /* Cover videos are decorative, not players: let clicks + right-click pass through to the 2434 2440 tile link so you get the normal link menu (not the browser's <video> menu/controls). -
src/routes/activitypub.js
r6dd26e5 r1f640ff 357 357 // audio-tegel op): ffmpeg draws the waveform into <name>.poster.png. 358 358 // White on transparent, so the tile's own gradient stays the backdrop 359 // and every audio post keeps its own hue. 359 // and every audio post keeps its own hue. The shape is bars, not the 360 // raw hairy wave (Robins tweede vraag): peak and average sampled into 361 // 57 columns (soft tip over bright core), blown up nearest-neighbor to 362 // 14px bars, and drawgrid ERASES 5px gaps (c=black@0 + replace=1 writes 363 // transparent pixels; h=2*ih keeps horizontal grid lines out of frame). 360 364 if (mime.startsWith('audio/')) { 361 365 Promise.all([import('child_process'), import('ffmpeg-static')]).then(([{ execFile }, ff]) => { … … 363 367 if (!bin) return; 364 368 const poster = req.file.path + '.poster.png'; 365 execFile(bin, ['-hide_banner', '-loglevel', 'error', '-y', '-i', req.file.path, '-filter_complex', 'showwavespic=s=800x256:colors=white', '-frames:v', '1', poster], 369 const graph = '[0:a]aformat=channel_layouts=mono,asplit[a][b];' 370 + '[a]showwavespic=s=57x256:colors=white@0.5:filter=peak:scale=sqrt:draw=full[pk];' 371 + '[b]showwavespic=s=57x256:colors=white:filter=average:scale=sqrt:draw=full[av];' 372 + '[pk][av]overlay=format=auto,scale=798:256:flags=neighbor,drawgrid=w=14:h=2*ih:t=5:c=black@0:replace=1'; 373 execFile(bin, ['-hide_banner', '-loglevel', 'error', '-y', '-i', req.file.path, '-filter_complex', graph, '-frames:v', '1', poster], 366 374 { timeout: 30000 }, (e) => { if (e && e.code !== 'ENOENT') console.warn('[media] waveform failed:', e.message); }); 367 375 }).catch(() => { /* never blocks the upload */ }); -
src/views/partials/post-tile.ejs
r6dd26e5 r1f640ff 43 43 const _ext = !!_external; 44 44 %> 45 <a class="grid-tile<%= _showCover ? '' : ' grid-tile-gradient' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %><%= post.nsfw ? ' nsfw-media' : '' %>"45 <a class="grid-tile<%= _showCover ? '' : ' grid-tile-gradient' %><%= _cWave ? ' grid-tile-audio' : '' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %><%= post.nsfw ? ' nsfw-media' : '' %>" 46 46 href="<%= _href %>" 47 47 style="--tile-hue: <%= _tileHue %>;"
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)