logigate/app/components/editor/App.vue

36 lines
1.0 KiB
Vue

<script setup lang="ts">
const ed = useEditor()
onMounted(() => {
const stop = ed.startLoop()
onBeforeUnmount(stop)
void ed.startAccount()
try {
if (!localStorage.getItem('logigate:help-seen')) ed.showHelp.value = true
} catch {}
})
</script>
<template>
<div class="app">
<EditorToolbar />
<div class="workspace">
<EditorPalette />
<main class="stage">
<EditorCanvas />
</main>
<EditorInspector />
</div>
<Transition name="fade">
<div v-if="ed.notice.value" class="toast" :class="ed.notice.value.kind">{{ ed.notice.value.text }}</div>
</Transition>
<div v-if="ed.placing.value" class="placing-hint">
Click on the canvas to place. <kbd>Shift</kbd> places several, <kbd>Esc</kbd> stops.
</div>
<EditorHelp v-if="ed.showHelp.value" />
<EditorProjectsDialog v-if="ed.dialog.value === 'projects'" />
<EditorShareDialog v-if="ed.dialog.value === 'share'" />
<EditorAccountDialog v-if="ed.dialog.value === 'account'" />
</div>
</template>