Project Philosophy & Inspiration
Relevant source files
The following files were used as context for generating this wiki page:The Endfield-Pomodoro project is an immersive web-based Pomodoro timer application. Its core philosophy is to create a highly stylized and engaging user experience inspired by "Cyber UI" and the aesthetic of the game "终末地" (Endfield). This is achieved through a combination of a dynamic theming system, specific linguistic choices, and a layered visual architecture that together construct the feeling of operating a futuristic terminal.
The application is built on a modern tech stack including React 19 and TailwindCSS v4, with a focus on performance through tools like the React Compiler. The entire user interface, from component names to UI text, is designed to reinforce the "Endfield Protocol" theme, creating a cohesive and immersive environment for focus and productivity.
Sources: README.md:13, index.html:5, README.md:29-36
Thematic Design System
The project's visual identity is driven by a powerful and flexible theming system. This system allows users to completely change the application's look and feel, with each theme offering a distinct sci-fi aesthetic.
Sources: README.md:118-128
Architecture
The theming architecture is built upon CSS Variables. A set of predefined color variables are declared in the root stylesheet, and the App component dynamically updates their values based on the user's selected theme. This approach allows for instant, global style changes without reloading the page.
The App component manages the current theme state, which is persisted to localStorage. On theme change, it iterates through the selected theme's color palette and applies each color to its corresponding CSS variable on the document.documentElement.
Sources: src/index.css:28-40, src/App.tsx:232-238
This diagram illustrates the flow of selecting and applying a new theme.
Sources: src/App.tsx:454, src/App.tsx:232-238
Available Themes
The application provides a variety of preset themes, each with a unique name that evokes a specific sci-fi or futuristic concept. The theme names are managed via the internationalization system for multi-language support.
| Theme Preset Enum | English Name | Chinese Name |
|---|---|---|
ThemePreset.ORIGIN | PRESET_01: ENDFIELD_PROTOCOL | 预设_01: 末端协议 |
ThemePreset.AZURE | PRESET_02: AZURE_ARCHIVE | 预设_02: 蔚蓝档案 |
ThemePreset.NEON | PRESET_03: NEON_CITY | 预设_03: 霓虹都市 |
ThemePreset.MATRIX | PRESET_04: MATRIX_CODE | 预设_04: 矩阵代码 |
ThemePreset.TACTICAL | PRESET_05: DESERT_OPS | 预设_05: 荒漠行动 |
ThemePreset.ROYAL | PRESET_06: ROYAL_VIOLET | 预设_06: 皇家紫罗兰 |
ThemePreset.INDUSTRIAL | PRESET_07: HEAVY_INDUSTRY (LIGHT) | 预设_07: 重工灰烬 (亮色) |
ThemePreset.LABORATORY | PRESET_08: SCIENCE_LAB (LIGHT) | 预设_08: 科学实验 (亮色) |
ThemePreset.MIKU | PRESET_09: MIKU | 预设_09: MIKU |
Sources: src/App.tsx:444-454, src/utils/i18n.ts:41-49, 137-145
Immersive UI Architecture
To create an immersive "terminal" experience, the UI is constructed in distinct visual layers, each with a specific z-index. This layering allows for complex background and foreground effects that do not interfere with the main application content.
Sources: src/App.tsx:273-281
Visual Layers
The application's main component (App.tsx) orchestrates these layers:
- Background Layer (
z-0): Renders theme-specific, non-interactive background visuals like grids, particles, or animations. - Decoration Layer (
z-5): A special layer for theme-specific decorative elements, such as the character and logo in theMIKUtheme. - Content Layer (
z-10): The main interactive content of the application, including the Pomodoro timer, task manager, and audio player. - UI Chrome Layer (
z-40): The fixed header and footer, which sit above the scrolling content. - Foreground Layer (
z-50): Renders theme-specific effects that react to user interaction (like mouse movement) and overlay the entire screen. This layer haspointer-events-noneto allow interaction with the layers beneath it.
This diagram shows the stacking of the UI layers.
Theme Effect Management
The TerminalUI.tsx component acts as a controller that selects the appropriate effect components based on the active theme. It contains two main exports: BackgroundLayer and ForegroundLayer.
// src/components/TerminalUI.tsx:47-60
export const BackgroundLayer: React.FC<{ theme?: ThemePreset }> = ({ theme = ThemePreset.ORIGIN }) => {
const renderContent = () => {
switch (theme) {
case ThemePreset.AZURE: return <AzureGrid />;
case ThemePreset.NEON: return <NeonGrid />;
// ... other themes
case ThemePreset.MIKU: return <MikuBackgroundLayer />;
default: return <OriginGrid />;
}
};
return (
<div className="fixed inset-0 pointer-events-none z-0 overflow-hidden">
{renderContent()}
</div>
);
};
Each theme can have its own set of background and foreground effects, which are implemented as separate React components. For example, the MATRIX theme uses a "digital rain" effect, while the TACTICAL theme shows a dot grid and a mouse-tracking crosshair.
Sources: src/components/TerminalUI.tsx, src/components/themes/BackgroundEffects.tsx, src/components/themes/ForegroundEffects.tsx
A special case is the MIKU theme, which has its own dedicated decoration component (MikuDecorations.tsx) to handle its unique character and logo assets, demonstrating the system's extensibility.
Sources: src/components/TerminalUI.tsx:40, src/components/MikuDecorations.tsx:162-168
Linguistic Identity: The "Protocol"
The project's philosophy extends to its language. UI text and component names are deliberately chosen to align with the "terminal" or "protocol" theme. This is most evident in the i18n.ts file, where standard application terms are replaced with thematic equivalents.
| Standard Term | Thematic Term (English) | Thematic Term (Chinese) | Source File |
|---|---|---|---|
| Pomodoro | CHRONO MODULE | 计时模块 | src/utils/i18n.ts:52, 148 |
| Task Manager | MISSION PROTOCOLS | 任务协议 | src/utils/i18n.ts:68, 164 |
| Audio Player | AUDIO FEED | 音频讯号 | src/utils/i18n.ts:75, 171 |
| Status | STATUS | 当前状态 | src/utils/i18n.ts:53, 149 |
| Time Remaining | T-MINUS | 剩余时间 | src/utils/i18n.ts:54, 150 |
| Start | INITIALIZE | 启动 | src/utils/i18n.ts:55, 151 |
| Pause | HALT | 中断 | src/utils/i18n.ts:56, 152 |
| Work Mode | OPERATIONAL | 作业中 | src/utils/i18n.ts:58, 154 |
| Short Break | COOLDOWN | 冷却模式 | src/utils/i18n.ts:59, 155 |
| Long Break | HIBERNATION | 深度休眠 | src/utils/i18n.ts:60, 156 |
This consistent, thematic language is a key part of the project's identity, transforming a simple utility application into a more engaging and immersive experience.
Sources: src/utils/i18n.ts, src/components/Pomodoro.tsx:300, src/components/TaskManager.tsx:42