playpause
This commit is contained in:
@@ -1,13 +1,27 @@
|
||||
"use client";
|
||||
import "./style.css";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [isAnimate, setIsAnimate] = useState(false);
|
||||
|
||||
const toggleAnimation = () => {
|
||||
setIsAnimate(!isAnimate);
|
||||
};
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="bg-game-show animate h-screen">{children}</body>
|
||||
<body className={`bg-game-show ${isAnimate ? "animate" : ""} h-screen`}>
|
||||
{children}
|
||||
<button
|
||||
className={`absolute top-1 left-1 ${isAnimate ? "pause" : "play"}`}
|
||||
onClick={toggleAnimation}
|
||||
></button>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user