mirror of
https://git.aramjonghu.dev/AramJonghu/aramjonghu-site.git
synced 2026-09-09 00:13:30 +02:00
autoscroll to have full streamview
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
const streams = [
|
const streams = [
|
||||||
{ id: "aramstream", label: "Aram" },
|
{ id: "aramstream", label: "Aram" },
|
||||||
@@ -9,6 +9,10 @@ const streams = [
|
|||||||
export default function Stream() {
|
export default function Stream() {
|
||||||
const [activeStream, setActiveStream] = useState("aramstream");
|
const [activeStream, setActiveStream] = useState("aramstream");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
|
}, [activeStream]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="text-ctp-text flex flex-col min-h-screen px-4 py-6">
|
<div className="text-ctp-text flex flex-col min-h-screen px-4 py-6">
|
||||||
<div className="w-full text-center flex flex-col flex-1">
|
<div className="w-full text-center flex flex-col flex-1">
|
||||||
@@ -32,7 +36,7 @@ export default function Stream() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="stream-frame w-full mx-auto flex-1 max-h-[85vh]">
|
<div className="flex-1 min-h-0">
|
||||||
<iframe
|
<iframe
|
||||||
src={`https://stream.aramjonghu.nl/${activeStream}`}
|
src={`https://stream.aramjonghu.nl/${activeStream}`}
|
||||||
title={activeStream}
|
title={activeStream}
|
||||||
|
|||||||
Reference in New Issue
Block a user