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
|
|
|
<script setup lang="ts">
|
|
|
|
|
// The title screen: what you see when Logigate opens. A circuit builds
|
|
|
|
|
// itself in the background; the menu picks how to play. Arrow keys move
|
|
|
|
|
// through it, Enter chooses, Esc goes back.
|
|
|
|
|
import type { MenuPage } from '~/composables/useEditor'
|
|
|
|
|
|
|
|
|
|
const ed = useEditor()
|
|
|
|
|
const page = ed.menuPage
|
|
|
|
|
const nav = ref<HTMLElement>()
|
|
|
|
|
|
|
|
|
|
const ITEMS: { page?: MenuPage; label: string; icon: string; sub: string }[] = [
|
R saves like a game: one save per project on every device, Load game in the menu, a pause menu, and a lean side panel
- Sync: when two devices changed the same project, the newer save wins
everywhere and the other becomes a savegame of it (new endpoint to keep
a savegame without replacing the save), never an "(other device)" copy.
A first visit keeps its starter unsaved until something changes, and
the main menu waits for the account's saves before anything starts.
- Main menu: Load game lists every save. In the editor, Esc with nothing
selected (or the project button) opens a pause menu: Resume, Save,
Save as copy, Load, Settings, How to play, Main menu. The projects
dialog is gone.
- Selection tab: name and transistors on top, one icon row (open,
duplicate, unlink, delete, more = the right-click menu), only the
settings that matter for the part; pins, component tools, keys, cable
and panel options fold away and remember it. X/Y fields removed.
The Circuit tab folds its component settings, transistor breakdown
and tools the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:36:17 +00:00
|
|
|
{ page: 'load', label: 'Load game', icon: 'lucide:folder-open', sub: 'Every save: open, rename, copy, savegames' },
|
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
|
|
|
{ page: 'free', label: 'Free play', icon: 'lucide:cpu', sub: 'Every part from the start, your own projects' },
|
|
|
|
|
{ page: 'campaign', label: 'Campaign', icon: 'lucide:route', sub: 'Start with NAND, earn each part you build' },
|
|
|
|
|
{ page: 'challenges', label: 'Challenges', icon: 'lucide:target', sub: 'Single tasks and the puzzle of the week' },
|
|
|
|
|
{ page: 'leaderboard', label: 'Leaderboard', icon: 'lucide:trophy', sub: 'Fewest transistors wins' },
|
|
|
|
|
]
|
|
|
|
|
|
R saves like a game: one save per project on every device, Load game in the menu, a pause menu, and a lean side panel
- Sync: when two devices changed the same project, the newer save wins
everywhere and the other becomes a savegame of it (new endpoint to keep
a savegame without replacing the save), never an "(other device)" copy.
A first visit keeps its starter unsaved until something changes, and
the main menu waits for the account's saves before anything starts.
- Main menu: Load game lists every save. In the editor, Esc with nothing
selected (or the project button) opens a pause menu: Resume, Save,
Save as copy, Load, Settings, How to play, Main menu. The projects
dialog is gone.
- Selection tab: name and transistors on top, one icon row (open,
duplicate, unlink, delete, more = the right-click menu), only the
settings that matter for the part; pins, component tools, keys, cable
and panel options fold away and remember it. X/Y fields removed.
The Circuit tab folds its component settings, transistor breakdown
and tools the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:36:17 +00:00
|
|
|
const TITLES: Record<MenuPage, string> = { main: '', load: 'Load game', free: 'Free play', campaign: 'Campaign', challenges: 'Challenges', leaderboard: 'Leaderboard' }
|
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
|
|
|
|
|
|
|
|
function go(p: MenuPage) {
|
|
|
|
|
page.value = page.value === p ? 'main' : p
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function buttons() {
|
|
|
|
|
return [...(nav.value?.querySelectorAll<HTMLButtonElement>('button') ?? [])]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onKey(e: KeyboardEvent) {
|
|
|
|
|
if (ed.dialog.value || ed.showHelp.value) return
|
|
|
|
|
const t = e.target as HTMLElement
|
|
|
|
|
const typing = t.closest('input, textarea, select, [contenteditable]')
|
|
|
|
|
if (e.key === 'Escape') {
|
|
|
|
|
if (typing) return (t as HTMLElement).blur()
|
|
|
|
|
if (page.value !== 'main') {
|
|
|
|
|
page.value = 'main'
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (typing || (e.key !== 'ArrowDown' && e.key !== 'ArrowUp')) return
|
|
|
|
|
// Up and down move through the menu; from inside a page they go back to it.
|
|
|
|
|
const list = buttons()
|
|
|
|
|
const at = list.indexOf(document.activeElement as HTMLButtonElement)
|
|
|
|
|
const next = at < 0 ? (e.key === 'ArrowDown' ? 0 : list.length - 1) : (at + (e.key === 'ArrowDown' ? 1 : -1) + list.length) % list.length
|
|
|
|
|
list[next]?.focus()
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
window.addEventListener('keydown', onKey)
|
|
|
|
|
nextTick(() => buttons()[0]?.focus())
|
|
|
|
|
})
|
|
|
|
|
onBeforeUnmount(() => window.removeEventListener('keydown', onKey))
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="title-screen">
|
|
|
|
|
<EditorMenuBackground />
|
|
|
|
|
<div class="title-shade" />
|
|
|
|
|
<div class="title-layout" :class="{ open: page !== 'main' }">
|
|
|
|
|
<div class="title-side">
|
|
|
|
|
<div class="title-logo">
|
|
|
|
|
<svg viewBox="0 0 32 32" aria-hidden="true">
|
|
|
|
|
<path d="M6 7h10a9 9 0 0 1 0 18H6Z" fill="none" stroke="currentColor" stroke-width="2.5" />
|
|
|
|
|
<circle cx="27" cy="16" r="2.6" fill="none" stroke="currentColor" stroke-width="2.2" />
|
|
|
|
|
</svg>
|
|
|
|
|
<h1>Logigate</h1>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="title-tag">From one NAND gate to a computer</p>
|
|
|
|
|
|
|
|
|
|
<nav ref="nav" class="title-nav" aria-label="Main menu">
|
R saves like a game: one save per project on every device, Load game in the menu, a pause menu, and a lean side panel
- Sync: when two devices changed the same project, the newer save wins
everywhere and the other becomes a savegame of it (new endpoint to keep
a savegame without replacing the save), never an "(other device)" copy.
A first visit keeps its starter unsaved until something changes, and
the main menu waits for the account's saves before anything starts.
- Main menu: Load game lists every save. In the editor, Esc with nothing
selected (or the project button) opens a pause menu: Resume, Save,
Save as copy, Load, Settings, How to play, Main menu. The projects
dialog is gone.
- Selection tab: name and transistors on top, one icon row (open,
duplicate, unlink, delete, more = the right-click menu), only the
settings that matter for the part; pins, component tools, keys, cable
and panel options fold away and remember it. X/Y fields removed.
The Circuit tab folds its component settings, transistor breakdown
and tools the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:36:17 +00:00
|
|
|
<button class="title-item primary" :disabled="!ed.savesReady.value" @click="ed.enterGame()">
|
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
|
|
|
<Icon name="lucide:play" class="size-5 shrink-0" />
|
|
|
|
|
<span class="grow">
|
|
|
|
|
<span class="label">Continue</span>
|
R saves like a game: one save per project on every device, Load game in the menu, a pause menu, and a lean side panel
- Sync: when two devices changed the same project, the newer save wins
everywhere and the other becomes a savegame of it (new endpoint to keep
a savegame without replacing the save), never an "(other device)" copy.
A first visit keeps its starter unsaved until something changes, and
the main menu waits for the account's saves before anything starts.
- Main menu: Load game lists every save. In the editor, Esc with nothing
selected (or the project button) opens a pause menu: Resume, Save,
Save as copy, Load, Settings, How to play, Main menu. The projects
dialog is gone.
- Selection tab: name and transistors on top, one icon row (open,
duplicate, unlink, delete, more = the right-click menu), only the
settings that matter for the part; pins, component tools, keys, cable
and panel options fold away and remember it. X/Y fields removed.
The Circuit tab folds its component settings, transistor breakdown
and tools the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:36:17 +00:00
|
|
|
<span class="sub">{{ ed.savesReady.value ? ed.project.value.name : 'Loading your saves…' }}</span>
|
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
|
|
|
</span>
|
|
|
|
|
</button>
|
R saves like a game: one save per project on every device, Load game in the menu, a pause menu, and a lean side panel
- Sync: when two devices changed the same project, the newer save wins
everywhere and the other becomes a savegame of it (new endpoint to keep
a savegame without replacing the save), never an "(other device)" copy.
A first visit keeps its starter unsaved until something changes, and
the main menu waits for the account's saves before anything starts.
- Main menu: Load game lists every save. In the editor, Esc with nothing
selected (or the project button) opens a pause menu: Resume, Save,
Save as copy, Load, Settings, How to play, Main menu. The projects
dialog is gone.
- Selection tab: name and transistors on top, one icon row (open,
duplicate, unlink, delete, more = the right-click menu), only the
settings that matter for the part; pins, component tools, keys, cable
and panel options fold away and remember it. X/Y fields removed.
The Circuit tab folds its component settings, transistor breakdown
and tools the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:36:17 +00:00
|
|
|
<button
|
|
|
|
|
v-for="it in ITEMS"
|
|
|
|
|
:key="it.label"
|
|
|
|
|
class="title-item"
|
|
|
|
|
:class="{ active: page === it.page }"
|
|
|
|
|
:disabled="!ed.savesReady.value && it.page !== 'leaderboard'"
|
|
|
|
|
:title="ed.savesReady.value ? '' : 'Loading your saves from your account…'"
|
|
|
|
|
@click="go(it.page!)"
|
|
|
|
|
>
|
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
|
|
|
<Icon :name="it.icon" class="size-5 shrink-0" />
|
|
|
|
|
<span class="grow">
|
|
|
|
|
<span class="label">{{ it.label }}</span>
|
|
|
|
|
<span class="sub">{{ it.sub }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<Icon name="lucide:chevron-right" class="chev size-4 shrink-0" />
|
|
|
|
|
</button>
|
A public library of components: publish yours, add everybody's
"Publish to the library…" in the menu on a circuit's name (or Space)
sends the component with every component it uses and their connector
types, under your leaderboard name. The server checks it like any
project, refuses what is missing, inside itself, nested too deep or too
big to run, and counts its transistors and pins itself. Publishing again
from the same browser makes the next version of the same entry; only that
browser holds the entry's key, so only it can update or remove it.
Challenge circuits and puzzle solutions stay private.
The Library (Components in the bottom bar, Space, the main menu) lists
every entry, newest first, searchable by name, description and author,
with a picture of its box, its transistors, pins and what comes along.
Add brings an entry into the open project and starts placing it: what the
project has in exactly that form already is used as it is, the rest comes
with new ids, a taken name gets a number, connector types join one with
the same lines. The This panel says where a component came from and
offers a newer version, which replaces it in place. A campaign only adds
what is built from parts it has earned, and its challenges take nothing
from the library.
Components keep an optional "from" mark; projects without it load and
compute as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:14:46 +00:00
|
|
|
<button class="title-item" :disabled="!ed.savesReady.value" @click="ed.dialog.value = 'library'">
|
|
|
|
|
<Icon name="lucide:library-big" class="size-5 shrink-0" />
|
|
|
|
|
<span class="grow">
|
|
|
|
|
<span class="label">Library</span>
|
|
|
|
|
<span class="sub">Components everyone published, to add to your project</span>
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
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
|
|
|
<button class="title-item" @click="ed.dialog.value = 'settings'">
|
|
|
|
|
<Icon name="lucide:settings" class="size-5 shrink-0" />
|
|
|
|
|
<span class="grow"><span class="label">Settings</span></span>
|
|
|
|
|
</button>
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<footer class="title-foot">
|
|
|
|
|
<button class="title-link" @click="ed.dialog.value = 'account'">
|
|
|
|
|
<Icon :name="ed.account.value ? 'lucide:cloud-check' : 'lucide:user'" class="size-4" />
|
|
|
|
|
{{ ed.account.value ? ed.account.value.email : 'Sign in to play on every computer' }}
|
|
|
|
|
</button>
|
|
|
|
|
<button class="title-link" @click="ed.showHelp.value = true"><Icon name="lucide:circle-help" class="size-4" /> How to play</button>
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Transition name="title-page" mode="out-in">
|
|
|
|
|
<section v-if="page !== 'main'" :key="page" class="title-page" :aria-label="TITLES[page]">
|
|
|
|
|
<header>
|
|
|
|
|
<button class="tb-btn" title="Back (Esc)" @click="page = 'main'"><Icon name="lucide:arrow-left" class="size-4" /></button>
|
|
|
|
|
<h2>{{ TITLES[page] }}</h2>
|
|
|
|
|
</header>
|
|
|
|
|
<div class="title-page-body">
|
R saves like a game: one save per project on every device, Load game in the menu, a pause menu, and a lean side panel
- Sync: when two devices changed the same project, the newer save wins
everywhere and the other becomes a savegame of it (new endpoint to keep
a savegame without replacing the save), never an "(other device)" copy.
A first visit keeps its starter unsaved until something changes, and
the main menu waits for the account's saves before anything starts.
- Main menu: Load game lists every save. In the editor, Esc with nothing
selected (or the project button) opens a pause menu: Resume, Save,
Save as copy, Load, Settings, How to play, Main menu. The projects
dialog is gone.
- Selection tab: name and transistors on top, one icon row (open,
duplicate, unlink, delete, more = the right-click menu), only the
settings that matter for the part; pins, component tools, keys, cable
and panel options fold away and remember it. X/Y fields removed.
The Circuit tab folds its component settings, transistor breakdown
and tools the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:36:17 +00:00
|
|
|
<EditorProjectList v-if="page === 'load'" @done="ed.enterGame()" />
|
|
|
|
|
<EditorProjectList v-else-if="page === 'free'" free-only @done="ed.enterGame()" />
|
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
|
|
|
<EditorMenuCampaign v-else-if="page === 'campaign'" />
|
|
|
|
|
<EditorMenuChallenges v-else-if="page === 'challenges'" />
|
|
|
|
|
<EditorMenuLeaderboard v-else-if="page === 'leaderboard'" />
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</Transition>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|