Switch from custom fonts to system fonts and remove unused styles
Replace DM Sans with system font stack, convert DM Serif Display to woff2 format, and remove unused animations, button styles, pill variants, and mock data file.
This commit is contained in:
1 parent
d074322826
commit
093d5b2a11
22 files changed
+241
-204
No files matched your search
+4
-87
@@ -6,7 +6,7 @@
|
|||||||
browsers don't synthesize fake bold when CSS asks for 500/600+. */
|
browsers don't synthesize fake bold when CSS asks for 500/600+. */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'DM Serif Display';
|
font-family: 'DM Serif Display';
|
||||||
src: url('/fonts/DMSerifDisplay-Regular.ttf') format('truetype');
|
src: url('/fonts/DMSerifDisplay-Regular.woff2') format('woff2');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -14,27 +14,12 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'DM Serif Display';
|
font-family: 'DM Serif Display';
|
||||||
src: url('/fonts/DMSerifDisplay-Italic.ttf') format('truetype');
|
src: url('/fonts/DMSerifDisplay-Italic.woff2') format('woff2');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'DM Sans';
|
|
||||||
src: url('/fonts/DMSans-VariableFont_opsz,wght.ttf') format('truetype');
|
|
||||||
font-weight: 100 900;
|
|
||||||
font-style: normal;
|
|
||||||
font-display: swap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'DM Sans';
|
|
||||||
src: url('/fonts/DMSans-Italic-VariableFont_opsz,wght.ttf') format('truetype');
|
|
||||||
font-weight: 100 900;
|
|
||||||
font-style: italic;
|
|
||||||
font-display: swap;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
/* ── Paper palette — aligned to the Grove5 marketing site ─────────── */
|
/* ── Paper palette — aligned to the Grove5 marketing site ─────────── */
|
||||||
@@ -81,11 +66,11 @@
|
|||||||
--bag-fruit: #b78f6a; /* warm mushroom cap */
|
--bag-fruit: #b78f6a; /* warm mushroom cap */
|
||||||
|
|
||||||
--font-serif: 'DM Serif Display', 'Baskervville', Georgia, serif;
|
--font-serif: 'DM Serif Display', 'Baskervville', Georgia, serif;
|
||||||
--font-sans: 'DM Sans', system-ui, sans-serif;
|
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||||
|
|
||||||
/* DM Serif Display has a single weight (400) that already reads as
|
/* DM Serif Display has a single weight (400) that already reads as
|
||||||
display-heavy, so --fw-display resolves to 400 for serif contexts.
|
display-heavy, so --fw-display resolves to 400 for serif contexts.
|
||||||
The sans tokens still drive real weight differences on DM Sans. */
|
System fonts support variable weights for sans contexts. */
|
||||||
--fw-display: 400;
|
--fw-display: 400;
|
||||||
--fw-title: 500;
|
--fw-title: 500;
|
||||||
--fw-body: 400;
|
--fw-body: 400;
|
||||||
@@ -164,11 +149,6 @@ html, body {
|
|||||||
to { transform: translateX(0); }
|
to { transform: translateX(0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes slide-out-right {
|
|
||||||
from { transform: translateX(0); }
|
|
||||||
to { transform: translateX(100%); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
from { opacity: 0; }
|
from { opacity: 0; }
|
||||||
to { opacity: 1; }
|
to { opacity: 1; }
|
||||||
@@ -179,37 +159,6 @@ html, body {
|
|||||||
to { opacity: 1; transform: translateY(0); }
|
to { opacity: 1; transform: translateY(0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes shimmer-fruiting {
|
|
||||||
0%, 100% { opacity: 0.85; transform: scale(1); }
|
|
||||||
50% { opacity: 1; transform: scale(1.012); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes pulse-mycelium {
|
|
||||||
0%, 100% { opacity: 0.85; }
|
|
||||||
50% { opacity: 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes pulse-pinning {
|
|
||||||
0%, 100% { opacity: 0.75; }
|
|
||||||
50% { opacity: 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes pulse-contam-low {
|
|
||||||
0%, 100% { opacity: 0.65; }
|
|
||||||
50% { opacity: 0.95; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes pulse-contam-high {
|
|
||||||
0%, 100% { opacity: 0.7; filter: brightness(0.95); }
|
|
||||||
50% { opacity: 1; filter: brightness(1.15); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes flare {
|
|
||||||
0% { opacity: 1; transform: scale(1); }
|
|
||||||
50% { opacity: 1; transform: scale(1.08); filter: brightness(1.3); }
|
|
||||||
100% { opacity: 1; transform: scale(1); filter: brightness(1); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
/* Reusable helpers */
|
/* Reusable helpers */
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@@ -219,21 +168,12 @@ html, body {
|
|||||||
font-weight: var(--fw-title);
|
font-weight: var(--fw-title);
|
||||||
font-feature-settings: 'ss01', 'liga';
|
font-feature-settings: 'ss01', 'liga';
|
||||||
}
|
}
|
||||||
.font-serif-body {
|
|
||||||
font-family: var(--font-serif);
|
|
||||||
font-weight: var(--fw-body);
|
|
||||||
}
|
|
||||||
.font-sans { font-family: var(--font-sans); }
|
|
||||||
.italic { font-style: italic; }
|
.italic { font-style: italic; }
|
||||||
|
|
||||||
/* Heavier weight utilities */
|
/* Heavier weight utilities */
|
||||||
.fw-display { font-weight: var(--fw-display); }
|
.fw-display { font-weight: var(--fw-display); }
|
||||||
.fw-title { font-weight: var(--fw-title); }
|
|
||||||
.fw-body { font-weight: var(--fw-body); }
|
|
||||||
|
|
||||||
.text-ink { color: var(--ink); }
|
|
||||||
.text-muted { color: var(--ink-muted); }
|
.text-muted { color: var(--ink-muted); }
|
||||||
.text-forest { color: var(--forest); }
|
|
||||||
|
|
||||||
.eyebrow {
|
.eyebrow {
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
@@ -266,16 +206,9 @@ html, body {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill-neutral { background: var(--paper-3); color: var(--ink-2); }
|
|
||||||
.pill-inoculation { background: var(--paper-3); color: var(--ink-2); }
|
|
||||||
.pill-colonization{ background: var(--forest-tint); color: var(--forest); }
|
.pill-colonization{ background: var(--forest-tint); color: var(--forest); }
|
||||||
.pill-pinning { background: #dfe6ec; color: #3e5468; }
|
.pill-pinning { background: #dfe6ec; color: #3e5468; }
|
||||||
.pill-fruiting { background: #eddfc9; color: #7a4a25; }
|
.pill-fruiting { background: #eddfc9; color: #7a4a25; }
|
||||||
.pill-harvest { background: #f0e0c6; color: var(--attention); }
|
|
||||||
|
|
||||||
.pill-contam-none { background: var(--paper-3); color: var(--ink-muted); }
|
|
||||||
.pill-contam-low { background: #f3e1cb; color: var(--attention); }
|
|
||||||
.pill-contam-high { background: #f0d2cf; color: var(--urgent); }
|
|
||||||
|
|
||||||
/* ── Buttons ────────────────────────────────────────────────────────── */
|
/* ── Buttons ────────────────────────────────────────────────────────── */
|
||||||
|
|
||||||
@@ -293,22 +226,6 @@ button:focus-visible {
|
|||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
padding: 10px 18px;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: var(--forest);
|
|
||||||
color: var(--paper);
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
letter-spacing: 0.01em;
|
|
||||||
transition: background 0.15s, transform 0.15s;
|
|
||||||
}
|
|
||||||
.btn-primary:hover { background: var(--forest-deep); }
|
|
||||||
.btn-primary:active { transform: scale(0.985); }
|
|
||||||
|
|
||||||
.btn-ghost {
|
.btn-ghost {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ const HOUR = 3600;
|
|||||||
|
|
||||||
function genEnvHistory(): EnvironmentReading[] {
|
function genEnvHistory(): EnvironmentReading[] {
|
||||||
const pts: EnvironmentReading[] = [];
|
const pts: EnvironmentReading[] = [];
|
||||||
for (let i = 1440; i >= 0; i--) {
|
for (let i = 200; i >= 0; i--) {
|
||||||
const t = NOW - i * 60;
|
const t = NOW - i * 60;
|
||||||
const phase = (i / 1440) * Math.PI * 4;
|
const phase = (i / 200) * Math.PI * 4;
|
||||||
pts.push({
|
pts.push({
|
||||||
ts: t,
|
ts: t,
|
||||||
temp_c: 22.5 + Math.sin(phase) * 0.8 + (Math.random() - 0.5) * 0.2,
|
temp_c: 22.5 + Math.sin(phase) * 0.8 + (Math.random() - 0.5) * 0.2,
|
||||||
@@ -63,19 +63,16 @@ function genSnapshots(inoculatedTs: number, count: number): BagSnapshot[] {
|
|||||||
return snaps;
|
return snaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Colonization chamber inoculation dates (active grows)
|
const inoculatedA1 = NOW - 12 * HOUR * 24;
|
||||||
const inoculatedA1 = NOW - 12 * HOUR * 24; // Blue Oyster, ~mid colonization
|
const inoculatedA2 = NOW - 8 * HOUR * 24;
|
||||||
const inoculatedA2 = NOW - 8 * HOUR * 24; // Blue Oyster, earlier
|
const inoculatedB1 = NOW - 18 * HOUR * 24;
|
||||||
const inoculatedB1 = NOW - 18 * HOUR * 24; // Golden Oyster, nearly done
|
const inoculatedB2 = NOW - 5 * HOUR * 24;
|
||||||
const inoculatedB2 = NOW - 5 * HOUR * 24; // Lion's Mane, just started
|
const inoculatedF_A1 = NOW - 24 * HOUR * 24;
|
||||||
|
const inoculatedF_A2 = NOW - 28 * HOUR * 24;
|
||||||
|
const inoculatedF_B2 = NOW - 20 * HOUR * 24;
|
||||||
|
const inoculatedF_C1 = NOW - 22 * HOUR * 24;
|
||||||
|
|
||||||
// Fruiting chamber bags (already fully colonized, now pinning/fruiting)
|
export const initialState: CultivarState = {
|
||||||
const inoculatedF_A1 = NOW - 24 * HOUR * 24; // Lion's Mane, fruiting
|
|
||||||
const inoculatedF_A2 = NOW - 28 * HOUR * 24; // Golden Oyster, harvest-ready
|
|
||||||
const inoculatedF_B2 = NOW - 20 * HOUR * 24; // Shiitake, pinning
|
|
||||||
const inoculatedF_C1 = NOW - 22 * HOUR * 24; // Pink Oyster, fruiting
|
|
||||||
|
|
||||||
export const mockState: CultivarState = {
|
|
||||||
meta: {
|
meta: {
|
||||||
device_id: 'CVR-0042',
|
device_id: 'CVR-0042',
|
||||||
firmware_version: '0.9.4',
|
firmware_version: '0.9.4',
|
||||||
@@ -100,7 +97,7 @@ export const mockState: CultivarState = {
|
|||||||
id: 'a2',
|
id: 'a2',
|
||||||
type: 'co2_elevated',
|
type: 'co2_elevated',
|
||||||
severity: 'warn',
|
severity: 'warn',
|
||||||
message: 'CO₂e is elevated on the colonization side — the air exchange ports may need a quick wipe. Or, open a window near the Cultivar to help air exchange.',
|
message: 'CO₂e is slightly elevated on the colonization side — the air exchange ports may need a quick wipe or a filter change. Alternatively, open a window near Cultivar to aid fresh air exchange.',
|
||||||
ts: NOW - 1800,
|
ts: NOW - 1800,
|
||||||
dismissed: false,
|
dismissed: false,
|
||||||
},
|
},
|
||||||
@@ -135,6 +132,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 68,
|
colonization_pct: 68,
|
||||||
colonization_confidence: 0.91,
|
colonization_confidence: 0.91,
|
||||||
contamination_risk: 'low',
|
contamination_risk: 'low',
|
||||||
|
contamination_confidence: 0.22,
|
||||||
stage: 'colonization',
|
stage: 'colonization',
|
||||||
snapshots: genSnapshots(inoculatedA1, 4),
|
snapshots: genSnapshots(inoculatedA1, 4),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -161,6 +159,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 42,
|
colonization_pct: 42,
|
||||||
colonization_confidence: 0.87,
|
colonization_confidence: 0.87,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.94,
|
||||||
stage: 'colonization',
|
stage: 'colonization',
|
||||||
snapshots: genSnapshots(inoculatedA2, 3),
|
snapshots: genSnapshots(inoculatedA2, 3),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -187,6 +186,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 94,
|
colonization_pct: 94,
|
||||||
colonization_confidence: 0.96,
|
colonization_confidence: 0.96,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.95,
|
||||||
stage: 'fruiting',
|
stage: 'fruiting',
|
||||||
snapshots: genSnapshots(inoculatedB1, 6),
|
snapshots: genSnapshots(inoculatedB1, 6),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -213,6 +213,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 18,
|
colonization_pct: 18,
|
||||||
colonization_confidence: 0.79,
|
colonization_confidence: 0.79,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.88,
|
||||||
stage: 'inoculation',
|
stage: 'inoculation',
|
||||||
snapshots: genSnapshots(inoculatedB2, 2),
|
snapshots: genSnapshots(inoculatedB2, 2),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -262,6 +263,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 100,
|
colonization_pct: 100,
|
||||||
colonization_confidence: 0.96,
|
colonization_confidence: 0.96,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.95,
|
||||||
stage: 'fruiting',
|
stage: 'fruiting',
|
||||||
snapshots: genSnapshots(inoculatedF_A1, 5),
|
snapshots: genSnapshots(inoculatedF_A1, 5),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -288,6 +290,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 100,
|
colonization_pct: 100,
|
||||||
colonization_confidence: 0.97,
|
colonization_confidence: 0.97,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.96,
|
||||||
stage: 'harvest',
|
stage: 'harvest',
|
||||||
snapshots: genSnapshots(inoculatedF_A2, 6),
|
snapshots: genSnapshots(inoculatedF_A2, 6),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -319,6 +322,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 100,
|
colonization_pct: 100,
|
||||||
colonization_confidence: 0.94,
|
colonization_confidence: 0.94,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.93,
|
||||||
stage: 'pinning',
|
stage: 'pinning',
|
||||||
snapshots: genSnapshots(inoculatedF_B2, 5),
|
snapshots: genSnapshots(inoculatedF_B2, 5),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -345,6 +349,7 @@ export const mockState: CultivarState = {
|
|||||||
colonization_pct: 100,
|
colonization_pct: 100,
|
||||||
colonization_confidence: 0.92,
|
colonization_confidence: 0.92,
|
||||||
contamination_risk: 'none',
|
contamination_risk: 'none',
|
||||||
|
contamination_confidence: 0.91,
|
||||||
stage: 'fruiting',
|
stage: 'fruiting',
|
||||||
snapshots: genSnapshots(inoculatedF_C1, 5),
|
snapshots: genSnapshots(inoculatedF_C1, 5),
|
||||||
projection: {
|
projection: {
|
||||||
@@ -363,27 +368,22 @@ export const mockState: CultivarState = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
hardware: {
|
hardware: {
|
||||||
// Two fans — one per compartment, used for fresh-air exchange
|
|
||||||
fans: [
|
fans: [
|
||||||
{ id: 'fan-col', chamber_id: 'main', speed_pct: 0, mode: 'auto' },
|
{ id: 'fan-col', chamber_id: 'main', speed_pct: 0, mode: 'auto' },
|
||||||
{ id: 'fan-fruit', chamber_id: 'second', speed_pct: 100, mode: 'auto' },
|
{ id: 'fan-fruit', chamber_id: 'second', speed_pct: 100, mode: 'auto' },
|
||||||
],
|
],
|
||||||
// One ultrasonic humidifier in the base, feeds both compartments via ducting
|
|
||||||
humidifier: { active: true, mode: 'auto', reservoir_pct: 72 },
|
humidifier: { active: true, mode: 'auto', reservoir_pct: 72 },
|
||||||
// Per-compartment lighting. Colonization = utility (work + photo, off by default).
|
|
||||||
// Fruiting = display / mild grow light, always dim-warm by default.
|
|
||||||
lights: [
|
lights: [
|
||||||
{ id: 'light-col-work', chamber_id: 'main', purpose: 'work', on: false, color_hex: '#f4ecd8', brightness: 0 },
|
{ id: 'light-col-work', chamber_id: 'main', purpose: 'work', on: false, color_hex: '#f4ecd8', brightness: 0 },
|
||||||
{ id: 'light-col-photo', chamber_id: 'main', purpose: 'photo', on: false, color_hex: '#f4ecd8', brightness: 0 },
|
{ id: 'light-col-photo', chamber_id: 'main', purpose: 'photo', on: false, color_hex: '#f4ecd8', brightness: 0 },
|
||||||
{ id: 'light-fruit-grow', chamber_id: 'second', purpose: 'grow', on: true, color_hex: '#f7f0dc', brightness: 0.55 },
|
{ id: 'light-fruit-grow', chamber_id: 'second', purpose: 'grow', on: true, color_hex: '#f7f0dc', brightness: 0.55 },
|
||||||
],
|
],
|
||||||
// Reed-switch door sensors — fruiting is showing open for the demo
|
|
||||||
doors: [
|
doors: [
|
||||||
{ id: 'door-col', chamber_id: 'main', open: false },
|
{ id: 'door-col', chamber_id: 'main', open: false },
|
||||||
{ id: 'door-fruit', chamber_id: 'second', open: false },
|
{ id: 'door-fruit', chamber_id: 'second', open: false },
|
||||||
],
|
],
|
||||||
cameras: [
|
cameras: [
|
||||||
{ id: 'cam-col', chamber_id: 'main', position: 'top', last_capture_ts: NOW - 180 },
|
{ id: 'cam-col', chamber_id: 'main', position: 'top', last_capture_ts: NOW - 180 },
|
||||||
{ id: 'cam-fruit', chamber_id: 'second', position: 'top', last_capture_ts: NOW - 180 },
|
{ id: 'cam-fruit', chamber_id: 'second', position: 'top', last_capture_ts: NOW - 180 },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -404,9 +404,7 @@ export const mockState: CultivarState = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
maintenance: {
|
maintenance: {
|
||||||
// Wiped 10 days ago — close to due (every 2 weeks)
|
|
||||||
last_wipe_ts: NOW - 10 * HOUR * 24,
|
last_wipe_ts: NOW - 10 * HOUR * 24,
|
||||||
// Reservoir cleaned 16 days ago — still a ways out (every 4 weeks)
|
|
||||||
last_reservoir_clean_ts: NOW - 16 * HOUR * 24,
|
last_reservoir_clean_ts: NOW - 16 * HOUR * 24,
|
||||||
},
|
},
|
||||||
ui: {
|
ui: {
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import type { CultivarState } from './types';
|
||||||
|
|
||||||
|
const NOW = Math.floor(Date.now() / 1000);
|
||||||
|
|
||||||
|
export const initialState: CultivarState = {
|
||||||
|
meta: {
|
||||||
|
device_id: '',
|
||||||
|
firmware_version: '',
|
||||||
|
uptime_s: 0,
|
||||||
|
wifi_rssi: 0,
|
||||||
|
timestamp_utc: NOW,
|
||||||
|
},
|
||||||
|
environment: {
|
||||||
|
history: [],
|
||||||
|
live: { temp_c: 0, rh_pct: 0, co2_ppm: 0, co2e_ppm: 0, voc_ppb: 0, vpd: 0 },
|
||||||
|
targets: { temp_c: 0, rh_pct: 0, co2_ppm: 0 },
|
||||||
|
alerts: [],
|
||||||
|
},
|
||||||
|
chambers: [],
|
||||||
|
hardware: {
|
||||||
|
fans: [],
|
||||||
|
humidifier: { active: false, mode: 'auto', reservoir_pct: 0 },
|
||||||
|
lights: [],
|
||||||
|
doors: [],
|
||||||
|
cameras: [],
|
||||||
|
},
|
||||||
|
recipe: {
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
species: '',
|
||||||
|
stage: 'inoculation',
|
||||||
|
stage_started_ts: 0,
|
||||||
|
stage_target_duration_h: 0,
|
||||||
|
stage_history: [],
|
||||||
|
next_actions: [],
|
||||||
|
},
|
||||||
|
maintenance: {
|
||||||
|
last_wipe_ts: 0,
|
||||||
|
last_reservoir_clean_ts: 0,
|
||||||
|
},
|
||||||
|
ui: {
|
||||||
|
scrubber_ts: null,
|
||||||
|
selected_bag_id: null,
|
||||||
|
onboarding_complete: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import { mockState } from './mock';
|
import { initialState } from '@mock-data';
|
||||||
import type { CultivarState, EnvironmentReading, WsDiff } from './types';
|
import type { CultivarState, EnvironmentReading, WsDiff } from './types';
|
||||||
|
|
||||||
function deepClone<T>(v: T): T {
|
function deepClone<T>(v: T): T {
|
||||||
return JSON.parse(JSON.stringify(v));
|
return structuredClone(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createStore() {
|
function createStore() {
|
||||||
let state = $state<CultivarState>(deepClone(mockState));
|
let state = $state<CultivarState>(deepClone(initialState));
|
||||||
|
|
||||||
// Mock WS diff interval
|
// Mock WS diff interval
|
||||||
let mockInterval: ReturnType<typeof setInterval> | null = null;
|
let mockInterval: ReturnType<typeof setInterval> | null = null;
|
||||||
|
|||||||
@@ -151,7 +151,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="details-btn" onclick={onOpenDetails}>
|
<button class="details-btn" onclick={onOpenDetails}>
|
||||||
See full history
|
See details
|
||||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
|
||||||
<path d="M5 3L9 7L5 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
|
<path d="M5 3L9 7L5 11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@@ -9,15 +9,15 @@
|
|||||||
const { onBagClick }: Props = $props();
|
const { onBagClick }: Props = $props();
|
||||||
|
|
||||||
const chambers = $derived(cultivar.state.chambers);
|
const chambers = $derived(cultivar.state.chambers);
|
||||||
const colonization = $derived(chambers.find(c => c.type === 'colonization') ?? chambers[0]);
|
const colonization = $derived(chambers.find(c => c.type === 'colonization') ?? chambers[0] ?? { slots: [] });
|
||||||
const fruiting = $derived(chambers.find(c => c.type === 'fruiting') ?? chambers[1]);
|
const fruiting = $derived(chambers.find(c => c.type === 'fruiting') ?? chambers[1] ?? { slots: [] });
|
||||||
|
|
||||||
const hw = $derived(cultivar.state.hardware);
|
const hw = $derived(cultivar.state.hardware);
|
||||||
const humidOn = $derived(hw.humidifier.active);
|
const humidOn = $derived(hw.humidifier.active);
|
||||||
|
|
||||||
// Two fans — one per compartment, used for fresh-air exchange
|
// Two fans — one per compartment, used for fresh-air exchange
|
||||||
const colFan = $derived(hw.fans.find(f => f.chamber_id === 'main') ?? hw.fans[0]);
|
const colFan = $derived(hw.fans.find(f => f.chamber_id === 'main') ?? hw.fans[0] ?? { speed_pct: 0 });
|
||||||
const fruitFan = $derived(hw.fans.find(f => f.chamber_id === 'second') ?? hw.fans[1]);
|
const fruitFan = $derived(hw.fans.find(f => f.chamber_id === 'second') ?? hw.fans[1] ?? { speed_pct: 0 });
|
||||||
|
|
||||||
function spinDur(speed: number): string {
|
function spinDur(speed: number): string {
|
||||||
return speed > 0 ? `${(0.5 + (1 - speed / 100) * 2.4).toFixed(2)}s` : '4s';
|
return speed > 0 ? `${(0.5 + (1 - speed / 100) * 2.4).toFixed(2)}s` : '4s';
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
|
|
||||||
// Lights per compartment — colonization has utility lights (usually off),
|
// Lights per compartment — colonization has utility lights (usually off),
|
||||||
// fruiting has a grow/display light
|
// fruiting has a grow/display light
|
||||||
const colWorkLight = $derived(hw.lights.find(l => l.chamber_id === 'main' && l.purpose === 'work'));
|
const colWorkLight = $derived(hw.lights.find(l => l.chamber_id === 'main' && l.purpose === 'work') ?? { on: false, brightness: 0, color_hex: '#f4ecd8' });
|
||||||
const fruitGrowLight = $derived(hw.lights.find(l => l.chamber_id === 'second' && l.purpose === 'grow'));
|
const fruitGrowLight = $derived(hw.lights.find(l => l.chamber_id === 'second' && l.purpose === 'grow') ?? { on: false, brightness: 0, color_hex: '#f7f0dc' });
|
||||||
|
|
||||||
// Door state
|
// Door state
|
||||||
const colDoorOpen = $derived(hw.doors.find(d => d.chamber_id === 'main')?.open ?? false);
|
const colDoorOpen = $derived(hw.doors.find(d => d.chamber_id === 'main')?.open ?? false);
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
// Humidity readout (live) — shown inside the fruiting compartment
|
// Humidity readout (live) — shown inside the fruiting compartment
|
||||||
// so users instantly associate the fog with humidity.
|
// so users instantly associate the fog with humidity.
|
||||||
const fruitRh = $derived(fruiting.environment.rh_pct);
|
const fruitRh = $derived(fruiting.environment?.rh_pct ?? 0);
|
||||||
|
|
||||||
// Reservoir water level. The bottle's usable interior runs from y=4.4
|
// Reservoir water level. The bottle's usable interior runs from y=4.4
|
||||||
// to y=20.9 in local coords (height 16.5). Water surface sits at
|
// to y=20.9 in local coords (height 16.5). Water surface sits at
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export type BagVision = {
|
|||||||
colonization_pct: number;
|
colonization_pct: number;
|
||||||
colonization_confidence: number;
|
colonization_confidence: number;
|
||||||
contamination_risk: 'none' | 'low' | 'medium' | 'high';
|
contamination_risk: 'none' | 'low' | 'medium' | 'high';
|
||||||
|
contamination_confidence: number;
|
||||||
stage: 'inoculation' | 'colonization' | 'pinning' | 'fruiting' | 'harvest';
|
stage: 'inoculation' | 'colonization' | 'pinning' | 'fruiting' | 'harvest';
|
||||||
snapshots: BagSnapshot[];
|
snapshots: BagSnapshot[];
|
||||||
projection: {
|
projection: {
|
||||||
|
|||||||
@@ -11,8 +11,11 @@
|
|||||||
const winMs: Record<Win, number> = { '1h': 0, '6h': 30_000, '24h': 120_000 };
|
const winMs: Record<Win, number> = { '1h': 0, '6h': 30_000, '24h': 120_000 };
|
||||||
|
|
||||||
const chambers = $derived(cultivar.state.chambers);
|
const chambers = $derived(cultivar.state.chambers);
|
||||||
const colonization = $derived(chambers.find(c => c.type === 'colonization') ?? chambers[0]);
|
const colonization = $derived(chambers.find(c => c.type === 'colonization') ?? chambers[0] ?? { type: 'colonization', environment: { temp_c: 0, rh_pct: 0 } });
|
||||||
const fruiting = $derived(chambers.find(c => c.type === 'fruiting') ?? chambers[1]);
|
const fruiting = $derived(chambers.find(c => c.type === 'fruiting') ?? chambers[1] ?? { type: 'fruiting', environment: { temp_c: 0, rh_pct: 0 } });
|
||||||
|
|
||||||
|
// Track which hint is currently open (only one at a time)
|
||||||
|
let openHintKey = $state<string | null>(null);
|
||||||
|
|
||||||
// Throttled snapshot of the global history
|
// Throttled snapshot of the global history
|
||||||
const history = $derived(cultivar.state.environment.history);
|
const history = $derived(cultivar.state.environment.history);
|
||||||
@@ -42,11 +45,11 @@
|
|||||||
|
|
||||||
const live = (() => {
|
const live = (() => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'temp_c': return ch.environment.temp_c;
|
case 'temp_c': return ch.environment?.temp_c ?? 0;
|
||||||
case 'rh_pct': return ch.environment.rh_pct;
|
case 'rh_pct': return ch.environment?.rh_pct ?? 0;
|
||||||
case 'co2_ppm': return ch.environment.co2_ppm ?? ch.environment.co2e_ppm ?? 0;
|
case 'co2_ppm': return ch.environment?.co2_ppm ?? ch.environment?.co2e_ppm ?? 0;
|
||||||
case 'co2e_ppm': return ch.environment.co2e_ppm ?? ch.environment.co2_ppm ?? 0;
|
case 'co2e_ppm': return ch.environment?.co2e_ppm ?? ch.environment?.co2_ppm ?? 0;
|
||||||
case 'voc_ppb': return ch.environment.voc_ppb;
|
case 'voc_ppb': return ch.environment?.voc_ppb ?? 0;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
const baseline = (() => {
|
const baseline = (() => {
|
||||||
@@ -107,15 +110,13 @@
|
|||||||
label: 'Temperature',
|
label: 'Temperature',
|
||||||
unit: '°C',
|
unit: '°C',
|
||||||
color: '#2b5a34',
|
color: '#2b5a34',
|
||||||
valueFor: (ch) => ch.environment.temp_c.toFixed(1),
|
valueFor: (ch) => (ch.environment?.temp_c ?? 0).toFixed(1),
|
||||||
seriesFor: (ch) => sliceCh(ch, 'temp_c'),
|
seriesFor: (ch) => sliceCh(ch, 'temp_c'),
|
||||||
rangeFor: (ch) => RANGES.temp[ch.type],
|
rangeFor: (ch) => RANGES.temp[ch.type],
|
||||||
rangeLabel:(ch) => `${RANGES.temp[ch.type][0]}–${RANGES.temp[ch.type][1]}°C ideal`,
|
rangeLabel:(ch) => `${RANGES.temp[ch.type][0]}–${RANGES.temp[ch.type][1]}°C ideal`,
|
||||||
hint: (ch) => ({
|
hint: (ch) => ({
|
||||||
title: `${ch.type === 'colonization' ? 'Colonization' : 'Fruiting'} temperature`,
|
title: 'Temperature',
|
||||||
body: ch.type === 'colonization'
|
body: 'Cultivar follows your room temperature (it has no heater or cooler). If this drifts, try moving the unit away from vents or sunny windows. Fruiting likes it a little cooler than colonization (16–20°C is the sweet spot). The higher humidity tends to cool the fruiting air naturally. Choose species that match your room. Cooler seasons? Blue Oyster, Enoki, Shiitake and Lion\'s Mane love the chill. Warm house in the summer? Pink Oyster, Yellow Oyster, Paddy Straw, Almond Agaricus, and Reishi are all tropical species that thrive in the heat.'
|
||||||
? 'Cultivar follows your room — it has no heater or cooler. If this drifts, try moving the unit away from vents or sunny windows. Cooler seasons? Shiitake and Lion\'s Mane love the chill.'
|
|
||||||
: 'Fruiting likes it a little cooler than colonization (16–20°C is the sweet spot). Cultivar doesn\'t climate-control this — choose species that match your room, or move the unit to a slightly cooler corner.',
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -123,15 +124,13 @@
|
|||||||
label: 'Humidity',
|
label: 'Humidity',
|
||||||
unit: '%',
|
unit: '%',
|
||||||
color: '#4b6a84',
|
color: '#4b6a84',
|
||||||
valueFor: (ch) => ch.environment.rh_pct.toFixed(0),
|
valueFor: (ch) => (ch.environment?.rh_pct ?? 0).toFixed(0),
|
||||||
seriesFor: (ch) => sliceCh(ch, 'rh_pct'),
|
seriesFor: (ch) => sliceCh(ch, 'rh_pct'),
|
||||||
rangeFor: (ch) => RANGES.humid[ch.type],
|
rangeFor: (ch) => RANGES.humid[ch.type],
|
||||||
rangeLabel:(ch) => `${RANGES.humid[ch.type][0]}–${RANGES.humid[ch.type][1]}% ideal`,
|
rangeLabel:(ch) => `${RANGES.humid[ch.type][0]}–${RANGES.humid[ch.type][1]}% ideal`,
|
||||||
hint: (ch) => ({
|
hint: (ch) => ({
|
||||||
title: `${ch.type === 'colonization' ? 'Colonization' : 'Fruiting'} humidity`,
|
title: 'Humidity',
|
||||||
body: ch.type === 'colonization'
|
body: 'Colonization likes moist-but-not-soaked air. Fruiting needs very moist air so caps form without drying. Top up the base reservoir or check your humidifier transducer (an easy and cheap replacement) if you notice humidity struggling to keep up.',
|
||||||
? 'Colonization likes moist-but-not-soaked air. If this drops, top up the base humidifier reservoir.'
|
|
||||||
: 'Fruiting needs very moist air so caps form without drying. Top up the base reservoir if this drifts down.',
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -140,16 +139,14 @@
|
|||||||
unit: 'ppm',
|
unit: 'ppm',
|
||||||
color: '#8a6a3d',
|
color: '#8a6a3d',
|
||||||
valueFor: (ch) => (ch.type === 'colonization'
|
valueFor: (ch) => (ch.type === 'colonization'
|
||||||
? (ch.environment.co2e_ppm ?? 0)
|
? (ch.environment?.co2e_ppm ?? 0)
|
||||||
: (ch.environment.co2_ppm ?? 0)).toFixed(0),
|
: (ch.environment?.co2_ppm ?? 0)).toFixed(0),
|
||||||
seriesFor: (ch) => sliceCh(ch, ch.type === 'colonization' ? 'co2e_ppm' : 'co2_ppm'),
|
seriesFor: (ch) => sliceCh(ch, ch.type === 'colonization' ? 'co2e_ppm' : 'co2_ppm'),
|
||||||
rangeFor: (ch) => RANGES.co2[ch.type],
|
rangeFor: (ch) => RANGES.co2[ch.type],
|
||||||
rangeLabel:(ch) => ch.type === 'colonization' ? '<1600 ppm ideal' : '<900 ppm ideal',
|
rangeLabel:(ch) => ch.type === 'colonization' ? '<1600 ppm ideal' : '<900 ppm ideal',
|
||||||
hint: (ch) => ({
|
hint: (ch) => ({
|
||||||
title: `${ch.type === 'colonization' ? 'Colonization' : 'Fruiting'} CO₂`,
|
title: `CO₂`,
|
||||||
body: ch.type === 'colonization'
|
body: 'Colonizing mycelium produces CO₂ as it grows — some is actually helpful. If it gets very high, Cultivar\'s colonization fan kicks in automatically to exchange air. Fruiting mushrooms need fresh air — too much CO₂ and caps come out long-stemmed and small. The fruiting fan exchanges filtered fresh air automatically as needed.',
|
||||||
? 'Mycelium makes CO₂ as it grows — some is actually helpful. If it goes very high, the FAE fan kicks in to exchange air.'
|
|
||||||
: 'Fruiting mushrooms need fresh air — too much CO₂ and caps come out long-stemmed and small. The fruiting fan pulls in filtered fresh air automatically.',
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -157,13 +154,13 @@
|
|||||||
label: 'Air quality',
|
label: 'Air quality',
|
||||||
unit: 'ppb',
|
unit: 'ppb',
|
||||||
color: '#7a6d52',
|
color: '#7a6d52',
|
||||||
valueFor: (ch) => ch.environment.voc_ppb.toFixed(0),
|
valueFor: (ch) => (ch.environment?.voc_ppb ?? 0).toFixed(0),
|
||||||
seriesFor: (ch) => sliceCh(ch, 'voc_ppb'),
|
seriesFor: (ch) => sliceCh(ch, 'voc_ppb'),
|
||||||
rangeFor: (ch) => RANGES.voc[ch.type],
|
rangeFor: (ch) => RANGES.voc[ch.type],
|
||||||
rangeLabel:(ch) => `<${RANGES.voc[ch.type][1]} ppb typical`,
|
rangeLabel:(ch) => `<${RANGES.voc[ch.type][1]} ppb typical`,
|
||||||
hint: () => ({
|
hint: () => ({
|
||||||
title: 'Air quality (VOC)',
|
title: 'Air quality (VOC)',
|
||||||
body: 'Volatile organic compounds. A sudden spike can be an early hint of contamination — it\'s a nose for the chamber.',
|
body: 'Volatile organic compounds. A sudden spike can be an early hint of contamination or a change in mycelial activity. Worth a quick eyes-on check in either case if you see a large swing.',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -224,7 +221,13 @@
|
|||||||
<!-- Metric label (row header, spans both cells via grid) -->
|
<!-- Metric label (row header, spans both cells via grid) -->
|
||||||
<div class="row-label">
|
<div class="row-label">
|
||||||
<span class="rl-name">{m.label}</span>
|
<span class="rl-name">{m.label}</span>
|
||||||
<InfoHint title={m.hint(colonization).title} body={m.hint(colonization).body} side="bottom" />
|
<InfoHint
|
||||||
|
title={m.hint(colonization).title}
|
||||||
|
body={m.hint(colonization).body}
|
||||||
|
side="bottom"
|
||||||
|
open={openHintKey === m.key}
|
||||||
|
onOpenChange={(open) => openHintKey = open ? m.key : null}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Colonization cell -->
|
<!-- Colonization cell -->
|
||||||
|
|||||||
@@ -6,18 +6,23 @@
|
|||||||
side?: 'top' | 'bottom';
|
side?: 'top' | 'bottom';
|
||||||
/** Icon size in px */
|
/** Icon size in px */
|
||||||
size?: number;
|
size?: number;
|
||||||
|
/** Controlled open state (optional) */
|
||||||
|
open?: boolean;
|
||||||
|
/** Callback when open state changes */
|
||||||
|
onOpenChange?: (open: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { title, body, side = 'top', size = 14 }: Props = $props();
|
const { title, body, side = 'top', size = 14, open: controlledOpen, onOpenChange }: Props = $props();
|
||||||
|
|
||||||
let open = $state(false);
|
let internalOpen = $state(false);
|
||||||
|
const open = $derived(controlledOpen ?? internalOpen);
|
||||||
let anchor: HTMLButtonElement | null = $state(null);
|
let anchor: HTMLButtonElement | null = $state(null);
|
||||||
|
|
||||||
const HINT_W = 240;
|
const HINT_W = 240;
|
||||||
const HINT_MAX_W = 260;
|
const HINT_MAX_W = 260;
|
||||||
|
|
||||||
// Computed floating tooltip position (document-level, not clipped by parents)
|
// Computed floating tooltip position (document-level, not clipped by parents)
|
||||||
let pos = $state<{ left: number; top: number; side: 'top' | 'bottom' }>({ left: 0, top: 0, side });
|
let pos = $state<{ left: number; top: number; side: 'top' | 'bottom' }>({ left: 0, top: 0, side: 'top' });
|
||||||
|
|
||||||
function recomputePos() {
|
function recomputePos() {
|
||||||
if (!anchor) return;
|
if (!anchor) return;
|
||||||
@@ -47,17 +52,34 @@
|
|||||||
|
|
||||||
function toggle(e: MouseEvent) {
|
function toggle(e: MouseEvent) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (!open) recomputePos();
|
const newOpen = !open;
|
||||||
open = !open;
|
if (newOpen) recomputePos();
|
||||||
|
if (controlledOpen !== undefined) {
|
||||||
|
onOpenChange?.(newOpen);
|
||||||
|
} else {
|
||||||
|
internalOpen = newOpen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDocClick(e: MouseEvent) {
|
function handleDocClick(e: MouseEvent) {
|
||||||
if (!open) return;
|
if (!open) return;
|
||||||
if (anchor && !anchor.contains(e.target as Node)) open = false;
|
if (anchor && !anchor.contains(e.target as Node)) {
|
||||||
|
if (controlledOpen !== undefined) {
|
||||||
|
onOpenChange?.(false);
|
||||||
|
} else {
|
||||||
|
internalOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleKey(e: KeyboardEvent) {
|
function handleKey(e: KeyboardEvent) {
|
||||||
if (e.key === 'Escape') open = false;
|
if (e.key === 'Escape') {
|
||||||
|
if (controlledOpen !== undefined) {
|
||||||
|
onOpenChange?.(false);
|
||||||
|
} else {
|
||||||
|
internalOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
@@ -131,7 +153,7 @@
|
|||||||
gap: 4px;
|
gap: 4px;
|
||||||
animation: rise-in 0.14s ease-out;
|
animation: rise-in 0.14s ease-out;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
max-width: 260px;
|
max-width: 360px;
|
||||||
}
|
}
|
||||||
/* For top-side, translate up by the tooltip's own height */
|
/* For top-side, translate up by the tooltip's own height */
|
||||||
.hint-top { transform: translateY(-100%); }
|
.hint-top { transform: translateY(-100%); }
|
||||||
@@ -145,6 +167,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hint-body {
|
.hint-body {
|
||||||
|
text-transform: none;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--ink-2);
|
color: var(--ink-2);
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { cultivar } from '../store.svelte';
|
import { cultivar } from '../store.svelte';
|
||||||
|
|
||||||
const active = $derived(
|
const active = $derived(
|
||||||
cultivar.state.environment.alerts.filter(a => !a.dismissed)
|
(cultivar.state.environment?.alerts ?? []).filter(a => !a.dismissed)
|
||||||
);
|
);
|
||||||
|
|
||||||
const icons: Record<string, string> = {
|
const icons: Record<string, string> = {
|
||||||
|
|||||||
@@ -140,6 +140,6 @@
|
|||||||
.meta { display: none; }
|
.meta { display: none; }
|
||||||
.live-label { display: none; }
|
.live-label { display: none; }
|
||||||
.live { padding: 4px 8px; }
|
.live { padding: 4px 8px; }
|
||||||
.topbar { padding: 12px 14px 10px; }
|
.topbar { padding: 12px 14px 10px; grid-template-columns: auto 1fr; }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
const { bagId, onBack }: Props = $props();
|
const { bagId, onBack }: Props = $props();
|
||||||
|
|
||||||
const bag = $derived.by<BagState | null>(() => {
|
const bag = $derived.by<BagState | null>(() => {
|
||||||
for (const chamber of cultivar.state.chambers) {
|
for (const chamber of cultivar.state.chambers ?? []) {
|
||||||
for (const slot of chamber.slots) {
|
for (const slot of chamber.slots ?? []) {
|
||||||
if (slot.bag?.bag_id === bagId) return slot.bag;
|
if (slot.bag?.bag_id === bagId) return slot.bag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<div class="fact">
|
<div class="fact">
|
||||||
<dt>
|
<dt>
|
||||||
Confidence
|
Confidence
|
||||||
<InfoHint title="Confidence" body="How sure Cultivar is about its reading from the photos. Low confidence usually means the camera lens needs a gentle wipe." side="bottom" />
|
<InfoHint title="Confidence" body="How sure Cultivar is about its reading from the photos. Low confidence usually means the camera can't get a good view. Try giving the lens a gentle wipe or repositioning the bag for a clearer shot." side="bottom" />
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="font-serif">{Math.round(bag.vision.colonization_confidence * 100)}%</dd>
|
<dd class="font-serif">{Math.round(bag.vision.colonization_confidence * 100)}%</dd>
|
||||||
</div>
|
</div>
|
||||||
@@ -418,6 +418,7 @@
|
|||||||
.visual-col,
|
.visual-col,
|
||||||
.info-col {
|
.info-col {
|
||||||
min-width: 0; /* prevent grid blowout from long inner content */
|
min-width: 0; /* prevent grid blowout from long inner content */
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-col {
|
.info-col {
|
||||||
@@ -436,6 +437,7 @@
|
|||||||
.bag-twin-container {
|
.bag-twin-container {
|
||||||
aspect-ratio: 3/4;
|
aspect-ratio: 3/4;
|
||||||
max-height: 520px;
|
max-height: 520px;
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -678,7 +680,7 @@
|
|||||||
top: 16px;
|
top: 16px;
|
||||||
}
|
}
|
||||||
.bag-twin-container {
|
.bag-twin-container {
|
||||||
max-height: 560px;
|
max-height: calc(100vh - 250px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+60
-25
@@ -35,8 +35,8 @@
|
|||||||
const history = $derived(cv.environment.history);
|
const history = $derived(cv.environment.history);
|
||||||
const targets = $derived(cv.environment.targets);
|
const targets = $derived(cv.environment.targets);
|
||||||
const hw = $derived(cv.hardware);
|
const hw = $derived(cv.hardware);
|
||||||
const colChamber = $derived(chambers.find(c => c.type === 'colonization') ?? chambers[0]);
|
const colChamber = $derived(chambers.find(c => c.type === 'colonization') ?? chambers[0] ?? { type: 'colonization', slots: [] });
|
||||||
const fruitChamber = $derived(chambers.find(c => c.type === 'fruiting') ?? chambers[1]);
|
const fruitChamber = $derived(chambers.find(c => c.type === 'fruiting') ?? chambers[1] ?? { type: 'fruiting', slots: [] });
|
||||||
|
|
||||||
const allBags = $derived(
|
const allBags = $derived(
|
||||||
chambers.flatMap(c =>
|
chambers.flatMap(c =>
|
||||||
@@ -75,6 +75,7 @@
|
|||||||
));
|
));
|
||||||
const highContam = $derived(allBags.filter(({ bag }) => bag.vision.contamination_risk === 'high'));
|
const highContam = $derived(allBags.filter(({ bag }) => bag.vision.contamination_risk === 'high'));
|
||||||
const lowContam = $derived(allBags.filter(({ bag }) => bag.vision.contamination_risk === 'low' || bag.vision.contamination_risk === 'medium'));
|
const lowContam = $derived(allBags.filter(({ bag }) => bag.vision.contamination_risk === 'low' || bag.vision.contamination_risk === 'medium'));
|
||||||
|
const contamConfidence = $derived(allBags.map(({ bag }) => bag.vision.contamination_confidence));
|
||||||
|
|
||||||
// ── Climate pattern detection ────────────────────────────────────
|
// ── Climate pattern detection ────────────────────────────────────
|
||||||
// Is CO2e on the colonization side consistently high despite the fan working?
|
// Is CO2e on the colonization side consistently high despite the fan working?
|
||||||
@@ -112,13 +113,13 @@
|
|||||||
|
|
||||||
// ── Briefing paragraphs (the "intern voice", now with bag locations) ─
|
// ── Briefing paragraphs (the "intern voice", now with bag locations) ─
|
||||||
const growPara = $derived.by(() => {
|
const growPara = $derived.by(() => {
|
||||||
const sentences: string[] = [];
|
const paragraphs: string[] = [];
|
||||||
|
|
||||||
// Harvest-ready
|
// Harvest-ready
|
||||||
if (harvestReady.length > 0) {
|
if (harvestReady.length > 0) {
|
||||||
const list = bagList(harvestReady, allBags);
|
const list = bagList(harvestReady, allBags);
|
||||||
const verb = harvestReady.length === 1 ? 'is' : 'are';
|
const verb = harvestReady.length === 1 ? 'is' : 'are';
|
||||||
sentences.push(`${capFirst(list)} ${verb} ready to pick today, caps full right on schedule.`);
|
paragraphs.push(`${capFirst(list)} ${verb} ready to pick today, caps full right on schedule.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fruiting imminent
|
// Fruiting imminent
|
||||||
@@ -128,15 +129,15 @@
|
|||||||
const label = bagLabel(bag, chamber, allBags);
|
const label = bagLabel(bag, chamber, allBags);
|
||||||
return `${label} (about ${d} day${d === 1 ? '' : 's'} out)`;
|
return `${label} (about ${d} day${d === 1 ? '' : 's'} out)`;
|
||||||
});
|
});
|
||||||
sentences.push(
|
paragraphs.push(
|
||||||
`${capFirst(joinHuman(items))} ${fruitingSoon.length === 1 ? 'is' : 'are'} fruiting and on track.`
|
`${capFirst(joinHuman(items))} ${fruitingSoon.length === 1 ? 'is' : 'are'} fruiting and on track.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pinning — only if we haven't said much yet
|
// Pinning — only if we haven't said much yet
|
||||||
if (pinning.length > 0 && sentences.length < 2) {
|
if (pinning.length > 0 && paragraphs.length < 2) {
|
||||||
const list = bagList(pinning, allBags);
|
const list = bagList(pinning, allBags);
|
||||||
sentences.push(
|
paragraphs.push(
|
||||||
`${capFirst(list)} started pinning, so little primordia should be popping through the cuts.`
|
`${capFirst(list)} started pinning, so little primordia should be popping through the cuts.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -145,35 +146,35 @@
|
|||||||
if (readyToMove.length > 0) {
|
if (readyToMove.length > 0) {
|
||||||
const list = bagList(readyToMove, allBags);
|
const list = bagList(readyToMove, allBags);
|
||||||
const pct = readyToMove[0].bag.vision.colonization_pct;
|
const pct = readyToMove[0].bag.vision.colonization_pct;
|
||||||
sentences.push(
|
paragraphs.push(
|
||||||
`Over on the colonization side, ${list} finished the mycelium run at ${pct}% and can move to fruiting when you have a minute.`
|
`On to colonization...${list} is showing a strong mycelium network at ${pct}% coverage and can move to fruiting when you have a minute.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contamination — kept specific but never alarmist
|
// Contamination — kept specific but never alarmist
|
||||||
if (highContam.length > 0) {
|
if (highContam.length > 0) {
|
||||||
const list = bagList(highContam, allBags);
|
const list = bagList(highContam, allBags);
|
||||||
sentences.push(
|
paragraphs.push(
|
||||||
`The camera picked up a contamination signal on ${list}. Worth opening the door today and having a quick look.`
|
`The camera picked up a contamination signal on ${list}. Worth opening the door today and having a quick look.`
|
||||||
);
|
);
|
||||||
} else if (lowContam.length > 0) {
|
} else if (lowContam.length > 0) {
|
||||||
const list = bagList(lowContam, allBags);
|
const list = bagList(lowContam, allBags);
|
||||||
sentences.push(
|
paragraphs.push(
|
||||||
`${capFirst(list)} shows a faint contamination hint, nothing serious, just one to glance at next time you're nearby.`
|
`${capFirst(list)} shows a faint potential contamination signal. Nothing serious, just one to glance at next time you're nearby.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calm day
|
// Calm day
|
||||||
if (sentences.length === 0) {
|
if (paragraphs.length === 0) {
|
||||||
const total = allBags.length;
|
const total = allBags.length;
|
||||||
sentences.push(
|
paragraphs.push(
|
||||||
total > 0
|
total > 0
|
||||||
? `All ${total} bags are tracking along today. Nothing needs you.`
|
? `All ${total} bags are tracking along today. Nothing needs you.`
|
||||||
: `Your Cultivar is empty, resting until the next batch.`
|
: `Your Cultivar is empty, resting until the next batch.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sentences.join(' ');
|
return paragraphs;
|
||||||
});
|
});
|
||||||
|
|
||||||
const climatePara = $derived.by(() => {
|
const climatePara = $derived.by(() => {
|
||||||
@@ -531,10 +532,20 @@
|
|||||||
|
|
||||||
<!-- The intern briefing — two short paragraphs of plain language -->
|
<!-- The intern briefing — two short paragraphs of plain language -->
|
||||||
<div class="briefing">
|
<div class="briefing">
|
||||||
<p class="brief-par">{growPara}</p>
|
{#each growPara as para}
|
||||||
|
<p class="brief-par">{para}</p>
|
||||||
|
{/each}
|
||||||
<p class="brief-par">{climatePara}</p>
|
<p class="brief-par">{climatePara}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Decorative illustration for wide screens (fills whitespace) -->
|
||||||
|
<img
|
||||||
|
src="/img/illustration.webp"
|
||||||
|
alt=""
|
||||||
|
class="hero-illustration"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="hero-stats">
|
<div class="hero-stats">
|
||||||
|
|
||||||
<div class="hs-item">
|
<div class="hs-item">
|
||||||
@@ -582,6 +593,7 @@
|
|||||||
|
|
||||||
<!-- ═══ Rhythm — everything you can / should do ═══ -->
|
<!-- ═══ Rhythm — everything you can / should do ═══ -->
|
||||||
<aside class="rhythm" aria-label="On your list">
|
<aside class="rhythm" aria-label="On your list">
|
||||||
|
<div>
|
||||||
<div class="rhythm-head">
|
<div class="rhythm-head">
|
||||||
<div class="eyebrow">Rhythm</div>
|
<div class="eyebrow">Rhythm</div>
|
||||||
<h3 class="rhythm-title font-serif">On your list</h3>
|
<h3 class="rhythm-title font-serif">On your list</h3>
|
||||||
@@ -651,12 +663,12 @@
|
|||||||
Nothing on your list. Cultivar's taking care of the rest.
|
Nothing on your list. Cultivar's taking care of the rest.
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
<div class="rhythm-foot">
|
<div class="rhythm-foot">
|
||||||
<span class="rhythm-foot-line font-serif italic">
|
<span class="rhythm-foot-line font-serif italic">
|
||||||
Cultivar handles humidification, airflow, and lighting on its own.
|
Cultivar is handling humidification, CO₂ & O₂ exchange, and light intensity and timing.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -757,6 +769,20 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
position: relative; /* for absolute positioning of illustration */
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-illustration {
|
||||||
|
display: none; /* hidden on smaller screens */
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
left: calc(50ch + 5%); /* to the right of briefing max-width */
|
||||||
|
width: auto;
|
||||||
|
height: 65%;
|
||||||
|
object-fit: contain;
|
||||||
|
opacity: 0.75;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-head {
|
.hero-head {
|
||||||
@@ -784,7 +810,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 14px;
|
gap: 14px;
|
||||||
max-width: 62ch;
|
max-width: 50ch;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
.brief-par {
|
.brief-par {
|
||||||
@@ -835,8 +861,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 14px;
|
gap: 14px;
|
||||||
|
z-index: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rhythm-head { display: flex; flex-direction: column; gap: 3px; }
|
.rhythm-head { display: flex; flex-direction: column; gap: 3px; }
|
||||||
@@ -951,7 +979,7 @@
|
|||||||
/* ── Rhythm footer — soft reminder that Cultivar handles the rest ── */
|
/* ── Rhythm footer — soft reminder that Cultivar handles the rest ── */
|
||||||
.rhythm-foot {
|
.rhythm-foot {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
padding-top: 14px;
|
padding-top: 20px;
|
||||||
border-top: 1px dashed var(--line);
|
border-top: 1px dashed var(--line);
|
||||||
}
|
}
|
||||||
.rhythm-foot-line {
|
.rhythm-foot-line {
|
||||||
@@ -985,10 +1013,17 @@
|
|||||||
.foot-sep { opacity: 0.4; }
|
.foot-sep { opacity: 0.4; }
|
||||||
|
|
||||||
/* ── Responsive ── */
|
/* ── Responsive ── */
|
||||||
@media (max-width: 980px) {
|
@media (min-width: 1100px) {
|
||||||
|
.hero-illustration {
|
||||||
|
display: block; /* show on very wide screens with whitespace */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 950px) {
|
||||||
.hero {
|
.hero {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
|
max-width: 50ch;
|
||||||
}
|
}
|
||||||
.hero-stats { margin-top: 6px; }
|
.hero-stats { margin-top: 6px; }
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="695" zoomAndPan="magnify" viewBox="0 0 521.25 140.249994" height="187" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><g/><clipPath id="102357b0b3"><path d="M 1.011719 0 L 444 0 L 444 139.503906 L 1.011719 139.503906 Z M 1.011719 0 " clip-rule="nonzero"/></clipPath><clipPath id="428fdd57e5"><rect x="0" width="443" y="0" height="140"/></clipPath><clipPath id="9ac51ea07f"><path d="M 437 0 L 519.492188 0 L 519.492188 139.503906 L 437 139.503906 Z M 437 0 " clip-rule="nonzero"/></clipPath><clipPath id="50e583f27b"><rect x="0" width="83" y="0" height="140"/></clipPath></defs><g clip-path="url(#102357b0b3)"><g transform="matrix(1, 0, 0, 1, 1, -0.000000000000003526)"><g clip-path="url(#428fdd57e5)"><g fill="#4d4d4d" fill-opacity="1"><g transform="translate(-0.732702, 134.847758)"><g><path d="M 61.21875 3.03125 C 49.78125 3.03125 39.71875 0.648438 31.03125 -4.109375 C 22.34375 -8.878906 15.554688 -15.664062 10.671875 -24.46875 C 5.796875 -33.269531 3.359375 -43.671875 3.359375 -55.671875 C 3.359375 -67.328125 5.769531 -77.53125 10.59375 -86.28125 C 15.414062 -95.03125 22.394531 -101.84375 31.53125 -106.71875 C 40.675781 -111.59375 51.75 -114.03125 64.75 -114.03125 C 70.695312 -114.03125 76.21875 -113.359375 81.3125 -112.015625 C 86.414062 -110.671875 91.265625 -108.707031 95.859375 -106.125 L 96.546875 -82.578125 L 94.859375 -82.578125 L 85.4375 -100.078125 C 83.976562 -102.878906 82.628906 -104.894531 81.390625 -106.125 C 80.160156 -107.351562 78.59375 -108.304688 76.6875 -108.984375 C 74.894531 -109.546875 73.242188 -109.96875 71.734375 -110.25 C 70.222656 -110.53125 68.234375 -110.671875 65.765625 -110.671875 C 58.804688 -110.671875 52.664062 -108.816406 47.34375 -105.109375 C 42.019531 -101.410156 37.898438 -95.523438 34.984375 -87.453125 C 32.066406 -79.378906 30.609375 -68.785156 30.609375 -55.671875 C 30.609375 -42.660156 31.976562 -32.0625 34.71875 -23.875 C 37.46875 -15.695312 41.363281 -9.726562 46.40625 -5.96875 C 51.457031 -2.21875 57.289062 -0.34375 63.90625 -0.34375 C 64.914062 -0.34375 65.894531 -0.425781 66.84375 -0.59375 C 67.800781 -0.757812 68.726562 -0.953125 69.625 -1.171875 C 71.757812 -1.515625 73.160156 -2.414062 73.828125 -3.875 C 74.503906 -5.332031 74.84375 -7.066406 74.84375 -9.078125 L 74.84375 -42.390625 C 74.84375 -46.753906 72.597656 -49.441406 68.109375 -50.453125 L 60.375 -52.46875 L 60.375 -54.15625 L 107.8125 -54.15625 L 107.8125 -52.46875 L 105.453125 -51.796875 C 101.191406 -50.453125 99.0625 -47.648438 99.0625 -43.390625 L 99.0625 -6.890625 C 93.226562 -3.640625 87.3125 -1.175781 81.3125 0.5 C 75.320312 2.1875 68.625 3.03125 61.21875 3.03125 Z M 61.21875 3.03125 "/></g></g></g><g fill="#4d4d4d" fill-opacity="1"><g transform="translate(109.595295, 134.847758)"><g><path d="M 3.359375 0 L 3.359375 -1.6875 L 5.890625 -2.359375 C 8.128906 -3.023438 9.664062 -4.03125 10.5 -5.375 C 11.34375 -6.726562 11.765625 -8.46875 11.765625 -10.59375 L 11.765625 -63.234375 C 11.765625 -65.703125 11.34375 -67.523438 10.5 -68.703125 C 9.664062 -69.878906 8.128906 -70.691406 5.890625 -71.140625 L 3.359375 -71.8125 L 3.359375 -73.5 L 32.296875 -83.25 L 33.96875 -81.578125 L 35.484375 -67.109375 L 35.484375 -65.765625 C 37.054688 -68.898438 39.101562 -71.785156 41.625 -74.421875 C 44.144531 -77.054688 46.945312 -79.210938 50.03125 -80.890625 C 53.113281 -82.578125 56.171875 -83.421875 59.203125 -83.421875 C 63.460938 -83.421875 66.710938 -82.242188 68.953125 -79.890625 C 71.203125 -77.535156 72.328125 -74.5625 72.328125 -70.96875 C 72.328125 -67.15625 71.234375 -64.210938 69.046875 -62.140625 C 66.859375 -60.066406 64.25 -59.03125 61.21875 -59.03125 C 56.507812 -59.03125 52.363281 -61.382812 48.78125 -66.09375 L 48.4375 -66.4375 C 47.3125 -68 46.019531 -68.863281 44.5625 -69.03125 C 43.113281 -69.207031 41.769531 -68.507812 40.53125 -66.9375 C 39.40625 -65.925781 38.476562 -64.71875 37.75 -63.3125 C 37.03125 -61.914062 36.332031 -60.320312 35.65625 -58.53125 L 35.65625 -11.609375 C 35.65625 -7.117188 37.617188 -4.316406 41.546875 -3.203125 L 46.921875 -1.6875 L 46.921875 0 Z M 3.359375 0 "/></g></g></g><g fill="#4d4d4d" fill-opacity="1"><g transform="translate(181.073002, 134.847758)"><g><path d="M 45.921875 2.515625 C 37.398438 2.515625 30 0.75 23.71875 -2.78125 C 17.4375 -6.3125 12.582031 -11.328125 9.15625 -17.828125 C 5.738281 -24.328125 4.03125 -31.953125 4.03125 -40.703125 C 4.03125 -49.441406 5.851562 -57.007812 9.5 -63.40625 C 13.144531 -69.800781 18.132812 -74.734375 24.46875 -78.203125 C 30.800781 -81.679688 37.953125 -83.421875 45.921875 -83.421875 C 53.878906 -83.421875 60.992188 -81.707031 67.265625 -78.28125 C 73.546875 -74.863281 78.507812 -69.957031 82.15625 -63.5625 C 85.800781 -57.175781 87.625 -49.554688 87.625 -40.703125 C 87.625 -31.847656 85.910156 -24.195312 82.484375 -17.75 C 79.066406 -11.300781 74.25 -6.3125 68.03125 -2.78125 C 61.8125 0.75 54.441406 2.515625 45.921875 2.51562Line truncated
|
|
||||||
|
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
+25
-12
@@ -1,18 +1,31 @@
|
|||||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
import path from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
export default defineConfig({
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
plugins: [svelte()],
|
|
||||||
// Svelte convention — serve /static/* at the web root (fonts, img, etc.)
|
export default defineConfig(({ mode }) => {
|
||||||
publicDir: 'static',
|
const mockFile = mode === 'development' ? './src/lib/mock.dev.ts' : './src/lib/mock.prod.ts';
|
||||||
build: {
|
|
||||||
outDir: 'dist',
|
return {
|
||||||
target: 'es2020',
|
plugins: [svelte()],
|
||||||
cssCodeSplit: false,
|
// Svelte convention — serve /static/* at the web root (fonts, img, etc.)
|
||||||
rollupOptions: {
|
publicDir: 'static',
|
||||||
output: {
|
resolve: {
|
||||||
manualChunks: undefined,
|
alias: {
|
||||||
|
'@mock-data': path.resolve(__dirname, mockFile),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: 'dist',
|
||||||
|
target: 'es2020',
|
||||||
|
cssCodeSplit: false,
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: undefined,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user