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" >
// Your projects: open, rename, copy, delete, restore, and start new ones.
// Used by the Projects dialog and the main menu's Free play page.
const props = defineProps < { /** Hide campaign and challenge projects (they have their own menu pages). */ freeOnly ? : boolean } > ( )
const emit = defineEmits < { done : [ ] } > ( )
const ed = useEditor ( )
const list = computed ( ( ) => ( props . freeOnly ? ed . projects . value . filter ( m => ! ed . projectMode ( m ) ) : ed . projects . value ) )
const fileInput = ref < HTMLInputElement > ( )
const renaming = ref < string | null > ( null )
const renameText = ref ( '' )
const confirmDelete = ref < string | null > ( null )
const close = ( ) => emit ( 'done' )
const showTrash = ref ( false )
const trash = ref < { id : string ; name : string ; deleted : number ; v : number } [ ] | null > ( null )
async function toggleTrash ( ) {
showTrash . value = ! showTrash . value
if ( showTrash . value ) trash . value = await ed . listTrash ( ) . catch ( ( ) => [ ] )
}
async function restoreDeleted ( t : { id : string ; v : number } ) {
await ed . restoreDeleted ( t )
close ( )
}
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 = "projects" >
< 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 >
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
< p v-if ="!list.length" class="hint mt-3" > Nothing saved yet. What you build is saved as soon as you change something ; or start something new below. < / p >
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
< ul class = "project-list" >
< li v-for ="m in list" :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 >
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 v-if ="!freeOnly && ed.projectMode(m)" class="badge mode" > {{ ed.projectMode ( m ) = = = ' campaign ' ? ' Campaign ' : ' Challenges ' }} < / 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 >
< 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 >
< 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 >
< / span >
< / button >
< button
v - if = "ed.account.value && m.cloud?.owner === ed.account.value.id"
class = "icon-btn"
title = "Savegames: earlier versions"
@ click = "ed.versionsFor.value = m.id; ed.dialog.value = 'versions'"
>
< Icon name = "lucide:history" class = "size-3.5" / >
< / 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 >
< template v-if ="ed.account.value" >
< button class = "section-toggle mt-4" @click ="toggleTrash" >
< Icon : name = "showTrash ? 'lucide:chevron-down' : 'lucide:chevron-right'" class = "size-4" / >
Recently deleted
< / button >
< template v-if ="showTrash" >
< p v-if ="!trash" class="hint mt-2" > Loading … < / p >
< p v -else -if = " ! trash.length " class = "hint mt-2" > Nothing deleted in the last 30 days . < / p >
< ul v -else class = "project-list" >
< li v-for ="t in trash" :key="t.id" >
< div class = "pick" >
< span class = "name" > { { t . name } } < / span >
< span class = "meta" > deleted { { when ( t . deleted ) } } < / span >
< / div >
< button class = "btn-sm" @click ="restoreDeleted(t)" > Restore < / button >
< / li >
< / ul >
< / template >
< / template >
< div class = "mt-4 flex flex-wrap gap-2" >
< button v-if ="!freeOnly" class="btn btn-primary" title="Start with NAND only and earn every other part by solving challenges" @click="ed.newProject(false, true); close()" >
< Icon name = "lucide:trophy" class = "size-4" / > New campaign
< / button >
< 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 >
< / template >