This commit is contained in:
2022-08-23 10:10:45 +02:00
parent 60c3c45868
commit ec4f0bd852
3 changed files with 63 additions and 14 deletions

View File

@ -9,11 +9,13 @@ import REPL from "../components/REPL";
import styles from "../styles/Home.module.css";
import type { ContentList } from "../lib/content/types";
import { useRouter } from "next/router";
import Rainbow from "../lib/colors";
const Home: NextPage<{ buildTime: string }> = ({ buildTime }) => {
const inputRef = useRef<HTMLInputElement>(null);
const { modalFunctions } = useModalFunctions();
const { setContents } = useCommands();
const router = useRouter();
const updateProjects = useCallback(async () => {
try {
@ -41,6 +43,12 @@ const Home: NextPage<{ buildTime: string }> = ({ buildTime }) => {
return () => clearInterval(interval);
}, [updateProjects, modalFunctions]);
useEffect(() => {
if ("rainbow" in router.query) {
Rainbow.start();
}
}, [router]);
return (<main onKeyDown={hideModalOnEsc} tabIndex={-1}>
<Head>
<title>c0ntroller.de</title>