diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7a550fe --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +# GEMINI_API_KEY: Required for Gemini AI API calls. +# AI Studio automatically injects this at runtime from user secrets. +# Users configure this via the Secrets panel in the AI Studio UI. +GEMINI_API_KEY="MY_GEMINI_API_KEY" + +# APP_URL: The URL where this applet is hosted. +# AI Studio automatically injects this at runtime with the Cloud Run service URL. +# Used for self-referential links, OAuth callbacks, and API endpoints. +APP_URL="MY_APP_URL" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a86d2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +build/ +dist/ +coverage/ +.DS_Store +*.log +.env* +!.env.example diff --git a/README.md b/README.md index 2241000..fca6b07 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,20 @@
- -GHBanner - -

Built with AI Studio

- -

The fastest path from prompt to production with Gemini.

- - Start building - +GHBanner
+ +# Run and deploy your AI Studio app + +This contains everything you need to run your app locally. + +View your app in AI Studio: https://ai.studio/apps/04192c90-3a0d-4b46-b2d6-3ab221401a34 + +## Run Locally + +**Prerequisites:** Node.js + + +1. Install dependencies: + `npm install` +2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key +3. Run the app: + `npm run dev` diff --git a/assets/.aistudio/.gitignore b/assets/.aistudio/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/assets/.aistudio/.gitignore @@ -0,0 +1 @@ +* diff --git a/index.html b/index.html new file mode 100644 index 0000000..21dfe69 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + My Google AI Studio App + + +
+ + + + diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..d2ed566 --- /dev/null +++ b/metadata.json @@ -0,0 +1,6 @@ +{ + "name": "OneOSS Hydrogen Box", + "description": "Product landing page for the futuristic OneOSS Hydrogen Safety & Carbon Factor Box.", + "requestFramePermissions": [], + "majorCapabilities": ["MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..44745ed --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "react-example", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite --port=3000 --host=0.0.0.0", + "build": "vite build", + "preview": "vite preview", + "clean": "rm -rf dist server.js", + "lint": "tsc --noEmit" + }, + "dependencies": { + "@google/genai": "^2.4.0", + "@tailwindcss/vite": "^4.1.14", + "@vitejs/plugin-react": "^5.0.4", + "lucide-react": "^0.546.0", + "react": "^19.0.1", + "react-dom": "^19.0.1", + "vite": "^6.2.3", + "express": "^4.21.2", + "dotenv": "^17.2.3", + "motion": "^12.23.24" + }, + "devDependencies": { + "@types/node": "^22.14.0", + "autoprefixer": "^10.4.21", + "esbuild": "^0.25.0", + "tailwindcss": "^4.1.14", + "tsx": "^4.21.0", + "typescript": "~5.8.2", + "vite": "^6.2.3", + "@types/express": "^4.17.21" + } +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..f53ef4c --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,914 @@ +import React, { useState } from 'react'; +import { motion, AnimatePresence } from 'motion/react'; +import { + Activity, ShieldCheck, Zap, Server, ChevronRight, + Database, Cpu, Cloud, Truck, Factory, Building, Target, + Leaf, AlertTriangle, Wind, Thermometer, Gauge, Navigation, + Settings, Battery, Link2, Share2, Search, LineChart, BarChart, + Radio, HardDrive, Network, MapPin, CheckCircle2, Factory as FactoryIcon, ShieldAlert, Workflow, + Maximize2, Eye, Sliders, Flame, Compass, RefreshCw +} from 'lucide-react'; + +// --- Import assets --- +import oneossBoxImage from './assets/images/oneoss_box_1779852084134.png'; +import oneossSideFacet from './assets/images/oneoss_side_facet_1779862455874.png'; +import oneossTopFacet from './assets/images/oneos_top_facet_1779864912925.png'; +import scenarioFleetImage from './assets/images/scenario_fleet_1779863559233.png'; +import scenarioStationImage from './assets/images/scenario_station_1779863574991.png'; +import scenarioDatacenterImage from './assets/images/scenario_datacenter_1779863590420.png'; + +// --- Reusable Compact Architecture Component --- + +const CompactArchCard = ({ title, children, className = "", headerClass = "bg-[#121212]" }: { title?: React.ReactNode, children: React.ReactNode, className?: string, headerClass?: string }) => ( +
+ {/* Decorative micro LED accent on card edge */} +
+ {title && ( +
+ {title} +
+ )} +
+ {children} +
+
+); + +const CompactArchList = ({ items }: { items: { icon?: any, text: string, textEn?: string }[] }) => ( + +); + +type StylePreset = 'cyan' | 'amber' | 'crimson'; + +interface PerspectiveFacet { + id: string; + nameCn: string; + nameEn: string; + image: string; + descriptionCn: string; + descriptionEn: string; + specs: { label: string; value: string }[]; +} + +export default function App() { + const [activeTab, setActiveTab] = useState<'overview' | 'architecture'>('overview'); + + // Custom futuristic theme/preset selector state + const [styleTheme, setStyleTheme] = useState('cyan'); + + // Interactive Perspective Switcher State + const [activeFacet, setActiveFacet] = useState('top'); + + const themes = { + cyan: { + accent: '#00F2FF', + glow: 'shadow-[0_0_20px_rgba(0,242,255,0.25)]', + border: 'border-[#00F2FF]/30', + textAccent: 'text-[#00F2FF]', + bgAccent: 'bg-[#00F2FF]', + borderAccent: 'border-[#00F2FF]', + gradient: 'from-[#00F2FF] to-[#0066FF]', + radialGlow: 'bg-[#00F2FF]/5', + nameCn: '极光霓虹', + nameEn: 'Aurora Cyan' + }, + amber: { + accent: '#FBBF24', + glow: 'shadow-[0_0_20px_rgba(251,191,36,0.25)]', + border: 'border-[#FBBF24]/30', + textAccent: 'text-[#FBBF24]', + bgAccent: 'bg-[#FBBF24]', + borderAccent: 'border-[#FBBF24]', + gradient: 'from-[#FBBF24] to-[#D97706]', + radialGlow: 'bg-[#FBBF24]/5', + nameCn: '航天鎏金', + nameEn: 'Aerospace Amber' + }, + crimson: { + accent: '#EF4444', + glow: 'shadow-[0_0_20px_rgba(239,68,68,0.25)]', + border: 'border-[#EF4444]/30', + textAccent: 'text-[#EF4444]', + bgAccent: 'bg-[#EF4444]', + borderAccent: 'border-[#EF4444]', + gradient: 'from-[#EF4444] to-[#991B1B]', + radialGlow: 'bg-[#EF4444]/5', + nameCn: '聚变红核', + nameEn: 'Fusion Crimson' + } + }; + + const activeTheme = themes[styleTheme]; + + const facets: PerspectiveFacet[] = [ + { + id: 'iso', + nameCn: '立体主视图', + nameEn: 'Isometric View', + image: oneossBoxImage, + descriptionCn: '全铝阳极氧化磨砂太空灰机壳,线条凝练锐利,边缘搭载可变色长条形高精度脉冲 LED 光斑状态指示器,彰显现代工业极简美学。', + descriptionEn: 'Anodized sandblasted space-gray aluminum casing with razor-sharp geometric contours, presenting active pulsating high-frequency pulse status LEDs.', + specs: [ + { label: 'Chassis Material', value: 'Anodized Aluminum' }, + { label: 'Ingress Rating', value: 'IP67 Waterproof' }, + { label: 'Operating Temp', value: '-40°C to +85°C' } + ] + }, + { + id: 'side', + nameCn: '连接器切面', + nameEn: 'Connector Detail', + image: oneossSideFacet, + descriptionCn: '机身侧部配置重工业级 M12 耐高负载密封金属插座,保障信号链路与大电流供应在多端复杂极端环境下的无损传输。', + descriptionEn: 'High-load heavy industrial M12 sealed metal connectors designed to safeguard physical connectivity under extreme multi-node environments.', + specs: [ + { label: 'Interface Type', value: 'M12 Industrial A-Coded' }, + { label: 'Contact Finish', value: 'Gold-Plated/Copper Alloy' }, + { label: 'Coupling Method', value: 'Threaded Locking Joint' } + ] + }, + { + id: 'top', + nameCn: '顶板盖透视图', + nameEn: 'Holographic Deck', + image: oneossTopFacet, + descriptionCn: '半透明暗色钢化玻璃盖板板底饰有沉金电路纹章,结合内部微弱背光结构,完美融合未来感科技韵味。', + descriptionEn: 'High-strength semi-translucent dark tempered glass with complex circuit tracing architecture embedded under subtle microchips array.', + specs: [ + { label: 'Panel Type', value: 'Corning Gorilla Glass v5' }, + { label: 'Thermal Shielding', value: 'Aerogel Thermal Layer' }, + { label: 'Chassis Pressure', value: 'Internal Relief Valves' } + ] + } + ]; + + const selectedFacet = facets.find(f => f.id === activeFacet) || facets[0]; + + return ( +
+ + {/* 1. Header Navigation */} +
+
+
+
+
+
+
+
+ + OneOS V2.0 + + Hydrogen Safety Control Matrix +
+
+ + {/* Tab & Language Header Selector */} +
+
+ + +
+ +
+ + {/* Theme Preset Selector */} +
+ Style Matrix: + {(['cyan', 'amber', 'crimson'] as StylePreset[]).map((themeName) => { + const t = themes[themeName]; + return ( + + ); + })} +
+
+
+ + {/* 2. Main Workspace */} +
+ + {/* Futuristic Ambient Grid Overlay */} +
+
+
+
+
+ + + + {/* ========================================================================= + TAB: PRODUCT OVERVIEW & CUT SECTIONS (中英双语) + ========================================================================= */} + {activeTab === 'overview' && ( + + {/* LEFT INTRODUCTORY PANEL (Bilingual, Rich Copy) */} +
+ + {/* Style Palette Mobile Hotbar */} +
+ 切换科技氛围 +
+ {(['cyan', 'amber', 'crimson'] as StylePreset[]).map((themeName) => { + const t = themes[themeName]; + return ( + + ); + })} +
+
+ +
+ {/* Small tag */} +
+ + + OneOS Industrial v6.0 Terminal Protocol + +
+ + {/* Title Matrix */} +
+

+ Hydrogen Safety &
+ + Carbon Factor Box + +

+
+

+ LNbox 氢能智能终端 +

+
+
+ + {/* Copy Block in Chinese & English */} +
+

+ OneOS AI 氢能控制终端 (LNbox) 是一款专为工业复杂场景定制的紧凑级高可靠核心控制设备。全机采用微几何立体机架防爆架构,精调极简工艺,支持多点秒级 H2 浓度、管网压力数据采集分析及碳因子追踪。 +

+

+ The LNbox AI-powered telemetry unit encapsulates raw hydrogen safety algorithms and active carbon factor logging. Crafted out of highgrade materials to endure corrosive industrial environments. +

+
+ + {/* Feature Pillars Highlights (Bilingual) */} +
+
+
+
+
+ +
+ 防爆与泄漏监测 +
+

精细感知泄漏阀值及车压变化,支持秒级自动气路阻断控制。

+ Level 4 Active Isolation Protocol +
+ +
+
+
+
+ +
+ 低碳因子动态上链 +
+

原生搭载碳估算模型核准装置,提供实时清洁绿氢因子加密认证。

+ Encrypted Carbon Ledger Hub +
+ +
+
+
+
+ +
+ 能源 AI 智能调度 +
+

结合边缘端负荷估算与最优分配策略,实现绿电制氢与用能消纳自适应分配。

+ Autonomous Energy AI Dispatch +
+ +
+
+
+
+ +
+ 本地自研边缘算力 +
+

整合轻量级故障预测神经网络,支持离网计算及异常智能判断。

+ Intellectual AI Inference Engine +
+
+
+ + +
+ + {/* RIGHT PREMIUM VISUAL PRESENTATION WITH PERSPECTIVE/STYLE SWAPPER */} +
+ + {/* Absolute status background */} +
+ + ACCENT STATE: {activeTheme.nameEn} +
+ + {/* Main Visual Display Block */} +
+ + {/* Dynamic interactive heading showcasing which viewpoint we're examining */} +
+
Live Render Viewpoint
+
+ {selectedFacet.nameCn} + / + {selectedFacet.nameEn} +
+
+ +
+ {/* Pulsing neon halo under the device frame mirroring styleTheme */} +
+ + {/* Device Rendering Box with active styles */} +
+ + {/* Compact 2-line floating brand brand overlay as requested: LN on top, ONEOS below */} +
+
+ LN +
+
+ ONEOS +
+
+ + {/* Interactive image layer with smooth transitions */} + + + + + {/* Tech alignment markers representing standard octane studio photo overlays */} +
+ OCTANE_RENDER_V6_HD + GRID_LOCK_ALGN [OK] +
+ + {/* Accent lighting element overlays that dynamically changes colors based on chosen matrix preset */} +
+
+
+ + {/* Mini details spec card for active perspective */} +
+ {selectedFacet.specs.map((item, idx) => ( +
+ {item.label} + {item.value} +
+ ))} +
+
+ + {/* Perspective selector tab featuring three actual small product preview images */} +
+
+ {facets.map((facet) => { + const isSelected = activeFacet === facet.id; + return ( + + ); + })} +
+
+ +
+ + )} + + {/* ========================================================================= + TAB: CORE LOGICAL ARCHITECTURE FLOW (Bilingual & Exactly Matching Attached Diagram) + ========================================================================= */} + {activeTab === 'architecture' && ( + + + {/* Architecture Title block with both ENG and CN */} +
+
+ Logical Data Flow and System Infrastructure +
+

+ OneOS AI 氢能盒子 - 核心逻辑架构图 +

+

+ BI-LINGUAL SCHEMATIC FLOW CHART • 100% FULL-SCREEN COCKPIT +

+
+ + {/* Exact column layout with custom bidirectional connectors */} +
+ + {/* COLUMN 1: 数据采集层 (Data Capture Layer, ~18% width) */} +
+
+
数据采集层
+
Data Capture Matrix
+
+ + 车辆/设备数据
} className="flex-[1.3_1.3_0%]"> + + + + 环境数据
} className="flex-1"> + + +
+ + {/* FLOW CONNECTOR 1: Left to Center (Capture <-> AI Core) */} +
+
+ {/* Left/Top arrowhead */} + + + + {/* Glowing vertical path */} +
+ {/* Right/Bottom arrowhead */} + + + +
+
+ + {/* COLUMN 2: ONEOS AI 氢能盒子 (Intelligent Core Box Node, Flex-1) */} +
+ {/* Glowing halo behind box node */} +
+ +
+
+ OneOS AI 氢能盒子 +
+
LNbox Core Hardware Hub
+
+ + {/* 3-Column Internal Layout: Modules - Central Hardware - Modules */} +
+ + {/* Left Sub-column: Safety & Carbon */} +
+ 氢安全管理模块
} className="flex-1"> + + + + 碳因子管理模块
} className="flex-1"> + + +
+ + {/* Central Sub-column: Interactive Hardware Showcase */} +
+ {/* Interactive circuit-like subtle glow */} +
+ +
+ OneOS AI Hardware cover plate + + {/* Custom status overlays */} +
+ LN +
+
+ ONEOS +
+
+ + {/* Small operational thumbnails */} +
+
+ Top Facet +
+
+ Side Facet +
+
+ Full Box +
+
+
+ + {/* Right Sub-column: AI Analyzers & Device Management */} +
+ AI分析决策模块
} className="flex-1"> + + + + 设备管理模块
} className="flex-1"> + + +
+ +
+ + {/* Vertical flow connector pointing up from Data Security to Central Hardware (Modification 1) */} +
+
{/* Left empty */} +
+ {/* Arrowhead pointing UP */} + + + + {/* Vertical line with glow */} +
+
+
{/* Right empty */} +
+ + {/* Stretching bottom card: 数据安全模块 */} +
+
+ 数据安全模块 (Data Security Framework) +
+
+
+ + 数据加密 + AES/ECC +
+
+ + 权限管理 + RBAC Mode +
+
+ + 安全存储 + Enclave Vault +
+
+ + 可信通信 + TLS Tunneling +
+
+
+ +
+ + {/* FLOW CONNECTOR 2: Center to Cloud (AI Core <-> Cloud AIoT) */} +
+
+ + + +
+ + + +
+
+ + {/* COLUMN 3: OneOS 云平台 (OneOS AIoT Cloud Platform, ~18% width) */} +
+
+
OneOS 云平台
+
Core AIoT Cloud
+
+ + OneOS AIoT 平台
} className="flex-1"> + {/* Futuristic Large Cloud core visualization panel (Modification 2) */} +
+ {/* Abstract grid matrix */} +
+ + {/* Pulsing orbital rings */} +
+
+ + {/* Main cloud glowing structure */} +
+ +
+
+
+ + {/* Description & name */} + OneOS Cloud Hub + Omni AIoT Control Core + + {/* Flowing particle stream */} +
+
+
+
+
+
+ + + +
+ + {/* FLOW CONNECTOR 3: Cloud to Applications (Cloud AIoT <-> Scenario Scopes) */} +
+
+ + + +
+ + + +
+
+ + {/* COLUMN 4: 应用场景 (Operational Scenarios Layer, ~18% width) */} +
+
+
应用场景
+
Operational Scenarios
+
+ + {/* Scenario 1: Fleet Operations (Modification 3) */} +
+
+
+ +
+ 氢能车队运营 + Fleet +
+ {/* Horizontal split body */} +
+ {/* Left: Thumbnail */} +
+ Fleet +
+
+ {/* Right: Combined bullet checks */} +
+
+
+ 车辆监控 • 运营调度 +
+
+
+ 能耗管理 • 安全预警 +
+
+
+
+ + {/* Scenario 2: Refueling Station Operations (Modification 3) */} +
+
+
+ +
+ 加氢站运营 + Station +
+ {/* Horizontal split body */} +
+ {/* Left: Thumbnail */} +
+ Station +
+
+ {/* Right: Combined bullet checks */} +
+
+
+ 氢源调度 • 加氢优化 +
+
+
+ 库存管理 • 安全监管 +
+
+
+
+ + {/* Scenario 3: Energy & Data Center Computes (Modification 3) */} +
+
+
+ +
+ 能源/算力中心 + Center +
+ {/* Horizontal split body */} +
+ {/* Left: Thumbnail */} +
+ Data Center +
+
+ {/* Right: Combined bullet checks */} +
+
+
+ 能耗优化 • 安全监测 +
+
+
+ 运维管理 • 智能决策 +
+
+
+
+
+ +
+ + {/* Bottom value matrix (价值输出层 中英双语 - Extremely Compact Layout for Full screen) */} +
+
+ +
+ 价值输出层
+ VALUE MATRIX SYSTEM +
+ +
+ {[ + { title: '强化安全减灾', sub: '极速预警防爆泄漏风险', icon: ShieldCheck, subEn: 'RISK CONTROL' }, + { title: '显著降本增益', sub: '优化气耗能耗控制开支', icon: Search, subEn: 'COST MINIMIZE' }, + { title: '多端业务提效', sub: '云端统筹告别积料负压', icon: Activity, subEn: 'EFFICIENT ROUTING' }, + { title: '绿氢数据资产', sub: '实时认证双碳属性归集', icon: Leaf, subEn: 'CARBON CERTIFIED' }, + { title: 'AI边算一体化', sub: '全面释放物联数据潜能', icon: LineChart, subEn: 'DATA ASSET INFERENCE' }, + ].map((val, i) => { + const Icon = val.icon; + return ( +
+
+ +
+
+ {val.title} + {val.sub} + {val.subEn} +
+
+ ) + })} +
+
+ + + )} + + +
+ + {/* 3. Global Dashboard Footer Accent */} +
+
+
+
+
+
+ + © 2026 OneOSS. ALL INDUSTRIAL TELEMETRY AND FACTOR ASSURANCE SYSTEMS REGISTERED. + +
+ Secured Node ID: OOSS-LNBOX-999-ACTIVE + + Link Strength: 100% SECURE +
+
+
+
+ ); +} diff --git a/src/assets/images/oneos_top_facet_1779864912925.png b/src/assets/images/oneos_top_facet_1779864912925.png new file mode 100644 index 0000000..4472fcc Binary files /dev/null and b/src/assets/images/oneos_top_facet_1779864912925.png differ diff --git a/src/assets/images/oneoss_box_1779852084134.png b/src/assets/images/oneoss_box_1779852084134.png new file mode 100644 index 0000000..431b4cc Binary files /dev/null and b/src/assets/images/oneoss_box_1779852084134.png differ diff --git a/src/assets/images/oneoss_side_facet_1779862455874.png b/src/assets/images/oneoss_side_facet_1779862455874.png new file mode 100644 index 0000000..63e1374 Binary files /dev/null and b/src/assets/images/oneoss_side_facet_1779862455874.png differ diff --git a/src/assets/images/oneoss_top_facet_1779862470957.png b/src/assets/images/oneoss_top_facet_1779862470957.png new file mode 100644 index 0000000..36eb8e9 Binary files /dev/null and b/src/assets/images/oneoss_top_facet_1779862470957.png differ diff --git a/src/assets/images/scenario_datacenter_1779863590420.png b/src/assets/images/scenario_datacenter_1779863590420.png new file mode 100644 index 0000000..3da2283 Binary files /dev/null and b/src/assets/images/scenario_datacenter_1779863590420.png differ diff --git a/src/assets/images/scenario_fleet_1779863559233.png b/src/assets/images/scenario_fleet_1779863559233.png new file mode 100644 index 0000000..20c00dc Binary files /dev/null and b/src/assets/images/scenario_fleet_1779863559233.png differ diff --git a/src/assets/images/scenario_station_1779863574991.png b/src/assets/images/scenario_station_1779863574991.png new file mode 100644 index 0000000..a0eec65 Binary files /dev/null and b/src/assets/images/scenario_station_1779863574991.png differ diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..13a8b24 --- /dev/null +++ b/src/index.css @@ -0,0 +1,14 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@300;400;500;600;700&display=swap'); +@import "tailwindcss"; + +@theme { + --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif; + --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif; + --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace; +} + +body { + background-color: #080808; + color: #E5E5E5; + font-family: var(--font-sans); +} diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..080dac3 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,10 @@ +import {StrictMode} from 'react'; +import {createRoot} from 'react-dom/client'; +import App from './App.tsx'; +import './index.css'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 0000000..1c59232 --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,4 @@ +declare module '*.png' { + const value: string; + export default value; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d88f175 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2022", + "experimentalDecorators": true, + "useDefineForClassFields": false, + "module": "ESNext", + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], + "skipLibCheck": true, + "moduleResolution": "bundler", + "isolatedModules": true, + "moduleDetection": "force", + "allowJs": true, + "jsx": "react-jsx", + "paths": { + "@/*": [ + "./*" + ] + }, + "allowImportingTsExtensions": true, + "noEmit": true + } +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..fc23e76 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,22 @@ +import tailwindcss from '@tailwindcss/vite'; +import react from '@vitejs/plugin-react'; +import path from 'path'; +import {defineConfig} from 'vite'; + +export default defineConfig(() => { + return { + plugins: [react(), tailwindcss()], + resolve: { + alias: { + '@': path.resolve(__dirname, '.'), + }, + }, + server: { + // HMR is disabled in AI Studio via DISABLE_HMR env var. + // Do not modify—file watching is disabled to prevent flickering during agent edits. + hmr: process.env.DISABLE_HMR !== 'true', + // Disable file watching when DISABLE_HMR is true to save CPU during agent edits. + watch: process.env.DISABLE_HMR === 'true' ? null : {}, + }, + }; +});