R This tab: title, health, four tiles, tidy folds
The circuit name is the panel's title, edited in place, with where it is used below. One line says whether all is good or how many problems there are; inputs, outputs, transistors and delay sit in tiles. The rest folds away with plain titles: truth table, as a component (fields one under another), transistors (name, count × each, total), unused components (only when there are any) and tools. The tabs are a segmented control with the hide button beside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c1b70a937f
commit
6398381550
|
|
@ -4059,11 +4059,9 @@ table.board {
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 9px 14px;
|
padding: 9px 14px;
|
||||||
font-size: 11px;
|
font-size: 12.5px;
|
||||||
font-weight: 700;
|
font-weight: 600;
|
||||||
letter-spacing: 0.06em;
|
color: rgb(230 237 243 / 0.82);
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--muted);
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4081,7 +4079,10 @@ table.board {
|
||||||
}
|
}
|
||||||
|
|
||||||
.fold-note {
|
.fold-note {
|
||||||
max-width: 55%;
|
flex-shrink: 0;
|
||||||
|
max-width: 45%;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 11px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
@ -4666,3 +4667,260 @@ table.board {
|
||||||
.table-pane .truth {
|
.table-pane .truth {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ── Panel heads: segmented tabs on the left, a title on the right ── */
|
||||||
|
.panel-head,
|
||||||
|
.sel-panel-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
height: 48px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 0 8px 0 10px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
gap: 2px;
|
||||||
|
padding: 3px;
|
||||||
|
background: var(--bg);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs button {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
height: 28px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs button:hover {
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs button.active {
|
||||||
|
background: var(--panel-2);
|
||||||
|
color: var(--text);
|
||||||
|
box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs button.task:not(.active) {
|
||||||
|
color: var(--lamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs .badge {
|
||||||
|
min-width: 18px;
|
||||||
|
padding: 0 5px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgb(76 194 255 / 0.16);
|
||||||
|
color: var(--accent);
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-tabs .badge.warn {
|
||||||
|
background: rgb(232 162 58 / 0.18);
|
||||||
|
color: #e8a23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── This: the circuit you are in ───────────────────────────────── */
|
||||||
|
.inspector section.this-head {
|
||||||
|
padding: 14px 14px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-input {
|
||||||
|
width: calc(100% + 12px);
|
||||||
|
margin: -4px -6px 0;
|
||||||
|
padding: 3px 6px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-input:hover {
|
||||||
|
border-color: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-input:focus {
|
||||||
|
border-color: var(--accent);
|
||||||
|
background: var(--panel-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.this-sub {
|
||||||
|
margin: 2px 0 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.this-sub a {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.health {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 7px 10px;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 12.5px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--on);
|
||||||
|
background: rgb(61 220 132 / 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.health.warn {
|
||||||
|
color: #e8a23a;
|
||||||
|
background: rgb(232 162 58 / 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.health.error {
|
||||||
|
color: #ff7a7a;
|
||||||
|
background: rgb(255 122 122 / 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.health-notes {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
font-size: 11.5px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--muted);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.this-head .issue-list {
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tiles {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 6px;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tile {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
min-width: 0;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--panel-2);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.tile:hover {
|
||||||
|
border-color: rgb(76 194 255 / 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tile-label {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tile-value {
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tile-note {
|
||||||
|
font-size: 10.5px;
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.inspector section.folds {
|
||||||
|
padding: 0 14px;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folds .fold:first-child {
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folds .fold:last-of-type {
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fold-head > .grow {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-list li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin: 0 -8px;
|
||||||
|
padding: 5px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-list li:hover {
|
||||||
|
background: var(--panel-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-name {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 0;
|
||||||
|
font-size: 12.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-each {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-total {
|
||||||
|
font-size: 12.5px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-list li.cost-sum {
|
||||||
|
margin-top: 4px;
|
||||||
|
padding-top: 8px;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
border-radius: 0;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-list li.cost-sum:hover {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unused-list li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 3px 0;
|
||||||
|
font-size: 12.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unused-list a {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TRANSISTORS_PER_NAND } from '~/lib/logic/analyze'
|
// "This": the circuit you are in. Its name and health on top, four numbers,
|
||||||
|
// then everything else folded away.
|
||||||
|
import { shortCount, TRANSISTORS_PER_NAND } from '~/lib/logic/analyze'
|
||||||
import { transistorBreakdown } from '~/lib/logic/bulk'
|
import { transistorBreakdown } from '~/lib/logic/bulk'
|
||||||
import { chipPins } from '~/lib/logic/geometry'
|
import { chipPins } from '~/lib/logic/geometry'
|
||||||
import { unusedComponents } from '~/lib/logic/check'
|
import { unusedComponents } from '~/lib/logic/check'
|
||||||
|
|
@ -47,10 +49,11 @@ function toggleFace(e: Event) {
|
||||||
// ── Problems ────────────────────────────────────────────────────────
|
// ── Problems ────────────────────────────────────────────────────────
|
||||||
const LEVEL_ICON = { error: 'lucide:circle-x', warn: 'lucide:triangle-alert', info: 'lucide:info' } as const
|
const LEVEL_ICON = { error: 'lucide:circle-x', warn: 'lucide:triangle-alert', info: 'lucide:info' } as const
|
||||||
const showInfo = ref(false)
|
const showInfo = ref(false)
|
||||||
|
const problems = computed(() => ed.issues.value.filter(i => i.level !== 'info'))
|
||||||
|
const worst = computed<'error' | 'warn' | 'ok'>(() => (problems.value.some(i => i.level === 'error') ? 'error' : problems.value.length ? 'warn' : 'ok'))
|
||||||
const shownIssues = computed(() => ed.issues.value.filter(i => showInfo.value || i.level !== 'info'))
|
const shownIssues = computed(() => ed.issues.value.filter(i => showInfo.value || i.level !== 'info'))
|
||||||
const infoCount = computed(() => ed.issues.value.filter(i => i.level === 'info').length)
|
const infoCount = computed(() => ed.issues.value.filter(i => i.level === 'info').length)
|
||||||
const unused = computed(() => unusedComponents(ed.project.value).filter(d => d.id !== def.value.id))
|
const unused = computed(() => unusedComponents(ed.project.value).filter(d => d.id !== def.value.id))
|
||||||
const showUnused = ref(false)
|
|
||||||
const confirmRemove = ref<string | null>(null)
|
const confirmRemove = ref<string | null>(null)
|
||||||
|
|
||||||
const confirmDelete = ref(false)
|
const confirmDelete = ref(false)
|
||||||
|
|
@ -58,11 +61,32 @@ watch(() => def.value.id, () => (confirmDelete.value = false))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="problems">
|
<section class="this-head">
|
||||||
<div class="problems-head">
|
<input
|
||||||
<h3>Check</h3>
|
ref="nameInput"
|
||||||
<span v-if="!shownIssues.length" class="ok"><Icon name="lucide:circle-check" class="size-4" /> {{ infoCount ? 'No problems' : 'All good' }}</span>
|
v-model="def.name"
|
||||||
<label v-if="infoCount" class="check ml-auto"><input v-model="showInfo" type="checkbox" /> Notes ({{ infoCount }})</label>
|
class="title-input"
|
||||||
|
title="Rename this circuit"
|
||||||
|
spellcheck="false"
|
||||||
|
@change="ed.commit(false)"
|
||||||
|
@keydown.enter="($event.target as HTMLInputElement).blur()"
|
||||||
|
/>
|
||||||
|
<p class="this-sub">
|
||||||
|
<template v-if="users.length">
|
||||||
|
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>
|
||||||
|
</template>
|
||||||
|
<template v-else>{{ def.id === ed.mainId.value ? 'The main circuit' : 'Not used in another circuit' }}</template>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="health" :class="worst">
|
||||||
|
<Icon :name="worst === 'ok' ? 'lucide:circle-check' : LEVEL_ICON[worst]" class="size-4 shrink-0" />
|
||||||
|
<span class="grow">{{ worst === 'ok' ? 'All good' : `${problems.length} ${problems.length === 1 ? 'problem' : 'problems'}` }}</span>
|
||||||
|
<label v-if="infoCount" class="health-notes" title="Show notes too: things that work but may not be meant">
|
||||||
|
<input v-model="showInfo" type="checkbox" /> {{ infoCount }} {{ infoCount === 1 ? 'note' : 'notes' }}
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<ul v-if="shownIssues.length" class="issue-list">
|
<ul v-if="shownIssues.length" class="issue-list">
|
||||||
<li v-for="(i, k) in shownIssues.slice(0, 40)" :key="k">
|
<li v-for="(i, k) in shownIssues.slice(0, 40)" :key="k">
|
||||||
|
|
@ -73,54 +97,33 @@ watch(() => def.value.id, () => (confirmDelete.value = false))
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p v-if="shownIssues.length > 40" class="hint">and {{ shownIssues.length - 40 }} more</p>
|
<p v-if="shownIssues.length > 40" class="hint">and {{ shownIssues.length - 40 }} more</p>
|
||||||
<template v-if="unused.length">
|
|
||||||
<button class="section-toggle mt-2" @click="showUnused = !showUnused">
|
|
||||||
<Icon :name="showUnused ? 'lucide:chevron-down' : 'lucide:chevron-right'" class="size-4" />
|
|
||||||
Not used in another circuit ({{ unused.length }})
|
|
||||||
</button>
|
|
||||||
<template v-if="showUnused">
|
|
||||||
<p class="hint">Circuits you work in directly show up here too. Delete only what you don't need.</p>
|
|
||||||
<ul class="issue-list">
|
|
||||||
<li v-for="d in unused" :key="d.id" class="unused-row">
|
|
||||||
<a href="#" class="grow truncate" @click.prevent="ed.open(d.id)">{{ d.name }}</a>
|
|
||||||
<template v-if="confirmRemove === d.id">
|
|
||||||
<button class="btn-sm danger" @click="ed.removeComponent(d.id), (confirmRemove = null)">Delete</button>
|
|
||||||
<button class="btn-sm" @click="confirmRemove = null">Keep</button>
|
|
||||||
</template>
|
|
||||||
<button v-else class="icon-btn" title="Delete this component" @click="confirmRemove = d.id"><Icon name="lucide:trash-2" class="size-3.5" /></button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section>
|
|
||||||
<label class="field">
|
|
||||||
<span>Circuit name</span>
|
|
||||||
<input ref="nameInput" v-model="def.name" @change="ed.commit(false)" @keydown.enter="($event.target as HTMLInputElement).blur()" />
|
|
||||||
</label>
|
|
||||||
<dl class="stats">
|
|
||||||
<dt>Pins</dt>
|
|
||||||
<dd>
|
|
||||||
<a href="#" title="List and rename them" @click.prevent="ed.panelTab.value = 'pins'">{{ pins.inputs.length }} in, {{ pins.outputs.length }} out</a>
|
|
||||||
</dd>
|
|
||||||
<dt>NAND gates</dt>
|
|
||||||
<dd>{{ ed.circuitStats.value.nands.toLocaleString() }}</dd>
|
|
||||||
<dt title="CMOS: 4 per NAND gate, at every depth">Transistors</dt>
|
|
||||||
<dd>{{ total.toLocaleString() }}</dd>
|
|
||||||
<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">
|
<p v-for="err in ed.errors.value" :key="err" class="result fail">
|
||||||
<Icon name="lucide:triangle-alert" class="size-4 shrink-0" /> {{ err }}
|
<Icon name="lucide:triangle-alert" class="size-4 shrink-0" /> {{ err }}
|
||||||
</p>
|
</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>
|
|
||||||
|
|
||||||
|
<div class="tiles">
|
||||||
|
<button class="tile" title="List and rename them" @click="ed.panelTab.value = 'pins'">
|
||||||
|
<span class="tile-label">Inputs</span>
|
||||||
|
<span class="tile-value">{{ pins.inputs.length }}</span>
|
||||||
|
</button>
|
||||||
|
<button class="tile" title="List and rename them" @click="ed.panelTab.value = 'pins'">
|
||||||
|
<span class="tile-label">Outputs</span>
|
||||||
|
<span class="tile-value">{{ pins.outputs.length }}</span>
|
||||||
|
</button>
|
||||||
|
<div class="tile" title="CMOS: 4 per NAND gate, at every depth">
|
||||||
|
<span class="tile-label">Transistors</span>
|
||||||
|
<span class="tile-value">{{ total.toLocaleString() }}</span>
|
||||||
|
<span class="tile-note">{{ ed.circuitStats.value.nands.toLocaleString() }} NAND</span>
|
||||||
|
</div>
|
||||||
|
<div class="tile" :title="ed.circuitStats.value.sequential ? 'It has feedback loops, so it can hold state' : 'Longest path from an input to an output'">
|
||||||
|
<span class="tile-label">{{ ed.circuitStats.value.sequential ? 'Memory' : 'Delay' }}</span>
|
||||||
|
<span class="tile-value">{{ ed.circuitStats.value.sequential ? 'Yes' : ed.circuitStats.value.delay }}</span>
|
||||||
|
<span class="tile-note">{{ ed.circuitStats.value.sequential ? 'feedback loops' : 'gates deep' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="folds">
|
||||||
<EditorFold id="circuit-table" title="Truth table">
|
<EditorFold id="circuit-table" title="Truth table">
|
||||||
<EditorTestPane part="table" />
|
<EditorTestPane part="table" />
|
||||||
</EditorFold>
|
</EditorFold>
|
||||||
|
|
@ -130,22 +133,20 @@ watch(() => def.value.id, () => (confirmDelete.value = false))
|
||||||
<span>Description</span>
|
<span>Description</span>
|
||||||
<textarea v-model="def.description" rows="2" placeholder="What does it do?" @change="ed.commit(false)" />
|
<textarea v-model="def.description" rows="2" placeholder="What does it do?" @change="ed.commit(false)" />
|
||||||
</label>
|
</label>
|
||||||
<div class="sel-row">
|
<label class="field">
|
||||||
<label class="field grow">
|
|
||||||
<span>Drawn as</span>
|
<span>Drawn as</span>
|
||||||
<select v-model="def.symbol" @change="ed.commit(false)">
|
<select v-model="def.symbol" @change="ed.commit(false)">
|
||||||
<option v-for="s in SYMBOLS" :key="s.value" :value="s.value">{{ s.label }}</option>
|
<option v-for="s in SYMBOLS" :key="s.value" :value="s.value">{{ s.label }}</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label class="field grow">
|
<label class="field">
|
||||||
<span>Group</span>
|
<span>Group in the parts list</span>
|
||||||
<input v-model="def.group" list="groups" placeholder="My components" @change="ed.commit(false)" />
|
<input v-model="def.group" list="groups" placeholder="My components" @change="ed.commit(false)" />
|
||||||
<datalist id="groups">
|
<datalist id="groups">
|
||||||
<option v-for="g in groupNames" :key="g" :value="g" />
|
<option v-for="g in groupNames" :key="g" :value="g" />
|
||||||
</datalist>
|
</datalist>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
<label v-if="hasFace" class="check mb-3">
|
||||||
<label v-if="hasFace" class="check">
|
|
||||||
<input type="checkbox" :checked="def.face !== false" @change="toggleFace" />
|
<input type="checkbox" :checked="def.face !== false" @change="toggleFace" />
|
||||||
Show its lamps and displays on the box
|
Show its lamps and displays on the box
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -154,28 +155,38 @@ watch(() => def.value.id, () => (confirmDelete.value = false))
|
||||||
</button>
|
</button>
|
||||||
</EditorFold>
|
</EditorFold>
|
||||||
|
|
||||||
<EditorFold id="circuit-transistors" title="Where the transistors are" :note="total ? total.toLocaleString() : ''">
|
<EditorFold id="circuit-transistors" title="Transistors" :note="total ? shortCount(total) : ''">
|
||||||
<p v-if="!breakdown.length" class="hint">No gates here yet. Switches, lamps, displays and cables need no transistors.</p>
|
<p v-if="!breakdown.length" class="hint">No gates here yet. Switches, lamps, displays and cables need no transistors.</p>
|
||||||
<table
|
<ul v-else class="cost-list">
|
||||||
v-else
|
<li v-for="l in breakdown" :key="l.key" title="Select these parts" @click="ed.selectOnly(l.ids)">
|
||||||
class="cost"
|
<span class="cost-name">
|
||||||
title="Everything is built from NAND gates; a CMOS NAND has 4 transistors (2 in parallel to the supply, 2 in series to ground), so it is 4 per NAND inside, at every depth"
|
<span class="truncate">{{ l.name }}</span>
|
||||||
>
|
<span class="cost-each">{{ l.count }} × {{ l.each.toLocaleString() }}</span>
|
||||||
<tbody>
|
</span>
|
||||||
<tr v-for="l in breakdown" :key="l.key" title="Select these parts" @click="ed.selectOnly(l.ids)">
|
<span class="cost-total">{{ l.total.toLocaleString() }}</span>
|
||||||
<td class="what">{{ l.count }} × {{ l.name }}</td>
|
</li>
|
||||||
<td class="num">{{ l.each.toLocaleString() }} each</td>
|
<li class="cost-sum">
|
||||||
<td class="num strong">{{ l.total.toLocaleString() }}</td>
|
<span class="cost-name">
|
||||||
</tr>
|
<span>Total</span>
|
||||||
</tbody>
|
<span class="cost-each">{{ (total / TRANSISTORS_PER_NAND).toLocaleString() }} NAND × 4</span>
|
||||||
<tfoot>
|
</span>
|
||||||
<tr>
|
<span class="cost-total">{{ total.toLocaleString() }}</span>
|
||||||
<td>Total</td>
|
</li>
|
||||||
<td class="num">{{ (total / TRANSISTORS_PER_NAND).toLocaleString() }} NAND</td>
|
</ul>
|
||||||
<td class="num strong">{{ total.toLocaleString() }}</td>
|
</EditorFold>
|
||||||
</tr>
|
|
||||||
</tfoot>
|
<EditorFold v-if="unused.length" id="circuit-unused" title="Unused components" :note="String(unused.length)">
|
||||||
</table>
|
<p class="hint">Not placed in any other circuit. Circuits you work in directly show up here too, so delete only what you don't need.</p>
|
||||||
|
<ul class="unused-list">
|
||||||
|
<li v-for="d in unused" :key="d.id">
|
||||||
|
<a href="#" class="grow truncate" @click.prevent="ed.open(d.id)">{{ d.name }}</a>
|
||||||
|
<template v-if="confirmRemove === d.id">
|
||||||
|
<button class="btn-sm danger" @click="ed.removeComponent(d.id), (confirmRemove = null)">Delete</button>
|
||||||
|
<button class="btn-sm" @click="confirmRemove = null">Keep</button>
|
||||||
|
</template>
|
||||||
|
<button v-else class="icon-btn" title="Delete this component" @click="confirmRemove = d.id"><Icon name="lucide:trash-2" class="size-3.5" /></button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</EditorFold>
|
</EditorFold>
|
||||||
|
|
||||||
<EditorFold id="circuit-tools" title="Tools">
|
<EditorFold id="circuit-tools" title="Tools">
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,8 @@ watch(
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<aside class="inspector">
|
<aside class="inspector">
|
||||||
<nav class="itabs" role="tablist">
|
<div class="panel-head">
|
||||||
<button class="collapse-btn" title="Hide this panel ([)" @click="ed.togglePanel(false)">
|
<nav class="seg-tabs" role="tablist">
|
||||||
<Icon name="lucide:panel-left-close" class="size-4" />
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
v-for="t in tabs"
|
v-for="t in tabs"
|
||||||
:key="t.id"
|
:key="t.id"
|
||||||
|
|
@ -54,6 +52,10 @@ watch(
|
||||||
<span v-if="t.badge" class="badge" :class="{ warn: t.warn }">{{ t.badge }}</span>
|
<span v-if="t.badge" class="badge" :class="{ warn: t.warn }">{{ t.badge }}</span>
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
<button class="icon-btn" title="Hide this panel ([)" @click="ed.togglePanel(false)">
|
||||||
|
<Icon name="lucide:panel-left-close" class="size-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div class="scroll">
|
<div class="scroll">
|
||||||
<template v-if="ed.panelTab.value === 'circuit'">
|
<template v-if="ed.panelTab.value === 'circuit'">
|
||||||
<EditorTestPane part="task" />
|
<EditorTestPane part="task" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue