feat: tab slide animation, hover feedback, snapshot toast
CD — Kai-Sa-Cam Deployment / deploy (push) Successful in 10s
CD — Kai-Sa-Cam Deployment / deploy (push) Successful in 10s
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 132 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 383 KiB |
+37
-11
@@ -19,6 +19,7 @@ export function App() {
|
||||
const [snapshots, setSnapshots] = useState<string[]>([]);
|
||||
const [sessionExpired, setSessionExpired] = useState(false);
|
||||
const [streamKey, setStreamKey] = useState(0);
|
||||
const [toast, setToast] = useState<string | null>(null);
|
||||
|
||||
const {
|
||||
startRecording,
|
||||
@@ -70,8 +71,12 @@ export function App() {
|
||||
if (!res.ok) throw new Error("Snapshot failed");
|
||||
const data = await res.json();
|
||||
setSnapshots((prev) => [data.filename, ...prev]);
|
||||
setToast("Capture d'écran prise");
|
||||
setTimeout(() => setToast(null), 2000);
|
||||
} catch (e) {
|
||||
console.error("Snapshot error:", e);
|
||||
setToast("Erreur lors de la capture");
|
||||
setTimeout(() => setToast(null), 2000);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -103,23 +108,33 @@ export function App() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<main className="flex-1 flex flex-col min-h-0">
|
||||
<nav className="mx-auto mt-[1vh] sm:mt-[1.5vh] flex gap-2 trans-bloc p-1 rounded-[50px] w-fit shrink-0">
|
||||
<main className="flex-1 flex flex-col min-h-0 relative">
|
||||
{toast && (
|
||||
<div className="absolute top-2 right-2 z-50 glass-card px-4 py-2 rounded-[50px] text-sm animate-fade-in">
|
||||
{toast}
|
||||
</div>
|
||||
)}
|
||||
<nav className="mx-auto mt-[1vh] sm:mt-[1.5vh] flex gap-2 trans-bloc p-1 rounded-[50px] w-fit shrink-0 relative overflow-hidden">
|
||||
<div
|
||||
className={`absolute top-1 bottom-1 w-[calc(50%-4px)] rounded-[50px] glass-button transition-transform duration-300 ease-in-out ${
|
||||
activeTab === "media" ? "translate-x-[calc(100%+4px)]" : "translate-x-0"
|
||||
}`}
|
||||
/>
|
||||
<button
|
||||
className={`px-6 sm:px-8 md:px-10 py-1.5 sm:py-2 md:py-2.5 rounded-[50px] text-sm sm:text-base md:text-lg transition-all active:scale-95 ${
|
||||
className={`relative z-10 px-6 sm:px-8 md:px-10 py-1.5 sm:py-2 md:py-2.5 rounded-[50px] text-sm sm:text-base md:text-lg transition-all active:scale-95 ${
|
||||
activeTab === "live"
|
||||
? "glass-button font-medium"
|
||||
: "bg-transparent hover:opacity-80"
|
||||
? "font-medium"
|
||||
: "hover:bg-white/5"
|
||||
}`}
|
||||
onClick={() => setActiveTab("live")}
|
||||
>
|
||||
Live
|
||||
</button>
|
||||
<button
|
||||
className={`px-6 sm:px-8 md:px-10 py-1.5 sm:py-2 md:py-2.5 rounded-[50px] text-sm sm:text-base md:text-lg transition-all active:scale-95 ${
|
||||
className={`relative z-10 px-6 sm:px-8 md:px-10 py-1.5 sm:py-2 md:py-2.5 rounded-[50px] text-sm sm:text-base md:text-lg transition-all active:scale-95 ${
|
||||
activeTab === "media"
|
||||
? "glass-button font-medium"
|
||||
: "bg-transparent hover:opacity-80"
|
||||
? "font-medium"
|
||||
: "hover:bg-white/5"
|
||||
}`}
|
||||
onClick={() => setActiveTab("media")}
|
||||
>
|
||||
@@ -127,7 +142,12 @@ export function App() {
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
{activeTab === "live" ? (
|
||||
<div className="flex-1 min-h-0 relative overflow-hidden">
|
||||
<div
|
||||
className={`absolute inset-0 flex flex-col transition-transform duration-300 ease-in-out ${
|
||||
activeTab === "live" ? "translate-x-0" : "-translate-x-full"
|
||||
}`}
|
||||
>
|
||||
<div className="flex-1 flex flex-col items-center gap-2 sm:gap-3 md:gap-4 mt-2 sm:mt-3 px-1 sm:px-2 min-h-0">
|
||||
<div className="w-full flex-1 min-h-0 rounded-[20px] sm:rounded-[30px] overflow-hidden glass-card animate-fade-in">
|
||||
{/* Même origine => même session Access, plus de stream.esiah.dev.
|
||||
@@ -156,11 +176,17 @@ export function App() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
</div>
|
||||
<div
|
||||
className={`absolute inset-0 flex flex-col transition-transform duration-300 ease-in-out ${
|
||||
activeTab === "media" ? "translate-x-0" : "translate-x-full"
|
||||
}`}
|
||||
>
|
||||
<div className="flex-1 flex flex-col mt-2 sm:mt-3 px-1 sm:px-2 min-h-0 overflow-auto no-scrollbar">
|
||||
<MediaGallery />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ body {
|
||||
"Helvetica Neue",
|
||||
Arial,
|
||||
sans-serif;
|
||||
background-image: url(/background_img.png);
|
||||
background-image: url(/background_img.jpeg);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-attachment: fixed;
|
||||
|
||||
Reference in New Issue
Block a user