2026-10-17 10:49:38 +00:00
|
|
|
<script setup lang="ts">
|
2026-10-20 17:29:16 +00:00
|
|
|
import { shortCount } from '~/lib/logic/analyze'
|
2026-10-17 10:49:38 +00:00
|
|
|
import { CHALLENGES } from '~/lib/logic/challenges'
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
import { campaignProgress, challengeName, challengeOpen, defUsable, isCampaign, KIND_UNLOCK, NEEDS } from '~/lib/logic/progress'
|
|
|
|
|
import { weekKey, weeklyId } from '~/lib/logic/puzzles'
|
2026-10-17 10:49:38 +00:00
|
|
|
import type { ComponentDef, NodeKind } from '~/lib/logic/types'
|
|
|
|
|
|
|
|
|
|
const ed = useEditor()
|
A main menu: free play, campaign, challenges and leaderboard over a circuit that builds itself
Logigate opens on a title screen. Continue, Free play (your own projects),
Campaign (progress and what is next), Challenges (every challenge and the
puzzle of the week in one Challenges project), Leaderboard (the best ten of
this and earlier weeks, your place, your records), Settings. Arrow keys,
Enter and Esc work through it; links still open straight into the editor.
Players can name themselves on the leaderboards. The logo in the editor
leads back to the menu.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 10:22:35 +00:00
|
|
|
const tab = ed.paletteTab
|
2026-10-17 10:49:38 +00:00
|
|
|
const query = ref('')
|
|
|
|
|
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
const { componentGroups, search } = useParts()
|
|
|
|
|
const { place, dragStart, dragEnd, pinned, unpin } = usePlace()
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
|
|
|
|
|
// ── Search: type to narrow everything down; arrows pick, Enter places ──
|
|
|
|
|
const searchInput = ref<HTMLInputElement>()
|
|
|
|
|
const hits = computed(() => (query.value.trim() ? search(query.value, 30) : []))
|
|
|
|
|
const at = ref(0)
|
|
|
|
|
watch(query, () => (at.value = 0))
|
|
|
|
|
watch(
|
|
|
|
|
() => ed.partSearch.value,
|
|
|
|
|
() => {
|
|
|
|
|
tab.value = 'parts'
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
searchInput.value?.focus()
|
|
|
|
|
searchInput.value?.select()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function onSearchKey(e: KeyboardEvent) {
|
|
|
|
|
const n = hits.value.length
|
|
|
|
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
if (n) at.value = (at.value + (e.key === 'ArrowDown' ? 1 : -1) + n) % n
|
|
|
|
|
} else if (e.key === 'Enter') {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
const h = hits.value[at.value]
|
|
|
|
|
if (h) {
|
|
|
|
|
pick(h.kind, h.chip)
|
|
|
|
|
query.value = ''
|
|
|
|
|
searchInput.value?.blur()
|
|
|
|
|
}
|
|
|
|
|
} else if (e.key === 'Escape') {
|
|
|
|
|
query.value = ''
|
|
|
|
|
searchInput.value?.blur()
|
2026-10-17 10:49:38 +00:00
|
|
|
}
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Groups that can be folded away; remembered in this browser ──
|
|
|
|
|
const FOLD_KEY = 'logigate:palette-folded'
|
|
|
|
|
const folded = ref<Set<string>>(
|
|
|
|
|
(() => {
|
|
|
|
|
try {
|
|
|
|
|
return new Set<string>(JSON.parse(localStorage.getItem(FOLD_KEY) ?? '[]'))
|
|
|
|
|
} catch {
|
|
|
|
|
return new Set<string>()
|
|
|
|
|
}
|
|
|
|
|
})(),
|
|
|
|
|
)
|
|
|
|
|
function fold(name: string) {
|
|
|
|
|
const next = new Set(folded.value)
|
|
|
|
|
if (!next.delete(name)) next.add(name)
|
|
|
|
|
folded.value = next
|
|
|
|
|
try {
|
|
|
|
|
localStorage.setItem(FOLD_KEY, JSON.stringify([...next]))
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
2026-10-17 10:49:38 +00:00
|
|
|
|
|
|
|
|
function pick(kind: NodeKind, chip?: string) {
|
|
|
|
|
if (chip && !ed.canPlace(chip)) return
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
if (!ed.canPlaceKind(kind)) {
|
|
|
|
|
ed.play('error')
|
|
|
|
|
return ed.notify(lockedHint(kind), 'error')
|
|
|
|
|
}
|
2026-10-17 10:49:38 +00:00
|
|
|
ed.placing.value = { kind, chip }
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-22 16:59:56 +00:00
|
|
|
function onDragStart(e: DragEvent, kind: NodeKind, chip?: string, conn?: string) {
|
2026-10-17 10:49:38 +00:00
|
|
|
if (chip && !ed.canPlace(chip)) {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return
|
|
|
|
|
}
|
2026-10-22 16:59:56 +00:00
|
|
|
e.dataTransfer?.setData('application/x-logigate', JSON.stringify({ kind, chip, conn }))
|
2026-10-17 10:49:38 +00:00
|
|
|
if (e.dataTransfer) e.dataTransfer.effectAllowed = 'copy'
|
2026-10-22 16:59:56 +00:00
|
|
|
ed.dragPart.value = { kind, chip, conn }
|
2026-10-17 10:49:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const solved = computed(() => new Set(ed.project.value.solved))
|
2026-10-20 17:29:16 +00:00
|
|
|
const best = computed(() => ed.project.value.best ?? {})
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
const solvedCount = computed(() => CHALLENGES.filter(c => solved.value.has(c.id)).length)
|
|
|
|
|
const campaign = computed(() => isCampaign(ed.project.value))
|
|
|
|
|
const progress = computed(() => campaignProgress(ed.project.value))
|
|
|
|
|
const open = (id: string) => challengeOpen(ed.project.value, id)
|
|
|
|
|
const needsText = (id: string) => `Solve ${(NEEDS[id] ?? []).filter(n => !solved.value.has(n)).map(challengeName).join(' and ')} first`
|
|
|
|
|
const puzzles = computed(() => (ed.project.value.puzzles ?? []).filter(p => !p.id.startsWith('week:') || p.id === weeklyId(weekKey())))
|
|
|
|
|
const weeklyStarted = computed(() => ed.project.value.components.some(d => d.challenge === weeklyId(weekKey())))
|
|
|
|
|
|
|
|
|
|
function lockedHint(kind: NodeKind) {
|
|
|
|
|
const by = KIND_UNLOCK[kind]
|
|
|
|
|
return by ? `Solve the ${challengeName(by)} challenge to unlock this part` : ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openWeekly() {
|
|
|
|
|
const spec = ed.project.value.puzzles?.find(p => p.id === weeklyId(weekKey()))
|
|
|
|
|
if (spec) ed.beginPuzzle(spec)
|
|
|
|
|
else void ed.openPuzzle('weekly')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function compTitle(d: ComponentDef) {
|
|
|
|
|
if (d.id === ed.def.value.id) return 'You are editing this one'
|
|
|
|
|
if (!defUsable(ed.project.value, d)) return 'Solve this challenge to use it as a part'
|
|
|
|
|
if (!ed.canPlace(d.id)) return 'Contains the circuit you are editing'
|
|
|
|
|
return d.description || 'Click, then click on the canvas to place'
|
|
|
|
|
}
|
2026-10-17 10:49:38 +00:00
|
|
|
const started = computed(() => new Map(ed.project.value.components.filter(d => d.challenge).map(d => [d.challenge!, d])))
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<aside class="palette">
|
|
|
|
|
<div class="tabs">
|
|
|
|
|
<button :class="{ active: tab === 'parts' }" @click="tab = 'parts'">Parts</button>
|
|
|
|
|
<button :class="{ active: tab === 'challenges' }" @click="tab = 'challenges'">
|
|
|
|
|
Challenges
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
<span class="count">{{ solvedCount }}/{{ CHALLENGES.length }}</span>
|
2026-10-17 10:49:38 +00:00
|
|
|
</button>
|
2026-10-21 08:09:43 +00:00
|
|
|
<button class="collapse-btn" title="Hide this panel ([)" @click="ed.toggleSidebar('left', false)">
|
|
|
|
|
<Icon name="lucide:panel-left-close" class="size-4" />
|
|
|
|
|
</button>
|
2026-10-17 10:49:38 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="tab === 'parts'" class="scroll">
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<div class="search part-search">
|
2026-10-17 10:49:38 +00:00
|
|
|
<Icon name="lucide:search" class="size-3.5 text-(--muted)" />
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<input ref="searchInput" v-model="query" placeholder="Find a part" @keydown="onSearchKey" />
|
|
|
|
|
<kbd v-if="!query" title="Press / on the canvas to search, Shift+A to add at the mouse">/</kbd>
|
|
|
|
|
<button v-else class="icon-btn" title="Clear (Esc)" @click="query = ''"><Icon name="lucide:x" class="size-3.5" /></button>
|
2026-10-17 10:49:38 +00:00
|
|
|
</div>
|
|
|
|
|
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<!-- Searching: one list of everything that matches -->
|
|
|
|
|
<template v-if="query.trim()">
|
|
|
|
|
<p v-if="!hits.length" class="hint px-3 pt-3">Nothing called "{{ query.trim() }}" fits here.</p>
|
|
|
|
|
<ul class="items mt-2">
|
|
|
|
|
<li v-for="(h, i) in hits" :key="h.chip ?? h.kind">
|
2026-10-17 10:49:38 +00:00
|
|
|
<button
|
|
|
|
|
class="item"
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
:class="{ active: i === at }"
|
|
|
|
|
:draggable="true"
|
|
|
|
|
@click="pick(h.kind, h.chip)"
|
|
|
|
|
@dragstart="onDragStart($event, h.kind, h.chip)"
|
2026-10-21 12:21:40 +00:00
|
|
|
@dragend="ed.dragPart.value = null"
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
@pointerenter="at = i"
|
2026-10-17 10:49:38 +00:00
|
|
|
>
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<span v-if="h.kind === 'nand'" class="nand-badge">&</span>
|
|
|
|
|
<Icon v-else :name="h.icon" class="size-4 shrink-0 text-(--muted)" />
|
|
|
|
|
<span class="grow truncate">{{ h.name }}</span>
|
|
|
|
|
<span class="group-tag">{{ h.group }}</span>
|
2026-10-17 10:49:38 +00:00
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<p class="hint px-3 pt-2">↑ ↓ to choose, Enter to place, Esc to clear.</p>
|
2026-10-17 10:49:38 +00:00
|
|
|
</template>
|
|
|
|
|
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<template v-else>
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
<!-- Pinned: the parts you use most, always at hand (pin more from the bar below) -->
|
|
|
|
|
<div class="pinned-head">
|
|
|
|
|
<span>Pinned</span>
|
|
|
|
|
<span class="hint">pin more from the bar below</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ul v-if="pinned.length" class="pinned">
|
|
|
|
|
<li v-for="p in pinned" :key="p.pin">
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<button
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
class="item"
|
|
|
|
|
:class="{ blocked: p.missing, active: !p.missing && ed.placing.value?.kind === p.kind && ed.placing.value?.chip === p.chip }"
|
|
|
|
|
:title="p.missing ? `${p.name} is not in this project, or not usable here yet` : `Place ${p.name}`"
|
|
|
|
|
:draggable="!p.missing"
|
|
|
|
|
@click="!p.missing && place(p.kind, p.chip)"
|
|
|
|
|
@dragstart="dragStart($event, p.kind, p.chip)"
|
|
|
|
|
@dragend="dragEnd"
|
2026-10-22 16:59:56 +00:00
|
|
|
>
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
<span v-if="p.kind === 'nand'" class="nand-badge">&</span>
|
|
|
|
|
<Icon v-else :name="p.icon" class="size-4 shrink-0 text-(--muted)" />
|
|
|
|
|
<span class="grow truncate">{{ p.name }}</span>
|
|
|
|
|
<kbd v-if="p.key">{{ p.key }}</kbd>
|
2026-10-22 16:59:56 +00:00
|
|
|
</button>
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
<button class="open" title="Unpin" @click="unpin(p.pin)"><Icon name="lucide:pin-off" class="size-3.5" /></button>
|
2026-10-22 16:59:56 +00:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
<p v-else class="hint px-3 pb-2">Nothing pinned. Point at a group in the bar below and pin what you use most.</p>
|
2026-10-22 16:59:56 +00:00
|
|
|
|
R a Figma-like workspace: a floating bottom bar of part kinds with flyouts, pinned parts on the left
- Bottom bar over the canvas: Logic, Inputs, Outputs, Wiring, Notes,
Connectors, Components (and search). Pointing at one opens its parts
above it: click to place, drag onto the canvas, pin to the left.
Connectors offer Out/In, edit and new type; components come grouped
with their transistor counts.
- Left panel: pinned parts first (NAND, AND, OR, NOT, XOR, input,
output, lamp, clock to start with; kept per browser, components by
name so they follow you into every project), then the circuits list.
The long list of built-in parts and the connector list moved to the
bar.
- Slimmer top bar and side panels; notices sit above the bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:04:43 +00:00
|
|
|
<div class="pinned-head mt-2"><span>Circuits</span></div>
|
A finer component boxes, a regrouped parts list with keyboard search, a real green for wires and cables
- Box designer: drag pins up or down to open gaps between groups; size (+/−) and turn (R) lamps, displays, screens and drawings; pixels belong to named screens, each placed on its own; displays of the components inside can be shown on the box (off unless ticked); a list of everything the box can show, each optional; the box grows to hold what it shows
- Lamps and displays deep inside placed components light up on the box
- Parts list: one search box for parts and components (letters in order match too), recently placed parts first, grouped Logic / Inputs / Outputs / Wiring / Notes, then components by group; groups fold away
- Keys: / searches the parts list (Enter starts placing), Shift+A or Ctrl+K adds a part at the mouse
- Wires and cables get a green; the default swatch shows grey, as the default really is
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 04:48:42 +00:00
|
|
|
<template v-for="g in componentGroups" :key="g.name">
|
|
|
|
|
<button class="group-head" @click="fold(`c:${g.name}`)">
|
|
|
|
|
<Icon :name="folded.has(`c:${g.name}`) ? 'lucide:chevron-right' : 'lucide:chevron-down'" class="size-3.5" />
|
|
|
|
|
<span>{{ g.name }}</span>
|
|
|
|
|
<span class="group-count">{{ g.defs.length }}</span>
|
|
|
|
|
</button>
|
|
|
|
|
<ul v-if="!folded.has(`c:${g.name}`)" class="items">
|
|
|
|
|
<li v-for="d in g.defs" :key="d.id" class="comp-row">
|
|
|
|
|
<button
|
|
|
|
|
class="item"
|
|
|
|
|
:class="{ active: ed.placing.value?.chip === d.id, current: d.id === ed.def.value.id, blocked: !ed.canPlace(d.id) }"
|
|
|
|
|
:title="compTitle(d)"
|
|
|
|
|
:draggable="ed.canPlace(d.id)"
|
|
|
|
|
@click="pick('chip', d.id)"
|
|
|
|
|
@dragstart="onDragStart($event, 'chip', d.id)"
|
|
|
|
|
@dragend="ed.dragPart.value = null"
|
|
|
|
|
>
|
|
|
|
|
<Icon :name="d.challenge && solved.has(d.challenge) ? 'lucide:badge-check' : 'lucide:box'" class="size-4 shrink-0" :class="d.challenge && solved.has(d.challenge) ? 'text-(--on)' : 'text-(--muted)'" />
|
|
|
|
|
<span class="grow truncate">{{ d.name }}</span>
|
|
|
|
|
<span v-if="d.id === ed.def.value.id" class="editing">editing</span>
|
|
|
|
|
<span v-else-if="ed.transistors(d.id)" class="tcount" :title="`${ed.transistors(d.id).toLocaleString()} transistors`">{{ shortCount(ed.transistors(d.id)) }}T</span>
|
|
|
|
|
</button>
|
|
|
|
|
<button v-if="d.id !== ed.def.value.id" class="open" title="Open and edit" @click="ed.open(d.id)">
|
|
|
|
|
<Icon name="lucide:pencil" class="size-3.5" />
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<div class="grid gap-2 px-3 pt-3 pb-4">
|
|
|
|
|
<button class="btn w-full" @click="ed.createComponent()">
|
|
|
|
|
<Icon name="lucide:plus" class="size-4" /> New component
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn btn-ghost w-full" title="NOT, AND, … up to a 4-bit counter, all built from NAND" @click="ed.loadExamples()">
|
|
|
|
|
<Icon name="lucide:library" class="size-4" /> Add example parts
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2026-10-17 10:49:38 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else class="scroll">
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
<div v-if="campaign" class="campaign">
|
|
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
|
<span class="font-semibold">Campaign</span>
|
|
|
|
|
<span class="tabular-nums text-(--muted)">{{ solvedCount }} / {{ CHALLENGES.length }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bar"><span :style="{ width: `${progress * 100}%` }" /></div>
|
|
|
|
|
<p>Every part you solve becomes yours to use. New parts and challenges open as you go.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<p v-else class="intro">
|
2026-10-17 10:49:38 +00:00
|
|
|
Build each part from NAND and the parts you already made. Start a challenge, wire it up, then press
|
|
|
|
|
<strong>Check</strong> on the right.
|
|
|
|
|
</p>
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
|
|
|
|
|
<div class="weekly">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<Icon name="lucide:calendar-days" class="size-4 shrink-0 text-(--accent)" />
|
|
|
|
|
<span class="grow font-medium">Puzzle of the week</span>
|
|
|
|
|
<button class="btn-sm" @click="openWeekly">{{ weeklyStarted ? 'Open' : 'Play' }}</button>
|
|
|
|
|
</div>
|
|
|
|
|
<p>A new logic puzzle every Monday, the same for everyone. Fewest transistors wins.</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<template v-if="puzzles.length">
|
|
|
|
|
<h3>Puzzles</h3>
|
|
|
|
|
<ul class="challenges">
|
|
|
|
|
<li v-for="p in puzzles" :key="p.id" :class="{ solved: solved.has(p.id) }">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<Icon :name="solved.has(p.id) ? 'lucide:circle-check' : 'lucide:puzzle'" class="size-4 shrink-0" :class="solved.has(p.id) ? 'text-(--on)' : 'text-(--muted)'" />
|
|
|
|
|
<span class="grow font-medium">{{ p.name }}</span>
|
|
|
|
|
<button class="btn-sm" @click="ed.beginPuzzle(p)">Open</button>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="pins">
|
|
|
|
|
{{ p.inputs.join(', ') }} → {{ p.outputs.join(', ') }}
|
|
|
|
|
<span v-if="best[p.id] !== undefined" class="best"> · best {{ best[p.id]!.toLocaleString() }} transistors</span>
|
|
|
|
|
</p>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<h3>Challenges</h3>
|
2026-10-17 10:49:38 +00:00
|
|
|
<ul class="challenges">
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
<li v-for="c in CHALLENGES" :key="c.id" :class="{ solved: solved.has(c.id), locked: !open(c.id) }">
|
2026-10-17 10:49:38 +00:00
|
|
|
<div class="flex items-center gap-2">
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
<Icon
|
|
|
|
|
:name="solved.has(c.id) ? 'lucide:circle-check' : open(c.id) ? 'lucide:circle' : 'lucide:lock'"
|
|
|
|
|
class="size-4 shrink-0"
|
|
|
|
|
:class="solved.has(c.id) ? 'text-(--on)' : 'text-(--muted)'"
|
|
|
|
|
/>
|
2026-10-17 10:49:38 +00:00
|
|
|
<span class="grow font-medium">{{ c.name }}</span>
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
<button class="btn-sm" :disabled="!open(c.id) && !started.has(c.id)" :title="open(c.id) ? '' : needsText(c.id)" @click="ed.beginChallenge(c)">
|
|
|
|
|
{{ started.has(c.id) ? 'Open' : 'Start' }}
|
|
|
|
|
</button>
|
2026-10-17 10:49:38 +00:00
|
|
|
</div>
|
A campaign with unlocks, synthesised sound, puzzles and the puzzle of the week
- Campaign projects start with NAND only; challenges open along a
dependency chain, each solution becomes a usable part, and basic parts
unlock on the way. Locked parts and challenges say what opens them.
- Sound effects made with Web Audio: place, connect, switches, buttons,
delete, clock ticks (opt-in), solve, fail, unlock, record. Mute and
volume in the top bar and Display settings.
- Publish any circuit as a puzzle link; only its behaviour is shared.
The server re-runs the checks on submitted solutions, counts their
transistors and keeps each player's best; the board shows a histogram
and your place. A generated puzzle of the week for everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:54:57 +00:00
|
|
|
<p v-if="!open(c.id)" class="needs">{{ needsText(c.id) }}</p>
|
2026-10-17 10:49:38 +00:00
|
|
|
<p>{{ c.goal }}</p>
|
2026-10-20 17:29:16 +00:00
|
|
|
<p class="pins">
|
|
|
|
|
{{ c.inputs.join(', ') }} → {{ c.outputs.join(', ') }}
|
|
|
|
|
<span v-if="best[c.id] !== undefined" class="best" title="Fewest transistors in a passing solution so far">
|
|
|
|
|
· best {{ best[c.id]!.toLocaleString() }} transistors
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
2026-10-17 10:49:38 +00:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</aside>
|
|
|
|
|
</template>
|