mirror of
https://git.aramjonghu.dev/AramJonghu/aramjonghu-site.git
synced 2026-09-01 05:53: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 = [
|
||||
{ id: "aramstream", label: "Aram" },
|
||||
@@ -9,6 +9,10 @@ const streams = [
|
||||
export default function Stream() {
|
||||
const [activeStream, setActiveStream] = useState("aramstream");
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
}, [activeStream]);
|
||||
|
||||
return (
|
||||
<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">
|
||||
@@ -32,7 +36,7 @@ export default function Stream() {
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="stream-frame w-full mx-auto flex-1 max-h-[85vh]">
|
||||
<div className="flex-1 min-h-0">
|
||||
<iframe
|
||||
src={`https://stream.aramjonghu.nl/${activeStream}`}
|
||||
title={activeStream}
|
||||
|
||||
Reference in New Issue
Block a user