A component faces, project library with share links, fine-grained wire editing
- Lamps and hex displays inside a component show on its box with their
labels, lit by that instance's state; Counter 4 example shows its count.
- Several projects per browser; share links at /p/<id> that the creator's
edits save to automatically, others get their own copy. Export, open a
file as project, or add a file's components to the open project.
- Wires: drag any segment or corner, Alt+drag for a new bend, Ctrl+drag to
branch, double-click selects the whole signal, multi-select, arrow keys,
colour tags.
- Share-link API (POST/GET/PUT /api/p) on Nitro fs storage in data/, mounted
as a volume on edgerealm.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 11:21:49 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
const ed = useEditor()
|
|
|
|
|
const fileInput = ref<HTMLInputElement>()
|
|
|
|
|
const renaming = ref<string | null>(null)
|
|
|
|
|
const renameText = ref('')
|
|
|
|
|
const confirmDelete = ref<string | null>(null)
|
|
|
|
|
|
|
|
|
|
const close = () => (ed.dialog.value = null)
|
|
|
|
|
const when = (t: number) => new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(t)
|
|
|
|
|
|
|
|
|
|
function open(id: string) {
|
|
|
|
|
ed.switchProject(id)
|
|
|
|
|
close()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function startRename(id: string, name: string) {
|
|
|
|
|
renaming.value = id
|
|
|
|
|
renameText.value = name
|
|
|
|
|
nextTick(() => document.querySelector<HTMLInputElement>('.project-list input')?.select())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function finishRename() {
|
|
|
|
|
if (renaming.value) ed.renameProject(renaming.value, renameText.value)
|
|
|
|
|
renaming.value = null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onFile(e: Event) {
|
|
|
|
|
const file = (e.target as HTMLInputElement).files?.[0]
|
|
|
|
|
if (file) ed.importAsProject(file).then(close)
|
|
|
|
|
;(e.target as HTMLInputElement).value = ''
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="modal-backdrop" @click.self="close">
|
|
|
|
|
<div class="modal" role="dialog" aria-labelledby="projects-title">
|
|
|
|
|
<div class="flex items-start justify-between gap-4">
|
|
|
|
|
<h2 id="projects-title">Projects</h2>
|
|
|
|
|
<button class="tb-btn" title="Close" @click="close"><Icon name="lucide:x" class="size-4" /></button>
|
|
|
|
|
</div>
|
A settings for every part, overlap-free wiring with crossing styles, accounts with sync
- Clicking anything opens its settings: swap parts in place (wires stay on
matching pins), clock frequency per clock, keyboard keys for switches and
buttons, lamp/display colours, note sizes, component names on the canvas,
position, unlink all wires, unpack a component, make an independent copy.
- Wires of different signals never share a line: auto routes pick free
columns or detours, remaining clashes go on separate lanes. Crossings drawn
as bow, triangle, bridge, gap or plain.
- Accounts (email + scrypt password, httpOnly session) with two-way project
sync and conflict copies; per-account limits; cross-site writes refused.
- Compatibility suite: a project and both browser-storage layouts from
release a241adc must load and compute identically.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 11:09:37 +00:00
|
|
|
<p class="hint mt-1">
|
|
|
|
|
Saved in this browser as you work.
|
|
|
|
|
<template v-if="ed.account.value">Also kept in your account, so they are on every computer you sign in on.</template>
|
|
|
|
|
<a v-else href="#" @click.prevent="ed.dialog.value = 'account'">Sign in to have them on every computer.</a>
|
|
|
|
|
</p>
|
A component faces, project library with share links, fine-grained wire editing
- Lamps and hex displays inside a component show on its box with their
labels, lit by that instance's state; Counter 4 example shows its count.
- Several projects per browser; share links at /p/<id> that the creator's
edits save to automatically, others get their own copy. Export, open a
file as project, or add a file's components to the open project.
- Wires: drag any segment or corner, Alt+drag for a new bend, Ctrl+drag to
branch, double-click selects the whole signal, multi-select, arrow keys,
colour tags.
- Share-link API (POST/GET/PUT /api/p) on Nitro fs storage in data/, mounted
as a volume on edgerealm.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 11:21:49 +00:00
|
|
|
|
|
|
|
|
<ul class="project-list">
|
|
|
|
|
<li v-for="m in ed.projects.value" :key="m.id" :class="{ current: m.id === ed.meta.value.id }">
|
|
|
|
|
<input
|
|
|
|
|
v-if="renaming === m.id"
|
|
|
|
|
v-model="renameText"
|
|
|
|
|
class="rename"
|
|
|
|
|
@keydown.enter="finishRename"
|
|
|
|
|
@keydown.esc="renaming = null"
|
|
|
|
|
@blur="finishRename"
|
|
|
|
|
/>
|
|
|
|
|
<button v-else class="pick" @click="open(m.id)">
|
|
|
|
|
<span class="name">
|
|
|
|
|
{{ m.name }}
|
|
|
|
|
<span v-if="m.id === ed.meta.value.id" class="badge">open</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="meta">
|
|
|
|
|
{{ when(m.updated) }}
|
|
|
|
|
<template v-if="m.link"> · <Icon name="lucide:link" class="size-3" /> {{ m.link.key ? 'your link' : 'from a link' }}</template>
|
A settings for every part, overlap-free wiring with crossing styles, accounts with sync
- Clicking anything opens its settings: swap parts in place (wires stay on
matching pins), clock frequency per clock, keyboard keys for switches and
buttons, lamp/display colours, note sizes, component names on the canvas,
position, unlink all wires, unpack a component, make an independent copy.
- Wires of different signals never share a line: auto routes pick free
columns or detours, remaining clashes go on separate lanes. Crossings drawn
as bow, triangle, bridge, gap or plain.
- Accounts (email + scrypt password, httpOnly session) with two-way project
sync and conflict copies; per-account limits; cross-site writes refused.
- Compatibility suite: a project and both browser-storage layouts from
release a241adc must load and compute identically.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 11:09:37 +00:00
|
|
|
<template v-if="ed.account.value && m.cloud?.owner === ed.account.value.id">
|
|
|
|
|
· <Icon :name="m.dirty ? 'lucide:cloud-upload' : 'lucide:cloud-check'" class="size-3" /> {{ m.dirty ? 'saving to account' : 'in your account' }}
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="ed.account.value && !m.cloud"> · <Icon name="lucide:cloud-upload" class="size-3" /> uploading</template>
|
|
|
|
|
<template v-else-if="!ed.account.value"> · <Icon name="lucide:laptop" class="size-3" /> this browser only</template>
|
A component faces, project library with share links, fine-grained wire editing
- Lamps and hex displays inside a component show on its box with their
labels, lit by that instance's state; Counter 4 example shows its count.
- Several projects per browser; share links at /p/<id> that the creator's
edits save to automatically, others get their own copy. Export, open a
file as project, or add a file's components to the open project.
- Wires: drag any segment or corner, Alt+drag for a new bend, Ctrl+drag to
branch, double-click selects the whole signal, multi-select, arrow keys,
colour tags.
- Share-link API (POST/GET/PUT /api/p) on Nitro fs storage in data/, mounted
as a volume on edgerealm.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 11:21:49 +00:00
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="icon-btn" title="Rename" @click="startRename(m.id, m.name)"><Icon name="lucide:pencil" class="size-3.5" /></button>
|
|
|
|
|
<button class="icon-btn" title="Duplicate" @click="ed.duplicateProject(m.id); close()"><Icon name="lucide:copy" class="size-3.5" /></button>
|
|
|
|
|
<button v-if="confirmDelete !== m.id" class="icon-btn" title="Delete" @click="confirmDelete = m.id"><Icon name="lucide:trash-2" class="size-3.5" /></button>
|
|
|
|
|
<button v-else class="btn-sm btn-danger" @click="ed.deleteProject(m.id); confirmDelete = null">Delete?</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div class="mt-4 flex flex-wrap gap-2">
|
|
|
|
|
<button class="btn" @click="ed.newProject(false); close()"><Icon name="lucide:file" class="size-4" /> New (NAND only)</button>
|
|
|
|
|
<button class="btn" @click="ed.newProject(true); close()"><Icon name="lucide:file-plus" class="size-4" /> New with examples</button>
|
|
|
|
|
<button class="btn" @click="fileInput?.click()"><Icon name="lucide:folder-open" class="size-4" /> Open file</button>
|
|
|
|
|
<input ref="fileInput" type="file" accept="application/json,.json" class="hidden" @change="onFile" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|