From 97cc69b33704496cdcec8a45da16b37fe2e579b0 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Sat, 23 May 2026 15:29:50 +0200 Subject: [PATCH] better blur --- public/s/css/f0ckm.css | 16 ++++++++-------- scripts/regen.mjs | 26 ++++++++++++++++++++++++++ src/inc/queue.mjs | 2 +- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/public/s/css/f0ckm.css b/public/s/css/f0ckm.css index 7921e4d..f428a9a 100644 --- a/public/s/css/f0ckm.css +++ b/public/s/css/f0ckm.css @@ -14598,7 +14598,7 @@ body.scroller-active #gchat-reopen-bubble { font-size: 14px !important; letter-spacing: 2px !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; - background: rgba(15, 15, 20, 0.5) !important; + background: rgba(10, 10, 12, 0.65) !important; pointer-events: none !important; opacity: 1 !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; @@ -14617,7 +14617,7 @@ body.scroller-active #gchat-reopen-bubble { font-size: 14px !important; letter-spacing: 2px !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; - background: rgba(15, 15, 20, 0.6) !important; + background: rgba(10, 10, 12, 0.75) !important; pointer-events: none !important; opacity: 1 !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; @@ -14636,9 +14636,9 @@ body.scroller-active #gchat-reopen-bubble { font-size: 14px !important; letter-spacing: 2px !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; - background: rgba(15, 15, 20, 0.45) !important; - backdrop-filter: blur(15px) !important; - -webkit-backdrop-filter: blur(15px) !important; + background: rgba(10, 10, 12, 0.6) !important; + backdrop-filter: blur(28px) !important; + -webkit-backdrop-filter: blur(28px) !important; pointer-events: none !important; opacity: 1 !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; @@ -14657,9 +14657,9 @@ body.scroller-active #gchat-reopen-bubble { font-size: 14px !important; letter-spacing: 2px !important; text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9) !important; - background: rgba(15, 15, 20, 0.5) !important; - backdrop-filter: blur(18px) !important; - -webkit-backdrop-filter: blur(18px) !important; + background: rgba(10, 10, 12, 0.65) !important; + backdrop-filter: blur(32px) !important; + -webkit-backdrop-filter: blur(32px) !important; pointer-events: none !important; opacity: 1 !important; transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important; diff --git a/scripts/regen.mjs b/scripts/regen.mjs index 5abc393..d5cd1f4 100644 --- a/scripts/regen.mjs +++ b/scripts/regen.mjs @@ -8,6 +8,7 @@ * node regen.mjs --all - Regenerate ALL items * node regen.mjs --audio - Regenerate all audio items * node regen.mjs --pdf - Regenerate all PDF items + * node regen.mjs --blur - Regenerate ONLY the blurred thumbnails for NSFW/NSFL items */ import db from "../src/inc/sql.mjs"; @@ -26,14 +27,28 @@ if (args.length === 0) { console.log(' node regen.mjs --audio - Regenerate all audio items'); console.log(' node regen.mjs --pdf - Regenerate all PDF items'); console.log(' node regen.mjs --youtube - Regenerate all YouTube thumbnails'); + console.log(' node regen.mjs --blur - Regenerate ONLY the blurred thumbnails for NSFW/NSFL items'); process.exit(0); } const THUMB_SIZE = 512; +const blurOnly = args.includes('--blur'); console.log(`[regen] Thumb size: ${THUMB_SIZE}px\n`); const regen = async (item) => { const { id, dest, mime, src } = item; + + if (blurOnly) { + console.log(`[${id}] Regenerating blurred thumbnail only: ${dest}`); + try { + await queue.genBlurredThumbnail(id, false); + console.log(`[${id}] ✓ Blurred thumbnail regenerated`); + } catch (err) { + console.error(`[${id}] ✗ FAILED:`, err.message || err); + } + return; + } + console.log(`[${id}] Regenerating: ${dest} (${mime})`); try { @@ -75,6 +90,17 @@ try { } else if (args.includes('--youtube')) { items = await db`SELECT id, dest, mime, src FROM items WHERE active = true AND is_deleted = false AND mime = 'video/youtube' ORDER BY id`; console.log(`Regenerating ${items.length} YouTube items...\n`); + } else if (blurOnly) { + const nsflTagId = cfg.nsfl_tag_id || 3; + items = await db` + SELECT DISTINCT i.id, i.dest, i.mime, i.src + FROM items i + JOIN tags_assign ta ON ta.item_id = i.id + WHERE i.active = true AND i.is_deleted = false + AND ta.tag_id IN (2, ${nsflTagId}) + ORDER BY i.id + `; + console.log(`Regenerating ONLY blurred thumbnails for ${items.length} NSFW/NSFL items...\n`); } else { const ids = args.map(Number).filter(n => !isNaN(n) && n > 0); if (ids.length === 0) { diff --git a/src/inc/queue.mjs b/src/inc/queue.mjs index 43e5c86..e535575 100644 --- a/src/inc/queue.mjs +++ b/src/inc/queue.mjs @@ -497,7 +497,7 @@ export default new class queue { const src = path.join(tDir, `${itemid}.webp`); const dst = path.join(tDir, `${itemid}_blur.webp`); try { - await this.spawn('magick', [src, '-blur', '0x20', dst]); + await this.spawn('magick', [src, '-blur', '0x48', dst]); return true; } catch (err) { console.error(`[QUEUE] Failed to generate blurred thumbnail for ${itemid}:`, err);