diff --git a/src/pages/dev/transcript.tsx b/src/pages/dev/transcript.tsx index 4891a60..af9c257 100644 --- a/src/pages/dev/transcript.tsx +++ b/src/pages/dev/transcript.tsx @@ -18,9 +18,14 @@ import { cIf, cJoin } from "helpers/className"; * ────────────────────────────────────────╯ CONSTANTS ╰────────────────────────────────────────── */ +type Orientation = "horizontal" | "vertical"; + const textAtom = atomPairing(atomWithStorage("transcriptText", "")); const fontSizeAtom = atomPairing(atomWithStorage("transcriptFontSize", 1)); -const textOffset = atomPairing(atomWithStorage("transcriptTextOffset", 0)); +const textOffsetAtom = atomPairing(atomWithStorage("transcriptTextOffset", 0)); +const orientationAtom = atomPairing( + atomWithStorage("transcriptOrientation", "vertical") +); const SIZE_MULTIPLIER = 1000; @@ -50,7 +55,8 @@ const swapChar = (char: string, swaps: string[]): string => { const Transcript = (props: Props): JSX.Element => { const [text, setText] = useAtomPair(textAtom); const [fontSize, setFontSize] = useAtomPair(fontSizeAtom); - const [xOffset, setXOffset] = useAtomPair(textOffset); + const [offset, setOffset] = useAtomPair(textOffsetAtom); + const [orientation, setOrientation] = useAtomPair(orientationAtom); const [lineIndex, setLineIndex] = useState(0); const textAreaRef = useRef(null); @@ -409,52 +415,32 @@ const Transcript = (props: Props): JSX.Element => { ); const contentPanel = ( - -
-