Spaces:
Running
Running
Back to plain search links (9f44eec)
Browse filesFiles changed (3)
- app.js+1-15
- index.html+3-3
- style.css-1
138 unmodified lines1391401411421431441452 unmodified lines148149150151152153154155156157158159160161162163164165166167168169170171172173138 unmodified lines<figcaption><span class="mono">${KF.fmtTime(f.t)}</span> <span class="how">${f.how}</span></figcaption><div class="row small"><button type="button" data-a="png" aria-label="Download the frame at ${KF.fmtTime(f.t)} as PNG">PNG</button><button type="button" data-a="copy" aria-label="Copy the frame at ${KF.fmtTime(f.t)}">Copy</button><button type="button" data-a="seek" title="Show this moment in the video" aria-label="Show ${KF.fmtTime(f.t)} in the video">Show</button><button type="button" data-a="del" aria-label="Remove the frame at ${KF.fmtTime(f.t)}">✕</button></div><div class="engines"><span>Copy and search:</span> ${ENGINES.map(([n], k) => `<button type="button" class="eng" data-e="${k}" aria-label="Copy the frame at ${KF.fmtTime(f.t)} and open ${n}">${n}</button>`).join(" ")}</div>`;fig.querySelector(".thumb").onclick = () => {if (bigUrl) URL.revokeObjectURL(bigUrl); bigUrl = URL.createObjectURL(f.blob);$("big").src = bigUrl; $("big").alt = `Frame at ${KF.fmtTime(f.t)}`; $("viewer").showModal(); };2 unmodified linestry { await navigator.clipboard.write([new ClipboardItem({ "image/png": f.blob })]); status(`Frame at ${KF.fmtTime(f.t)} copied. Paste it into the search engine.`, "ok"); }catch (_) { status("This browser didn't allow copying images. Use PNG to download the frame instead.", "err"); }};fig.querySelectorAll(".eng").forEach((b) => { b.onclick = () => searchWith(f, ENGINES[+b.dataset.e]); });fig.querySelector("[data-a=seek]").onclick = () => { video.currentTime = f.t; video.scrollIntoView({ behavior: "smooth", block: "center" }); };fig.querySelector("[data-a=del]").onclick = () => { frames.splice(i, 1); render(); };$("frames").appendChild(fig);});}// Copy the frame, then open the engine's upload page, so the user only has to paste (Ctrl+V / Cmd+V).// The tab is opened first, inside the click, so pop-up blockers allow it; it is pointed at the engine once the// frame is on the clipboard. Nothing is sent anywhere by this page: the user pastes into the engine they chose.async function searchWith(f, [name, url]) {const w = window.open("", "_blank");let copied = false;try { await navigator.clipboard.write([new ClipboardItem({ "image/png": f.blob })]); copied = true; } catch (_) { /* fall through */ }if (w) { try { w.opener = null; } catch (_) {} w.location.href = url; } else window.open(url, "_blank", "noopener");const key = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "Cmd+V" : "Ctrl+V";status(copied ? `Frame at ${KF.fmtTime(f.t)} copied. On the ${name} page, press ${key} to paste it, or use its upload button with the PNG.`: `${name} is open, but this browser didn't allow copying the image. Use PNG to download the frame, then upload it there.`, copied ? "ok" : "err");}function save(blob, name) {const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = name;document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(a.href), 60000);138 unmodified lines1391401411421431441452 unmodified lines148149150151152153154155156157158159138 unmodified lines<figcaption><span class="mono">${KF.fmtTime(f.t)}</span> <span class="how">${f.how}</span></figcaption><div class="row small"><button type="button" data-a="png" aria-label="Download the frame at ${KF.fmtTime(f.t)} as PNG">PNG</button><button type="button" data-a="copy" aria-label="Copy the frame at ${KF.fmtTime(f.t)}">Copy</button><button type="button" data-a="seek" title="Show this moment in the video" aria-label="Show ${KF.fmtTime(f.t)} in the video">Show</button><button type="button" data-a="del" aria-label="Remove the frame at ${KF.fmtTime(f.t)}">✕</button></div><div class="engines">Search: ${ENGINES.map(([n, u]) => `<a href="${u}" target="_blank" rel="noopener">${n}</a>`).join(" · ")}</div>`;fig.querySelector(".thumb").onclick = () => {if (bigUrl) URL.revokeObjectURL(bigUrl); bigUrl = URL.createObjectURL(f.blob);$("big").src = bigUrl; $("big").alt = `Frame at ${KF.fmtTime(f.t)}`; $("viewer").showModal(); };2 unmodified linestry { await navigator.clipboard.write([new ClipboardItem({ "image/png": f.blob })]); status(`Frame at ${KF.fmtTime(f.t)} copied. Paste it into the search engine.`, "ok"); }catch (_) { status("This browser didn't allow copying images. Use PNG to download the frame instead.", "err"); }};fig.querySelector("[data-a=seek]").onclick = () => { video.currentTime = f.t; video.scrollIntoView({ behavior: "smooth", block: "center" }); };fig.querySelector("[data-a=del]").onclick = () => { frames.splice(i, 1); render(); };$("frames").appendChild(fig);});}function save(blob, name) {const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = name;document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(a.href), 60000);
58 unmodified lines59606162636465666758 unmodified lines<button type="button" id="clear">Clear</button></div></div><p class="note">Click a frame to view it at full size. Each search button copies the full-resolution frame and opensthat engine's upload page: press <b>Ctrl+V</b> (<b>Cmd+V</b> on a Mac) there to paste it in. If an engine doesn'ttake a pasted image, download the PNG and use its upload button. Searching sends the frame to that company.</p><div id="frames" class="frames"></div></section>58 unmodified lines59606162636465666758 unmodified lines<button type="button" id="clear">Clear</button></div></div><p class="note">Click a frame to view it at full size. <b>Copy</b> puts the full-resolution frame on your clipboard,to paste into a search engine; the search links open the engine's own upload page, and uploading there sends theframe to that company.</p><div id="frames" class="frames"></div></section>
71 unmodified lines7273747571 unmodified linesdialog img { display: block; max-width: 92vw; max-height: 82vh; } dialog form { text-align: right; margin-top: 6px; }dialog::backdrop { background: rgba(0,0,0,.7); }.about h2 { font-size: 1.05rem; margin: 0 0 8px; } .about ul { padding-left: 18px; font-size: .92rem; } .about li { margin: 0 0 6px; }.engines span { margin-right: 2px; } .eng { font-size: .78rem; padding: 2px 7px; margin: 2px 1px; }71 unmodified lines72737471 unmodified linesdialog img { display: block; max-width: 92vw; max-height: 82vh; } dialog form { text-align: right; margin-top: 6px; }dialog::backdrop { background: rgba(0,0,0,.7); }.about h2 { font-size: 1.05rem; margin: 0 0 8px; } .about ul { padding-left: 18px; font-size: .92rem; } .about li { margin: 0 0 6px; }
app.js+1-15
index.html+3-3
style.css-1