diff --git a/src/components/CodeBlock.tsx b/src/components/CodeBlock.tsx index 53824de..b2b1548 100644 --- a/src/components/CodeBlock.tsx +++ b/src/components/CodeBlock.tsx @@ -31,7 +31,7 @@ export default function CodeBlock() { spellCheck={false} />
diff --git a/src/components/SaveButton.tsx b/src/components/SaveButton.tsx index 09c185b..5eb57d9 100644 --- a/src/components/SaveButton.tsx +++ b/src/components/SaveButton.tsx @@ -12,7 +12,7 @@ export default function SaveButton() { const save = async () => { setSaving(true); - const result = await unwrapOr(encode(code), ""); + const result = await unwrapOr(encode(code), "Hello World"); const url = `${window.location.origin}/?l=${$langStore.get()}&t=${$themeStore.get()}&c=${result}`; navigator.clipboard.writeText(url); diff --git a/src/pages/index.astro b/src/pages/index.astro index 4c878c8..516236d 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,19 +2,26 @@ import "../styles/global.css"; import { type BundledTheme } from "shiki"; import Editor from "../components/Editor"; -import { $codeStore, $langStore, $themeStore, parseLang } from "../utils/theme"; +import { + $codeStore, + $langStore, + $themeStore, + $themeColorsStore, + parseLang, +} from "../utils/theme"; import { decode } from "../utils/encode"; import { unwrapOr } from "../utils/result"; const langParam = Astro.url.searchParams.get("l") ?? "txt"; const themeParam = Astro.url.searchParams.get("t") ?? "github-dark-default"; + const codeParam = Astro.url.searchParams.get("c") ?? - "H4sIAAAAAAAAE_PLV3DOT0lVCCjKL8tMSU0BAGFoYswQAAAA"; + "H4sIAAAAAAAAE_NIzcnJVwjPL8pJAQBWsRdKCwAAAA"; const code = await unwrapOr( decode(codeParam), - "H4sIAAAAAAAAE_PLV3DOT0lVCCjKL8tMSU0BAGFoYswQAAAA", + "H4sIAAAAAAAAE_NIzcnJVwjPL8pJAQBWsRdKCwAAAA", ); $codeStore.set(code); @@ -42,7 +49,7 @@ $themeStore.set(themeParam as BundledTheme); - +