From 8a82606d592bd694260f05060ee15ab779596c52 Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Thu, 24 Oct 2024 16:14:14 -0700 Subject: [PATCH] fix: use hidden shiki element so that we can interpolate at the right time --- playgrounds/app/src/components/Editor.tsx | 45 +++++++++++++++++------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/playgrounds/app/src/components/Editor.tsx b/playgrounds/app/src/components/Editor.tsx index 2b8a120..03e8284 100644 --- a/playgrounds/app/src/components/Editor.tsx +++ b/playgrounds/app/src/components/Editor.tsx @@ -94,10 +94,10 @@ export default function Editor(props: EditorProps) { height: number }>() const [code, setCode] = createSignal(props.startCode) + const [hiddenCode, setHiddenCode] = createSignal(props.startCode) const [isResizing, setIsResizing] = createSignal(false) const [isLooping, setIsLooping] = createSignal(true) const [isGenerating, setIsGenerating] = createSignal(false) - const [isGenerated, setIsGenerated] = createSignal(false) const [gifDataUrl, setGifDataUrl] = createSignal('') const [isShowingGifDialog, setIsShowingGifDialog] = createSignal(false) @@ -134,8 +134,6 @@ export default function Editor(props: EditorProps) { document.body.addEventListener('mousemove', e => { if (isResizing()) { const deltaX = e.movementX - console.log('mousemove') - // console.log(e.) props.setSnippetWidth(props.snippetWidth + deltaX) } }) @@ -496,12 +494,14 @@ export default function Editor(props: EditorProps) {