2026-10-17 10:49:38 +00:00
< script setup lang = "ts" >
2026-10-20 17:29:16 +00:00
import type { ChallengeCheck } from '~/composables/useEditor'
import { tableMarkdown , type TruthTable } from '~/lib/logic/analyze'
import { cableOf } from '~/lib/logic/cables'
2026-10-17 10:49:38 +00:00
import { CHALLENGES } from '~/lib/logic/challenges'
import { chipPins } from '~/lib/logic/geometry'
import { usages } from '~/lib/logic/ops'
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
import { WIRE _COLORS , type CrossingStyle , type SymbolKind } from '~/lib/logic/types'
2026-10-17 10:49:38 +00:00
const ed = useEditor ( )
const def = ed . def
const SYMBOLS : { value : SymbolKind ; label : string } [ ] = [
{ value : 'box' , label : 'Box with name' } ,
{ value : 'and' , label : 'AND gate' } ,
{ value : 'or' , label : 'OR gate' } ,
{ value : 'xor' , label : 'XOR gate' } ,
{ value : 'not' , label : 'NOT gate' } ,
{ value : 'buf' , label : 'Buffer' } ,
{ value : 'nand' , label : 'NAND gate' } ,
{ value : 'nor' , label : 'NOR gate' } ,
{ value : 'xnor' , label : 'XNOR gate' } ,
]
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
const single = computed ( ( ) =>
ed . selection . value . length === 1 && ! ed . wireSel . value . length ? def . value . nodes . find ( n => n . id === ed . selection . value [ 0 ] ) : undefined ,
)
const wires = ed . selectedWires
const wireColor = computed ( ( ) => {
const colors = new Set ( wires . value . map ( w => w . color ? ? '' ) )
return colors . size === 1 ? [ ... colors ] [ 0 ] : null
} )
2026-10-20 17:29:16 +00:00
const hasFace = computed ( ( ) => def . value . nodes . some ( n => n . kind === 'lamp' || n . kind === 'hex' || n . kind === 'pixel' ) )
2026-10-17 10:49:38 +00:00
const nameInput = ref < HTMLInputElement > ( )
watch (
( ) => ed . labelFocus . value ,
( ) =>
nextTick ( ( ) => {
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
if ( single . value ) return
nameInput . value ? . focus ( )
nameInput . value ? . select ( )
2026-10-17 10:49:38 +00:00
} ) ,
)
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
const CROSSINGS : { value : CrossingStyle ; label : string } [ ] = [
{ value : 'bow' , label : 'Bow' } ,
{ value : 'triangle' , label : 'Triangle' } ,
{ value : 'bridge' , label : 'Bridge' } ,
{ value : 'gap' , label : 'Gap' } ,
{ value : 'plain' , label : 'Plain' } ,
]
const settings = computed ( ( ) => ed . project . value . settings )
function setCrossing ( c : CrossingStyle ) {
settings . value . crossing = c
ed . persist ( )
}
2026-10-17 10:49:38 +00:00
const pins = computed ( ( ) => chipPins ( def . value ) )
const users = computed ( ( ) => usages ( ed . project . value , def . value . id ) )
const groupNames = computed ( ( ) => [ ... new Set ( ed . project . value . components . map ( d => d . group ) . filter ( Boolean ) ) ] )
const challenge = computed ( ( ) => CHALLENGES . find ( c => c . id === def . value . challenge ) )
const solved = computed ( ( ) => ! ! challenge . value && ed . project . value . solved . includes ( challenge . value . id ) )
const packName = ref ( '' )
function pack ( ) {
ed . packageSelected ( packName . value || 'Part' )
packName . value = ''
}
const showTable = ref ( false )
const table = ref < TruthTable | { error : string } | null > ( null )
function refreshTable ( ) {
table . value = showTable . value ? ed . table ( ) : null
}
watch ( [ showTable , ( ) => ed . sim . value , ( ) => def . value . id ] , refreshTable )
2026-10-20 17:29:16 +00:00
const check = ref < ChallengeCheck | null > ( null )
const bestHere = computed ( ( ) => ( challenge . value ? ed . project . value . best ? . [ challenge . value . id ] : undefined ) )
const cable = computed ( ( ) => ( wires . value . length === 1 ? cableOf ( def . value , wires . value [ 0 ] ! ) : undefined ) )
2026-10-17 10:49:38 +00:00
watch ( ( ) => def . value . id , ( ) => ( check . value = null ) )
watch ( ( ) => ed . sim . value , ( ) => ( check . value = null ) )
function runCheck ( ) {
check . value = ed . checkChallenge ( )
}
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
function toggleFace ( e : Event ) {
def . value . face = ( e . target as HTMLInputElement ) . checked
2026-10-17 10:49:38 +00:00
ed . commit ( false )
}
const confirmDelete = ref ( false )
watch ( ( ) => def . value . id , ( ) => ( confirmDelete . value = false ) )
< / script >
< template >
< aside class = "inspector" >
< div class = "scroll" >
<!-- Selection -- >
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
< EditorNodeSettings v -if = " single " :key ="single.id" :node ="single" / >
2026-10-17 10:49:38 +00:00
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
< section v -else -if = " ed.selection.value.length > 1 || ( ed . selection . value . length && wires . length ) " >
< h3 >
{ { ed . selection . value . length } } part { { ed . selection . value . length === 1 ? '' : 's' } } < template v-if ="wires.length" > , {{ wires.length }} wire {{ wires.length = = = 1 ? ' ' : ' s ' }} < / template > selected
< / h3 >
2026-10-17 10:49:38 +00:00
< p class = "hint" > Turn them into a reusable component . Wires that cross the selection border become its pins . < / p >
< label class = "field" >
< span > Component name < / span >
< input v -model = " packName " placeholder = "e.g. Half Adder" @keydown.enter ="pack" / >
< / label >
< button class = "btn btn-primary w-full" @click ="pack" > < Icon name = "lucide:package" class = "size-4" / > Make component < / button >
A input panels, automatic names, one-by-one wiring, tidy routing, truth table export
- Input panel part: rows of switches, buttons and clocks. "Attach input
panel" docks one to a component with a row per free input; it moves
with the component and follows its pins.
- Copies and new pins continue name series (D0 -> D1, A -> B); unnamed
switches, lamps and pins take the name of the component pin they are
wired to.
- Connecting: target pins are ringed, dropping on a part uses its next
free pin, click-then-click works, and "Connect one by one" (W) wires a
selection's pins in turn.
- Tidy wiring option and "Tidy all wires": sorted, evenly spaced columns
per gap, one trunk per signal, fewer crossings.
- Truth table full screen, CSV download, copy as Markdown, current row
highlighted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:17:25 +00:00
< button class = "btn mt-2 w-full" title = "Their pins in order, top to bottom: click where each one goes (W)" @click ="ed.startLinking()" >
< Icon name = "lucide:cable" class = "size-4" / > Connect one by one
< / button >
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
< div class = "mt-2 grid grid-cols-2 gap-2" >
< button class = "btn" title = "Remove every wire attached to the selected parts" @click ="ed.unlink(ed.selection.value)" > < Icon name = "lucide:unlink" class = "size-4" / > Unlink all < / button >
< button class = "btn" @click ="ed.duplicate()" > < Icon name = "lucide:copy" class = "size-4" / > Duplicate < / button >
< / div >
2026-10-17 10:49:38 +00:00
< button class = "btn btn-ghost mt-2 w-full" @click ="ed.deleteSelected()" > < Icon name = "lucide:trash-2" class = "size-4" / > Delete < / button >
< / section >
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
< section v -else -if = " wires.length " >
< h3 > { { wires . length === 1 ? 'Wire' : ` ${ wires . length } wires ` } } < / h3 >
< div class = "field" >
< span > Colour < / span >
< div class = "swatches" >
< button class = "swatch none" : class = "{ active: wireColor === '' }" title = "Default" @click ="ed.setWireColor(undefined)" / >
< button
v - for = "c in WIRE_COLORS"
: key = "c"
class = "swatch"
: class = "[`c-${c}`, { active: wireColor === c }]"
: title = "c"
@ click = "ed.setWireColor(c)"
/ >
< / div >
< / div >
< ul class = "tips" >
< li > < strong > Drag < / strong > a segment to move it , a < strong > corner square < / strong > to move a bend . < / li >
< li > < strong > Alt + drag < / strong > pulls a new bend out of a segment . < / li >
< li > < strong > Ctrl + drag < / strong > starts a new wire from this signal . < / li >
< li > < strong > Double - click < / strong > selects the whole signal , < strong > Shift + click < / strong > adds wires . < / li >
< li > < strong > Arrow keys < / strong > shift the selected wires . < / li >
< / ul >
< div class = "grid grid-cols-2 gap-2" >
< button v-if ="wires.length === 1" class="btn" @click="ed.selectNet(wires[0]!.id)" > < Icon name = "lucide:git-fork" class = "size-4" / > Whole signal < / button >
< button class = "btn" : disabled = "!wires.some(w => w.pts)" @click ="ed.autoRoute()" > < Icon name = "lucide:wand-sparkles" class = "size-4" / > Auto route < / button >
< / div >
2026-10-20 17:29:16 +00:00
< button
v - if = "wires.length >= 2"
class = "btn mt-2 w-full"
title = "Replace these wires with one cable: a bundle after their sources, a split before their targets"
@ click = "ed.bundleSelected()"
>
< Icon name = "lucide:merge" class = "size-4" / > Bundle into cable
< / button >
< button v-if ="cable" class="btn mt-2 w-full" title="Take the cable apart again into single wires" @click="ed.removeCable(cable.id)" >
< Icon name = "lucide:split" class = "size-4" / > Remove cable
< / button >
2026-10-17 10:49:38 +00:00
< button class = "btn btn-ghost mt-2 w-full" @click ="ed.deleteSelected()" > < Icon name = "lucide:trash-2" class = "size-4" / > Delete < / button >
< / section >
<!-- Challenge -- >
< section v-if ="challenge" class="challenge" :class="{ solved }" >
< h3 >
< Icon : name = "solved ? 'lucide:badge-check' : 'lucide:flag'" class = "size-4" / >
Challenge : { { challenge . name } }
< / h3 >
< p > { { challenge . goal } } < / p >
< p class = "pins" > Pins : { { challenge . inputs . join ( ', ' ) } } → { { challenge . outputs . join ( ', ' ) } } < / p >
< button class = "btn btn-primary w-full" @click ="runCheck" > < Icon name = "lucide:play" class = "size-4" / > Check < / button >
< p v-if ="check" class="result" :class="check.pass ? 'pass' : 'fail'" >
< Icon : name = "check.pass ? 'lucide:circle-check' : 'lucide:circle-x'" class = "size-4 shrink-0" / >
{ { check . message } }
< / p >
2026-10-20 17:29:16 +00:00
< p class = "score" >
< Icon name = "lucide:cpu" class = "size-4 shrink-0" / >
< span >
{ { ed . transistors ( def . id ) . toLocaleString ( ) } } transistors now < template v-if ="bestHere !== undefined" > , best < strong > { { bestHere . toLocaleString ( ) } } < / strong > < / template >
< / span >
< / p >
< p v-if ="check?.pass && check.record !== undefined" class="result pass" >
< Icon name = "lucide:trophy" class = "size-4 shrink-0" / > New record ! { { check . record - check . transistors } } fewer than before ( { { check . record } } ) .
< / p >
< p v -else -if = " check ? .pass & & check.best = = = check.transistors " class = "hint" > Fewer transistors is better : 4 per NAND gate . Can you make it smaller ? < / p >
2026-10-17 10:49:38 +00:00
< / section >
<!-- Circuit -- >
< section >
< h3 > This circuit < / h3 >
< label class = "field" >
< span > Name < / span >
< input ref = "nameInput" v -model = " def.name " @change ="ed.commit(false)" @ keydown.enter = " ( $ event.target as HTMLInputElement ) .blur ( ) " / >
< / label >
< label class = "field" >
< span > Description < / span >
< textarea v -model = " def.description " rows = "2" placeholder = "What does it do?" @change ="ed.commit(false)" / >
< / label >
< div class = "grid grid-cols-2 gap-2" >
< label class = "field" >
< span > Drawn as < / span >
< select v-model ="def.symbol" @change="ed.commit(false)" >
< option v-for ="s in SYMBOLS" :key="s.value" :value="s.value" > {{ s.label }} < / option >
< / select >
< / label >
< label class = "field" >
< span > Group < / span >
< input v -model = " def.group " list = "groups" placeholder = "My components" @change ="ed.commit(false)" / >
< datalist id = "groups" >
< option v -for = " g in groupNames " :key ="g" :value ="g" / >
< / datalist >
< / label >
< / div >
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
< label v-if ="hasFace" class="check" >
< input type = "checkbox" : checked = "def.face !== false" @change ="toggleFace" / >
Show its lamps and displays on the component box
< / label >
2026-10-17 10:49:38 +00:00
< dl class = "stats" >
< dt > Pins < / dt >
< dd > { { pins . inputs . length } } in , { { pins . outputs . length } } out < / dd >
< dt > NAND gates < / dt >
< dd > { { ed . circuitStats . value . nands . toLocaleString ( ) } } < / dd >
2026-10-20 17:29:16 +00:00
< dt title = "CMOS: 4 transistors per NAND gate" > Transistors < / dt >
< dd > { { ed . transistors ( def . id ) . toLocaleString ( ) } } < / dd >
2026-10-17 10:49:38 +00:00
< dt > { { ed . circuitStats . value . sequential ? 'Memory' : 'Delay' } } < / dt >
< dd > { { ed . circuitStats . value . sequential ? 'yes (feedback loops)' : ` ${ ed . circuitStats . value . delay } gates ` } } < / dd >
< / dl >
< p v-for ="err in ed.errors.value" :key="err" class="result fail" >
< Icon name = "lucide:triangle-alert" class = "size-4 shrink-0" / > { { err } }
< / p >
< p v-if ="users.length" class="hint" >
Used in
< template v-for ="(u, i) in users" :key="u.id" >
< a href = "#" @click.prevent ="ed.open(u.id)" > { { u . name } } < / a > < template v-if ="i < users.length - 1" > , < / template >
< / template >
< / p >
< / section >
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
< section v-if ="!single && !wires.length && !ed.selection.value.length" >
< h3 > Display < / h3 >
< div class = "field" >
< span > Gate symbols < / span >
< div class = "seg" >
< button : class = "{ active: settings.symbols === 'iec' }" @ click = "settings.symbols = 'iec'; ed.persist()" > IEC ( DIN ) < / button >
< button : class = "{ active: settings.symbols === 'ansi' }" @ click = "settings.symbols = 'ansi'; ed.persist()" > ANSI < / button >
< / div >
< / div >
< div class = "field" >
< span > Where unconnected wires cross < / span >
< div class = "crossings" >
< button
v - for = "c in CROSSINGS"
: key = "c.value"
class = "crossing"
: class = "{ active: (settings.crossing ?? 'bow') === c.value }"
: title = "c.label"
@ click = "setCrossing(c.value)"
>
< EditorCrossingIcon :style ="c.value" / >
< span > { { c . label } } < / span >
< / button >
< / div >
< / div >
< label class = "check" >
< input type = "checkbox" :checked ="settings.flow" @ change = "settings.flow = !settings.flow; ed.persist()" / >
Animate current flow on wires that carry a 1
< / label >
A input panels, automatic names, one-by-one wiring, tidy routing, truth table export
- Input panel part: rows of switches, buttons and clocks. "Attach input
panel" docks one to a component with a row per free input; it moves
with the component and follows its pins.
- Copies and new pins continue name series (D0 -> D1, A -> B); unnamed
switches, lamps and pins take the name of the component pin they are
wired to.
- Connecting: target pins are ringed, dropping on a part uses its next
free pin, click-then-click works, and "Connect one by one" (W) wires a
selection's pins in turn.
- Tidy wiring option and "Tidy all wires": sorted, evenly spaced columns
per gap, one trunk per signal, fewer crossings.
- Truth table full screen, CSV download, copy as Markdown, current row
highlighted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:17:25 +00:00
< label class = "check" >
< input type = "checkbox" :checked ="!!settings.tidy" @change ="ed.setTidy(!settings.tidy)" / >
Tidy wiring : sorted parallel runs , one trunk per signal , fewer crossings
< / label >
< button class = "btn w-full" title = "Remove hand-placed bends in this circuit and lay out every wire tidily (undo brings them back)" @click ="ed.tidyAll()" >
< Icon name = "lucide:wand-sparkles" class = "size-4" / > Tidy all wires
< / button >
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
< / section >
2026-10-17 10:49:38 +00:00
< section >
A input panels, automatic names, one-by-one wiring, tidy routing, truth table export
- Input panel part: rows of switches, buttons and clocks. "Attach input
panel" docks one to a component with a row per free input; it moves
with the component and follows its pins.
- Copies and new pins continue name series (D0 -> D1, A -> B); unnamed
switches, lamps and pins take the name of the component pin they are
wired to.
- Connecting: target pins are ringed, dropping on a part uses its next
free pin, click-then-click works, and "Connect one by one" (W) wires a
selection's pins in turn.
- Tidy wiring option and "Tidy all wires": sorted, evenly spaced columns
per gap, one trunk per signal, fewer crossings.
- Truth table full screen, CSV download, copy as Markdown, current row
highlighted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:17:25 +00:00
< div class = "flex items-center gap-1" >
< button class = "section-toggle grow" @ click = "showTable = !showTable" >
< Icon : name = "showTable ? 'lucide:chevron-down' : 'lucide:chevron-right'" class = "size-4" / >
Truth table
< / button >
< template v-if ="showTable && table && !('error' in table)" >
< button class = "icon-btn" title = "Download as CSV" @click ="ed.exportTable(table)" > < Icon name = "lucide:download" class = "size-3.5" / > < / button >
< button class = "icon-btn" title = "Copy as a Markdown table" @ click = "ed.copyText(tableMarkdown(table), 'Truth table copied')" >
< Icon name = "lucide:clipboard-copy" class = "size-3.5" / >
< / button >
< / template >
< button class = "icon-btn" title = "Full screen" @ click = "ed.dialog.value = 'table'" > < Icon name = "lucide:maximize-2" class = "size-3.5" / > < / button >
< / div >
2026-10-17 10:49:38 +00:00
< template v-if ="showTable && table" >
< p v-if ="'error' in table" class="hint" > {{ table.error }} < / p >
< template v-else >
< p v-if ="ed.circuitStats.value.sequential" class="hint" > This circuit stores state , so the table depends on the order the rows are tried in. < / p >
A input panels, automatic names, one-by-one wiring, tidy routing, truth table export
- Input panel part: rows of switches, buttons and clocks. "Attach input
panel" docks one to a component with a row per free input; it moves
with the component and follows its pins.
- Copies and new pins continue name series (D0 -> D1, A -> B); unnamed
switches, lamps and pins take the name of the component pin they are
wired to.
- Connecting: target pins are ringed, dropping on a part uses its next
free pin, click-then-click works, and "Connect one by one" (W) wires a
selection's pins in turn.
- Tidy wiring option and "Tidy all wires": sorted, evenly spaced columns
per gap, one trunk per signal, fewer crossings.
- Truth table full screen, CSV download, copy as Markdown, current row
highlighted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:17:25 +00:00
< EditorTruthTable :table ="table" / >
2026-10-17 10:49:38 +00:00
< / template >
< / template >
< / section >
< section class = "actions" >
< button class = "btn btn-ghost" @click ="ed.copyComponent(def.id)" > < Icon name = "lucide:copy" class = "size-4" / > Duplicate < / button >
< button v-if ="!confirmDelete" class="btn btn-ghost" @click="confirmDelete = true" > < Icon name = "lucide:trash-2" class = "size-4" / > Delete < / button >
< button v -else class = "btn btn-danger" @ click = "ed.removeComponent(def.id); confirmDelete = false" > Really delete ? < / button >
< / section >
< / div >
< / aside >
< / template >