This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const randomString = (length) => { | |
return Array.from( | |
window.crypto.getRandomValues(new Uint8Array(length / 2)), | |
(d) => d.toString(16).padStart(2, "0") | |
).join(""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useTheme } from "@chakra-ui/react"; | |
import { AnimatePresence, motion } from "framer-motion"; | |
import { useRouter } from "next/router"; | |
import { FC, useEffect, useState } from "react"; | |
/** | |
* Little component for Next.js that implements a UI indicator for route navigation. Made with Framer Motion | |
* Should be absolute positioned to the top of the page | |
* NOTE: Next.js 13 is not supported, as it has a different router implementation | |
*/ |