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
'use strict'; | |
var _ = require('lodash'); | |
/** | |
* @class StateMachine | |
* @constructor | |
*/ | |
function StateMachine(options) { | |
/** |
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
@property --rotation { | |
syntax: "<angle>"; | |
inherits: false; | |
initial-value: 0deg; | |
} | |
@property --pos-x { | |
syntax: "<percentage>"; | |
inherits: false; | |
initial-value: 0%; |
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 { type NextRequest, NextResponse } from "next/server"; | |
export function middleware(request: NextRequest) { | |
return basicAuth(request); | |
} | |
function basicAuth(request: NextRequest) { | |
const authHeader = request.headers.get("Authorization"); | |
const validCredentials = process.env.BASIC_AUTH_CREDENTIALS; // e.g. admin:12345 |
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 { useLayoutEffect, useRef, useState } from "react"; | |
import { flushSync } from "react-dom"; | |
export function useResizeScale< | |
ContainerRef extends HTMLElement, | |
InnerRef extends HTMLElement, | |
>({ width }: { width: number }) { | |
const containerRef = useRef<ContainerRef | null>(null); | |
const innerRef = useRef<InnerRef | null>(null); | |
const [innerStyle, setInnerStyle] = useState<React.CSSProperties>({}); |
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 { useRef, type ClipboardEvent } from "react"; | |
import { useDropzone } from "react-dropzone"; | |
function Dropzone() { | |
const inputRef = useRef<HTMLInputElement>(null) | |
const { | |
getRootProps, | |
getInputProps, | |
} = useDropzone({...}); | |