Forum: the link module, with YouTube previews

- services/forum/src/links: recognises the links in a post and shows a
  preview for the ones a provider knows; for now YouTube (watch, shorts,
  live, embed and youtu.be links, with the start time). Title and channel
  come from YouTube's oEmbed answer, the thumbnail is cut to 16:9 and kept
  in our own storage, so reading a thread loads nothing from YouTube. Made
  when a post is written or edited; without it the link stays text.
- The card: on a computer a click plays the video in place
  (youtube-nocookie.com); on a phone it opens the YouTube app (Android:
  an intent with the web page as fallback; iOS: the link the app takes
  over), and "Lejátszás itt" plays it in place.
- The privacy notice (HU, EN) says what YouTube sees when one plays it.
- "Pörgős most" is now "Élénk beszélgetések"; the new thread form lost its
  note about text and emoji.
- docs: the Turnstile captcha is on the list before going live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-26 16:26:37 +00:00
co-authored by Claude Opus 5.5
parent 493539bf56
commit 1d4f18b5d6
21 changed files with 653 additions and 26 deletions
+23
View File
@@ -702,3 +702,26 @@ a.fh-online-item:hover { color: var(--gold); }
.fshare-open { margin-top: 4px; }
.fnew-share { display: flex; flex-direction: column; gap: 8px; }
.fnew-share .fshare { margin-top: 0; }
/* --- link previews (YouTube) --- */
.flinks { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.flink {
display: flex; flex-direction: column; max-width: 480px; overflow: hidden;
border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel);
}
.flink-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0e1424; }
.flink-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flink-noimg { display: block; width: 100%; height: 100%; }
.flink-play {
position: absolute; left: 50%; top: 50%; width: 56px; height: 40px; transform: translate(-50%, -50%);
display: grid; place-items: center; border-radius: 12px; background: rgba(15, 15, 15, 0.78);
transition: background 0.15s;
}
.flink-play svg { width: 22px; height: 22px; fill: #fff; }
.flink-thumb:hover .flink-play, .flink-thumb:focus-visible .flink-play { background: #d32020; }
.flink-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 12px; }
.flink-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.flink-here { align-self: flex-start; margin-top: 4px; }
.flink-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.flink-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.flink .fp-link { display: inline-flex; align-items: center; padding: 0; text-decoration: none; }
+2 -2
View File
@@ -159,8 +159,8 @@ export default async function ForumHomePage() {
{hot.length > 0 && (
<section className="fh-section o-5" aria-labelledby="fh-hot">
<div className="fh-section-head">
<h2 id="fh-hot">Pörgős most</h2>
<span className="hint">az utóbbi 24 órában</span>
<h2 id="fh-hot">Élénk beszélgetések</h2>
<span className="hint">ma sokan írtak bennük</span>
</div>
<div className="fh-card fh-flush">
<ThreadList threads={hot} />
@@ -145,10 +145,6 @@ export function NewThreadForm({
required
placeholder={intent === "listen" ? "Írd le, ami benned van…" : "Írd le a gondolataidat…"}
/>
<span className="hint">
Szöveg és emoji: a :) és a {"<3"} magától emojivá alakul. Képet és videót nem lehet beilleszteni, a linkek
sima szövegként látszanak.
</span>
</div>
<p className="hint">