From a4f2f5c60bae66954c22679f3d050801b32b78c1 Mon Sep 17 00:00:00 2001 From: lordlogo2002 Date: Tue, 20 Jan 2026 07:34:22 +0100 Subject: [PATCH] Enhance HUD functionality: implement flashing effect for HUD dot to indicate member-only video detection --- content.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/content.js b/content.js index 634ed1b..dbc34b4 100644 --- a/content.js +++ b/content.js @@ -17,6 +17,7 @@ const DEFAULT_MAX_ARCHIVE = 500; const MAX_SNAPSHOT_CHARS = 20000; let persistTimer = null; let contextInvalidated = false; +let hudFlashTimer = null; function safeSnapshot(video) { if (typeof buildSnapshot !== "function") return ""; @@ -82,6 +83,13 @@ function injectStyleOnce() { box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.4); animation: ${DATA_PREFIX}-pulse 1.8s ease-in-out infinite; } + #${HUD_DOT_ID}[data-${DATA_PREFIX}-flash="true"] { + background: #ffd84a; + border-color: #e0a600; + transform: scale(1.8); + box-shadow: 0 0 0 10px rgba(255, 216, 74, 0.4); + transition: transform 0.15s ease, box-shadow 0.15s ease; + } @keyframes ${DATA_PREFIX}-pulse { 0% { transform: scale(0.9); @@ -381,6 +389,7 @@ function process(root = document) { if (!whitelisted) { if (id && memberOnlyIndex.has(id)) { const meta = memberOnlyIndex.get(id); + if (!meta.hidden) flashHudDot(); if (!meta.snapshot) meta.snapshot = safeSnapshot(video); if (!meta.hidden) hudDirty = true; meta.hidden = true; @@ -674,6 +683,15 @@ function updateHudDot() { } } +function flashHudDot() { + const dot = ensureHudDot(); + dot.setAttribute(`data-${DATA_PREFIX}-flash`, "true"); + if (hudFlashTimer) clearTimeout(hudFlashTimer); + hudFlashTimer = setTimeout(() => { + dot.removeAttribute(`data-${DATA_PREFIX}-flash`); + }, 900); +} + function updateSharedIndex(meta, hidden) { if (!meta.stableId) { meta.stableId = meta.url || meta.id || "";