Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 86 additions & 117 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ body {

/* ===== Panel Header ===== */
.panel-header {
position: relative;
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
Expand All @@ -97,6 +99,23 @@ body {
letter-spacing: 0.05em;
}

/* ===== Panel Model Selector ===== */
.panel-model-selector {
position: absolute;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
}

.panel-header .model-dropdown {
top: 100%;
bottom: auto;
margin-top: 4px;
margin-bottom: 0;
z-index: 200;
}

/* ===== Panel Footer ===== */
.panel-footer {
display: flex;
Expand Down Expand Up @@ -357,12 +376,19 @@ body {
color: oklch(0.55 0.005 260 / 0.7);
}

.textarea-wrap textarea.readonly {
background: var(--muted);
cursor: default;
opacity: 0.8;
}

/* ===== Compare Toggle ===== */
.compare-toggle {
display: flex;
justify-content: center;
gap: 12px;
padding: 4px 0;
flex-wrap: wrap;
}

.compare-btn {
Expand Down Expand Up @@ -421,13 +447,26 @@ body {
border: 1px solid var(--border);
}

.diff-summary-model {
.diff-summary-models {
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
flex-wrap: wrap;
}

.diff-summary-model {
display: flex;
align-items: center;
gap: 8px;
position: relative;
flex-wrap: wrap;
}

.model-label {
font-size: 12px;
font-family: var(--font-mono);
color: var(--muted-foreground);
font-weight: 500;
}

.diff-summary-hero {
Expand All @@ -437,16 +476,36 @@ body {
}

.diff-hero-number {
font-size: 32px;
font-size: 18px;
font-family: var(--font-mono);
font-weight: 700;
font-weight: 600;
font-variant-numeric: tabular-nums;
line-height: 1;
line-height: 1.4;
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
justify-content: center;
}

.diff-hero-number .hero-model-a,
.diff-hero-number .hero-model-b {
font-weight: 700;
}

.diff-hero-number.positive { color: var(--added-foreground); }
.diff-hero-number.negative { color: var(--removed-foreground); }
.diff-hero-number.neutral { color: var(--foreground); }
.diff-hero-number .hero-arrow {
color: var(--muted-foreground);
font-size: 16px;
}

.diff-hero-number .hero-diff {
font-size: 16px;
font-weight: 600;
}

.diff-hero-number .hero-diff.positive { color: var(--added-foreground); }
.diff-hero-number .hero-diff.negative { color: var(--removed-foreground); }
.diff-hero-number .hero-diff.neutral { color: var(--muted-foreground); }

.diff-hero-label {
font-size: 14px;
Expand All @@ -472,11 +531,27 @@ body {

/* All-models in diff summary */
.diff-summary-all {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding-top: 8px;
border-top: 1px solid var(--border);
margin-top: 8px;
}

.diff-summary-all .all-models-label {
font-size: 11px;
font-family: var(--font-mono);
color: var(--muted-foreground);
opacity: 0.7;
}

.diff-summary-all .all-models-items {
display: flex;
flex-wrap: wrap;
gap: 6px 16px;
justify-content: center;
padding-top: 4px;
}

.diff-summary-all .delta-item {
Expand Down Expand Up @@ -537,107 +612,6 @@ body {
pointer-events: none;
}

/* ===== Diff Card ===== */
.diff-card {
border-radius: var(--radius);
border: 1px solid var(--border);
overflow: hidden;
}

.diff-card-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 12px;
}

.diff-card-label {
font-size: 12px;
color: var(--muted-foreground);
}

.diff-card-badges {
display: flex;
align-items: center;
gap: 6px;
}

/* Outline badges */
.outline-badge {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-family: var(--font-mono);
font-weight: 500;
padding: 1px 6px;
border-radius: 4px;
border: 1px solid var(--border);
white-space: nowrap;
}

.badge-added {
border-color: var(--added);
color: var(--added-foreground);
}

.badge-removed {
border-color: var(--removed);
color: var(--removed-foreground);
}

.badge-unchanged {
color: var(--muted-foreground);
}

.badge-a {
border-color: var(--removed);
color: var(--removed-foreground);
}

.badge-b {
border-color: var(--added);
color: var(--added-foreground);
}

.diff-card-body {
padding: 12px;
max-height: 33vh;
overflow-y: auto;
font-family: var(--font-mono);
font-size: 14px;
line-height: 1.6;
white-space: pre-wrap;
word-break: break-word;
border-top: 1px solid var(--border);
}

.diff-empty {
text-align: center;
color: var(--muted-foreground);
font-size: 14px;
padding: 12px 0;
}

.diff-span-added {
background: oklch(0.5 0.17 145 / 0.35);
color: var(--added-foreground);
border-radius: 2px;
padding: 0 2px;
}

.diff-span-removed {
background: oklch(0.45 0.17 27 / 0.35);
color: var(--removed-foreground);
text-decoration: line-through;
border-radius: 2px;
padding: 0 2px;
}

.diff-span-unchanged {
color: var(--muted-foreground);
}

/* ===== Token View Button ===== */
.token-view-btn {
display: inline-flex;
Expand Down Expand Up @@ -740,8 +714,8 @@ body {
background-position: right 6px center;
}

.diff-summary-model .model-selector,
.diff-summary-model .model-dropdown {
.panel-model-selector .model-selector,
.panel-model-selector .model-dropdown {
display: none !important;
}
}
Expand Down Expand Up @@ -827,11 +801,6 @@ body {
grid-column: 1 / -1;
grid-row: 2;
}

.main-content.compare-mode .diff-card {
grid-column: 1 / -1;
grid-row: 3;
}
}

/* ===== Responsive: Mobile ===== */
Expand Down
49 changes: 26 additions & 23 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
<section class="panel" id="panel-a">
<div class="panel-header">
<span class="panel-title" id="panel-title-a">Input text</span>
<div class="panel-model-selector">
<button class="model-selector" id="model-selector-a">
<span class="model-dot" id="model-dot-a"></span>
<span class="model-name" id="model-name-a"></span>
<svg class="chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
</button>
<div class="model-dropdown" id="model-dropdown-a" style="display:none"></div>
<select class="model-select-native" id="model-select-native-a"></select>
</div>
</div>
<div class="textarea-wrap">
<textarea id="textarea-a" placeholder="Paste text to estimate tokens..." spellcheck="false"></textarea>
Expand Down Expand Up @@ -42,12 +51,28 @@
</svg>
Compare two texts
</button>
<button class="compare-btn" id="compare-models-btn">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="6" cy="12" r="3"/><circle cx="18" cy="12" r="3"/>
<path d="M9 12h6"/>
</svg>
Compare two models
</button>
</div>

<!-- Panel B (compare mode only) -->
<section class="panel" id="panel-b" style="display:none">
<div class="panel-header">
<span class="panel-title" id="panel-title-b">Modified</span>
<div class="panel-model-selector">
<button class="model-selector" id="model-selector-b">
<span class="model-dot" id="model-dot-b"></span>
<span class="model-name" id="model-name-b"></span>
<svg class="chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
</button>
<div class="model-dropdown" id="model-dropdown-b" style="display:none"></div>
<select class="model-select-native" id="model-select-native-b"></select>
</div>
<button class="close-panel-btn" id="close-panel-b" title="Exit compare mode">&times;</button>
</div>
<div class="textarea-wrap">
Expand All @@ -74,16 +99,7 @@

<!-- Diff summary strip (compare mode only) -->
<div class="diff-summary" id="diff-summary" style="display:none">
<div class="diff-summary-model">
<button class="model-selector" id="model-selector-a">
<span class="model-dot" id="model-dot-a"></span>
<span class="model-name" id="model-name-a"></span>
<svg class="chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>
</button>
<div class="all-models-row" id="all-models-a" style="display:none"></div>
<div class="model-dropdown" id="model-dropdown" style="display:none"></div>
<select class="model-select-native" id="model-select-native-compare"></select>
</div>
<div class="all-models-row" id="all-models-a" style="display:none"></div>
<div class="diff-summary-hero">
<span class="diff-hero-number" id="diff-hero-number">+0</span>
<span class="diff-hero-label" id="diff-hero-label">tokens</span>
Expand All @@ -100,19 +116,6 @@
</button>
</div>
</div>

<!-- Diff card (compare mode) -->
<div class="diff-card" id="diff-card" style="display:none">
<div class="diff-card-header">
<span class="diff-card-label" id="diff-card-label">Word Diff</span>
<div class="diff-card-badges">
<span class="outline-badge badge-added" id="diff-stats-added">+0 words</span>
<span class="outline-badge badge-removed" id="diff-stats-removed">-0 words</span>
<span class="outline-badge badge-unchanged" id="diff-stats-unchanged">0 unchanged</span>
</div>
</div>
<div class="diff-card-body" id="diff-body"></div>
</div>
</main>

<footer class="app-footer">
Expand Down
Loading
Loading