Skip to content

Commit 5bb49a2

Browse files
committed
theme(kcd2alchemy): Updated page title styles, filter panel, and quantity table styles
1 parent d47a1ff commit 5bb49a2

File tree

3 files changed

+43
-33
lines changed

3 files changed

+43
-33
lines changed

src/features/tools/kcd2_alchemy/components/PotionCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function PotionCard({ potion, highlightIngredientIds = [], playerAlchemyL
4949
<div className="flex items-center gap-2 text-sm text-[var(--text-tertiary)]">
5050
<Droplet className="w-4 h-4" />
5151
<span className="font-medium">Base liquid:</span>
52-
<span className="px-2 py-1 rounded-md bg-[var(--accent-light)] text-[var(--accent)] text-xs font-semibold">{potion.ingredients.liquid}</span>
52+
<span className="px-2 py-1 rounded-md bg-[var(--surface-2)] text-[var(--text-primary)] text-xs font-semibold border border-[var(--border)]">{potion.ingredients.liquid}</span>
5353
</div>
5454
</header>
5555

src/features/tools/kcd2_alchemy/components/QuantityTable.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { PotionQuantity } from '../types'
22

33
export function QuantityTable({ quantity }: { quantity: PotionQuantity }) {
4-
const rows: Array<{ label: string; value: number | string; isBase?: boolean }> = [
5-
{ label: 'Base', value: quantity.base, isBase: true },
4+
const rows: Array<{ label: string; value: number | string }> = [
5+
{ label: 'Base', value: quantity.base },
66
{ label: 'Secret of Matter I', value: quantity.withSecretOfMatterI },
77
{ label: 'Secret of Matter II', value: quantity.withSecretOfMatterII },
88
{ label: 'Both Secrets', value: quantity.withBothSecrets },
@@ -11,27 +11,19 @@ export function QuantityTable({ quantity }: { quantity: PotionQuantity }) {
1111
return (
1212
<div className="grid gap-2">
1313
{rows.map((r) => (
14-
<div key={r.label} className={`flex items-center justify-between p-3 rounded-lg transition-colors ${
15-
r.isBase
16-
? 'bg-[var(--accent-light)] border border-[var(--accent)] border-opacity-30'
17-
: 'bg-[var(--surface)] hover:bg-[var(--surface-2)]'
18-
}`}>
19-
<span className={`font-medium ${r.isBase ? 'text-[var(--accent)]' : 'text-[var(--text-primary)]'}`}>
14+
<div key={r.label} className="flex items-center justify-between p-3 rounded-lg bg-[var(--surface)] hover:bg-[var(--surface-2)] transition-colors">
15+
<span className="font-medium text-[var(--text-primary)]">
2016
{r.label}
2117
</span>
22-
<span className={`px-2 py-1 rounded-md text-sm font-bold ${
23-
r.isBase
24-
? 'bg-[var(--accent)] text-white'
25-
: 'bg-[var(--card)] text-[var(--text-secondary)] border border-[var(--border)]'
26-
}`}>
18+
<span className="px-2 py-1 rounded-md text-sm font-bold bg-[var(--card)] text-[var(--text-secondary)] border border-[var(--border)]">
2719
{r.value}
2820
</span>
2921
</div>
3022
))}
3123
{quantity.withSecretOfSecrets && (
32-
<div className="flex items-center justify-between p-3 rounded-lg bg-[var(--warning-light)] border border-[var(--warning)] border-opacity-30">
33-
<span className="font-medium text-[var(--warning)]">Secret of Secrets</span>
34-
<span className="px-2 py-1 rounded-md text-sm font-bold bg-[var(--warning)] text-white">
24+
<div className="flex items-center justify-between p-3 rounded-lg bg-[var(--surface)] hover:bg-[var(--surface-2)] transition-colors">
25+
<span className="font-medium text-[var(--text-primary)]">Secret of Secrets</span>
26+
<span className="px-2 py-1 rounded-md text-sm font-bold bg-[var(--card)] text-[var(--text-secondary)] border border-[var(--border)]">
3527
Varies
3628
</span>
3729
</div>

src/features/tools/kcd2_alchemy/index.tsx

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import React, { useEffect, useMemo, useState } from 'react'
4+
import { FlaskConical, HelpCircle } from 'lucide-react'
45
import { useAlchemyData } from './hooks/useAlchemyData'
56
import { useQueryState, type QueryState } from './hooks/useQueryState'
67
import { usePotionFilters } from './hooks/usePotionFilters'
@@ -97,13 +98,32 @@ export default function Kcd2Alchemy({ className }: Kcd2AlchemyProps) {
9798

9899
return (
99100
<div className={`min-h-screen bg-background text-foreground ${className || ''}`}>
100-
<header className="pt-4">
101-
<div className="container mx-auto">
101+
<header className="py-3">
102+
<div className="container mx-auto px-4">
102103
<div className="flex items-center justify-between">
103-
<h1 className="text-3xl font-bold">KCD2 Alchemy Scholar</h1>
104-
{/* Save view toggle in header */}
104+
<div className="flex items-center gap-3">
105+
<div className="flex items-center justify-center w-8 h-8 rounded-lg bg-[var(--accent-light)] text-[var(--accent)]">
106+
<FlaskConical className="w-5 h-5" />
107+
</div>
108+
<div>
109+
<h1 className="text-2xl font-bold text-[var(--text-primary)]">KCD2 Alchemy Scholar</h1>
110+
<p className="text-[var(--text-tertiary)] text-xs">
111+
Search and filter Kingdom Come: Deliverance 2 alchemy recipes • Recipes by{' '}
112+
<a
113+
href="https://github.com/Omricon/Henrys-Moste-Potente-Potions"
114+
className="text-[var(--link)] hover:text-[var(--link-hover)] underline"
115+
target="_blank"
116+
rel="noopener noreferrer"
117+
>
118+
Omricon
119+
</a>
120+
</p>
121+
</div>
122+
</div>
123+
124+
{/* Compact save view toggle */}
105125
<div className="flex items-center gap-2 text-xs">
106-
<span className="text-[var(--muted-2)]">Save view</span>
126+
<span className="text-[var(--text-secondary)] font-medium">Save view</span>
107127
<button
108128
type="button"
109129
role="switch"
@@ -114,32 +134,31 @@ export default function Kcd2Alchemy({ className }: Kcd2AlchemyProps) {
114134
setSaveEnabled(next)
115135
showToast(next ? 'Saving filters enabled.' : 'Saved filters cleared and disabled.', next ? 'success' : 'info')
116136
}}
117-
className={`relative inline-flex h-5 w-9 items-center rounded-full border-2 bg-[var(--chip-bg)] focus-visible:ring-2 focus-visible:ring-[var(--link)] transition-colors ${saveEnabled ? 'border-[var(--link)]' : 'border-[var(--border)]'}`}
137+
className={`relative inline-flex h-4 w-8 items-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] ${
138+
saveEnabled ? 'bg-[var(--accent)]' : 'bg-[var(--surface-2)]'
139+
}`}
118140
title="When enabled, your current search, ingredient filters, and alchemy skill are saved and restored here."
119141
>
120142
<span
121-
className="inline-block h-4 w-4 transform rounded-full bg-[var(--card)] border border-[var(--muted)] transition-transform"
122-
style={{ transform: saveEnabled ? 'translateX(16px)' : 'translateX(1px)' }}
143+
className={`inline-block h-3 w-3 transform rounded-full transition-transform bg-white shadow-sm ${
144+
saveEnabled ? 'translate-x-4' : 'translate-x-0.5'
145+
}`}
123146
/>
124147
</button>
125148
<button
126149
type="button"
127-
className="inline-flex items-center justify-center w-4 h-4 rounded-full border border-[var(--border)] text-[var(--muted-2)] hover:text-[var(--foreground)] bg-[var(--surface-hover)]"
150+
className="flex items-center justify-center w-4 h-4 rounded-full bg-[var(--surface-2)] text-[var(--text-tertiary)] hover:bg-[var(--surface-3)] hover:text-[var(--text-secondary)] transition-colors"
128151
aria-label="Help: Save view"
129152
title="Saves your current search, ingredient filters, and alchemy level to this browser so they persist across visits."
130153
>
131-
?
154+
<HelpCircle className="w-3 h-3" />
132155
</button>
133156
</div>
134157
</div>
135-
<p className="text-[var(--muted-2)] mt-1">
136-
Browse and filter Kingdom Come: Deliverance 2 alchemy recipes.<br />
137-
</p>
138-
<p className="text-[var(--muted-2)] text-right italic">* Recipes by <a href="https://github.com/Omricon/Henrys-Moste-Potente-Potions" className="underline" target="_blank" rel="noopener noreferrer">Omricon</a>.</p>
139158
</div>
140159
</header>
141160

142-
<main className="container mx-auto p-4 space-y-4">
161+
<main className="container mx-auto p-4 space-y-3">
143162
<section className="flex flex-col gap-3">
144163
<SearchBar value={queryState.q} onChange={(q) => setStateAndPersist({ q })} />
145164
<FiltersPanel
@@ -183,4 +202,3 @@ export default function Kcd2Alchemy({ className }: Kcd2AlchemyProps) {
183202
}
184203

185204
export { Kcd2Alchemy }
186-

0 commit comments

Comments
 (0)