feat: add user instructions to viewer popup

This commit is contained in:
robot committed 2026-08-31 03:26:50 +00:00
1 parent c366f0b8c4
commit 97abaf42d9
9 files changed
+462

No files matched your search

+84
View File
@@ -32,6 +32,90 @@ h1 {
font-weight: 600;
}
.instructions-panel {
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px;
border: 1px solid var(--border);
border-radius: var(--radius);
background: #f8fafc;
}
.instructions-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.instructions-kicker {
margin-bottom: 2px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #64748b;
}
.instructions-panel h2 {
font-size: 14px;
line-height: 1.3;
font-weight: 600;
}
.instructions-toggle {
flex: 0 0 auto;
padding: 6px 10px;
font-size: 12px;
background: transparent;
color: var(--accent);
border: 1px solid var(--border);
}
.instructions-toggle:hover {
background: #eef2ff;
}
.instructions-body {
display: flex;
flex-direction: column;
gap: 8px;
}
.instructions-body[hidden] {
display: none;
}
.instructions-list {
display: flex;
flex-direction: column;
gap: 8px;
padding-left: 18px;
}
.instructions-list li {
display: flex;
flex-direction: column;
gap: 2px;
}
.instructions-list strong {
font-size: 12px;
}
.instructions-list span,
.instructions-note,
.instructions-learn-more {
font-size: 12px;
line-height: 1.45;
color: #475569;
}
.instructions-note {
color: #7c3aed;
}
button {
padding: 8px 16px;
background: var(--accent);
+39
View File
@@ -9,6 +9,45 @@
<body>
<div id="app">
<h1>VidPlex</h1>
<section class="instructions-panel" role="region" aria-labelledby="instructions-title">
<div class="instructions-header">
<div>
<p class="instructions-kicker">Quick start</p>
<h2 id="instructions-title">How to use VidPlex</h2>
</div>
<button
id="instructions-toggle"
type="button"
class="instructions-toggle"
aria-expanded="true"
aria-controls="instructions-body"
>
Hide instructions
</button>
</div>
<div id="instructions-body" class="instructions-body">
<ol class="instructions-list">
<li>
<strong>Scan videos</strong>
<span>Click <strong>Find Videos</strong> to search the current browser window for videos.</span>
</li>
<li>
<strong>Review the list</strong>
<span>Check the popup list; each found video URL is clickable.</span>
</li>
<li>
<strong>Open the viewer</strong>
<span>Click <strong>Open Viewer</strong> to open the 2x2 grid player in a new window.</span>
</li>
<li>
<strong>Reset and rescan</strong>
<span>Click <strong>Clear</strong> to erase results and scan again.</span>
</li>
</ol>
<p class="instructions-note">Warning: Browser pages, extension pages, and restricted frames can hide videos, so results may be incomplete.</p>
<p class="instructions-learn-more">Learn more tooltip: Read the VidPlex README and audit notes.</p>
</div>
</section>
<button id="find-btn">Find Videos (all tabs)</button>
<div id="video-list" class="video-list" style="display:none;"></div>
<div id="status" class="status" style="min-height:16px;"></div>
+16
View File
@@ -34,10 +34,26 @@ const openBtn = document.getElementById('open-btn');
const statusEl = document.getElementById('status');
const listEl = document.getElementById('video-list');
const btnRow = document.getElementById('btn-row');
const instructionsToggle = document.getElementById('instructions-toggle');
const instructionsBody = document.getElementById('instructions-body');
listEl.style.wordBreak = 'break-word';
listEl.style.whiteSpace = 'pre-wrap';
function setInstructionsExpanded(expanded) {
if (!instructionsToggle || !instructionsBody) return;
instructionsBody.hidden = !expanded;
instructionsToggle.setAttribute('aria-expanded', String(expanded));
instructionsToggle.textContent = expanded ? 'Hide instructions' : 'Show instructions';
}
if (instructionsToggle && instructionsBody) {
setInstructionsExpanded(true);
instructionsToggle.addEventListener('click', () => {
setInstructionsExpanded(instructionsBody.hidden);
});
}
/* ======================================================================== */
/* UI helpers */
/* ======================================================================== */