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:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user