import { render } from "solid-js/web" import { MetaProvider } from "@solidjs/meta" import "@opencode-ai/app/index.css" import { Font } from "@opencode-ai/ui/font" import { Splash } from "@opencode-ai/ui/logo" import "./styles.css" import { createSignal, Match, onMount } from "solid-js" import { commands, events, InitStep } from "./bindings" import { Channel } from "@tauri-apps/api/core" import { Switch } from "solid-js" const root = document.getElementById("root")! render(() => { let splash!: SVGSVGElement const [state, setState] = createSignal(null) const channel = new Channel() channel.onmessage = (e) => setState(e) commands.awaitInitialization(channel as any).then(() => { const currentOpacity = getComputedStyle(splash).opacity splash.style.animation = "none" splash.style.animationPlayState = "paused" splash.style.opacity = currentOpacity requestAnimationFrame(() => { splash.style.transition = "opacity 0.3s ease" requestAnimationFrame(() => { splash.style.opacity = "1" }) }) }) return (
{(_) => { onMount(() => { setTimeout(() => events.loadingWindowComplete.emit(null), 1000) }) return "All done" }} {(_) => { const textItems = [ "Just a moment...", "Migrating your database", "This could take a couple of minutes", ] const [textIndex, setTextIndex] = createSignal(0) onMount(async () => { await new Promise((res) => setTimeout(res, 3000)) setTextIndex(1) await new Promise((res) => setTimeout(res, 6000)) setTextIndex(2) }) return <>{textItems[textIndex()]} }}
) }, root)