tui-designer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTUI Designer - Retro/Cyberpunk Terminal UI Expert
TUI Designer - 复古/赛博朋克终端UI专家
Expert guidance for designing and implementing text-based user interfaces with authentic retro computing aesthetics: CRT monitors, phosphor glow, scanlines, and cyberpunk neon.
提供专业指导,帮助你设计并实现带有纯正复古计算美学的文本类用户界面:CRT显示器效果、磷光发光、扫描线、赛博朋克霓虹特效。
When to Use This Skill
适用场景
Use this skill when:
- Creating terminal-style or hacker aesthetic UIs
- Implementing CRT monitor effects (scanlines, glow, barrel distortion)
- Building cyberpunk/synthwave/retrowave interfaces
- Using Tuimorphic components in React
- Implementing Metal shaders for retro effects in SwiftUI
- Designing neon glow text and UI elements
- Choosing color palettes for retro computing aesthetics
- Working with monospace fonts and box-drawing characters
当你遇到以下需求时可使用本指南:
- 打造终端风格或黑客美学UI
- 实现CRT显示器特效(扫描线、发光、桶形畸变)
- 构建赛博朋克/合成波/复古波风格界面
- 在React中使用Tuimorphic组件
- 在SwiftUI中实现Metal着色器复古特效
- 设计霓虹发光文本及UI元素
- 为复古计算美学选择配色方案
- 使用等宽字体和盒绘字符
Design Principles
设计原则
The Retro/Cyberpunk Aesthetic
复古/赛博朋克美学
This aesthetic draws from:
- CRT monitors: Phosphor glow, scanlines, screen curvature, flicker
- Terminal interfaces: Monospace fonts, box-drawing characters, green/amber text
- Cyberpunk fiction: Neon colors, dark backgrounds, high contrast
- 1980s computing: ASCII art, limited color palettes, blocky graphics
这类美学的灵感来源包括:
- CRT显示器:磷光发光、扫描线、屏幕曲率、闪烁效果
- 终端界面:等宽字体、盒绘字符、绿色/琥珀色文本
- 赛博朋克科幻作品:霓虹色彩、深色背景、高对比度
- 1980年代计算设备:ASCII艺术、有限配色、块状图形
Visual Elements Checklist
视觉元素检查清单
- Dark background (near-black with subtle color tint)
- Monospace typography throughout
- Box-drawing characters for borders and frames
- Neon glow on text and/or borders
- Scanline effect (subtle horizontal lines)
- Limited color palette (1-3 accent colors)
- High contrast between text and background
- Optional: CRT curvature, chromatic aberration, flicker
- 深色背景(接近纯黑,带有微妙色调)
- 全局使用等宽字体
- 使用盒绘字符制作边框和框架
- 文本和/或边框添加霓虹发光效果
- 扫描线效果(细微的水平线)
- 有限配色方案(1-3个强调色)
- 文本与背景高对比度
- 可选:CRT曲率、色差、闪烁效果
Quick Reference: Color Palettes
快速参考:配色方案
Phosphor Green (Classic Terminal)
磷光绿(经典终端)
| Role | Hex | Usage |
|---|---|---|
| Bright | | Primary text, highlights |
| Medium | | Secondary text |
| Dark | | Dimmed elements |
| Background | | Main background |
| Deep BG | | Panel backgrounds |
| 角色 | Hex | 用途 |
|---|---|---|
| 亮色 | | 主文本、高亮内容 |
| 中度色 | | 次要文本 |
| 暗色 | | 弱化元素 |
| 背景色 | | 主背景 |
| 深层背景 | | 面板背景 |
Cyberpunk Neon
赛博朋克霓虹
| Role | Hex | Usage |
|---|---|---|
| Cyan | | Primary accent |
| Magenta | | Secondary accent |
| Electric Blue | | Tertiary |
| Hot Pink | | Warnings |
| Background | | Main background |
| 角色 | Hex | 用途 |
|---|---|---|
| 青色 | | 主强调色 |
| 洋红色 | | 次强调色 |
| 电光蓝 | | 第三强调色 |
| 亮粉色 | | 警告提示 |
| 背景色 | | 主背景 |
Amber CRT
琥珀色CRT
| Role | Hex | Usage |
|---|---|---|
| Bright | | Primary text |
| Medium | | Secondary |
| Dark | | Dimmed |
| Background | | Main background |
See color-palettes.md for complete specifications.
| 角色 | Hex | 用途 |
|---|---|---|
| 亮色 | | 主文本 |
| 中度色 | | 次要内容 |
| 暗色 | | 弱化元素 |
| 背景色 | | 主背景 |
查看 color-palettes.md 获取完整规范。
Typography
排版
Recommended Fonts
推荐字体
Web:
css
font-family: 'GNU Unifont', 'IBM Plex Mono', 'JetBrains Mono',
'SF Mono', 'Consolas', monospace;SwiftUI:
swift
.font(.system(size: 14, weight: .regular, design: .monospaced))Web端:
css
font-family: 'GNU Unifont', 'IBM Plex Mono', 'JetBrains Mono',
'SF Mono', 'Consolas', monospace;SwiftUI端:
swift
.font(.system(size: 14, weight: .regular, design: .monospaced))Box-Drawing Characters
盒绘字符
Light: ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼
Heavy: ━ ┃ ┏ ┓ ┗ ┛ ┣ ┫ ┳ ┻ ╋
Double: ═ ║ ╔ ╗ ╚ ╝ ╠ ╣ ╦ ╩ ╬
Rounded: ╭ ╮ ╰ ╯See typography-guide.md for complete reference.
Light: ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼
Heavy: ━ ┃ ┏ ┓ ┗ ┛ ┣ ┫ ┳ ┻ ╋
Double: ═ ║ ╔ ╗ ╚ ╝ ╠ ╣ ╦ ╩ ╬
Rounded: ╭ ╮ ╰ ╯查看 typography-guide.md 获取完整参考。
Copywriting
文案撰写
Terminal interfaces have a distinct voice: terse, technical, authoritative. Use these defaults unless the project specifies otherwise.
终端界面有独特的语气风格:简洁、专业、权威。除非项目另有规定,否则请遵循以下默认规则。
Core Principles
核心原则
- Terse and Direct - Every word earns its place
- Technical Authority - The system knows what it's doing
- Mechanical Precision - No hedging, apologies, or filler
- 简洁直接 - 没有冗余内容
- 专业权威 - 系统功能清晰明确
- 机械精准 - 没有模糊表述、道歉语或填充内容
Text Formatting
文本格式
| Element | Case | Example |
|---|---|---|
| Headers/Titles | UPPERCASE | |
| Labels | UPPERCASE | |
| Status indicators | UPPERCASE | |
| Commands/Input | lowercase | |
| Body text | Sentence case | |
| 元素 | 大小写格式 | 示例 |
|---|---|---|
| 表头/标题 | 全大写 | |
| 标签 | 全大写 | |
| 状态指示器 | 全大写 | |
| 命令/输入 | 全小写 | |
| 正文文本 | 首字母大写 | |
Message Prefixes
消息前缀
[SYS] System message [ERR] Error
[USR] User action [WRN] Warning
[INF] Information [NET] Network[SYS] 系统消息 [ERR] 错误
[USR] 用户操作 [WRN] 警告
[INF] 信息提示 [NET] 网络相关Vocabulary Quick Reference
词汇快速参考
| Action | Terminal Verbs |
|---|---|
| Start | INITIALIZE, BOOT, LAUNCH, ACTIVATE |
| Stop | TERMINATE, HALT, ABORT, KILL |
| Save | WRITE, COMMIT, STORE, PERSIST |
| Load | READ, FETCH, RETRIEVE, LOAD |
| Delete | PURGE, REMOVE, CLEAR, WIPE |
| State | Terminal Words |
|---|---|
| Working | PROCESSING, EXECUTING, RUNNING |
| Done | COMPLETE, SUCCESS, FINISHED |
| Failed | ERROR, FAULT, ABORTED |
| Ready | ONLINE, AVAILABLE, ARMED |
| 操作 | 终端动词 |
|---|---|
| 启动 | INITIALIZE, BOOT, LAUNCH, ACTIVATE |
| 停止 | TERMINATE, HALT, ABORT, KILL |
| 保存 | WRITE, COMMIT, STORE, PERSIST |
| 加载 | READ, FETCH, RETRIEVE, LOAD |
| 删除 | PURGE, REMOVE, CLEAR, WIPE |
| 状态 | 终端词汇 |
|---|---|
| 处理中 | PROCESSING, EXECUTING, RUNNING |
| 已完成 | COMPLETE, SUCCESS, FINISHED |
| 失败 | ERROR, FAULT, ABORTED |
| 就绪 | ONLINE, AVAILABLE, ARMED |
Common Patterns
常见模式
> INITIALIZING SYSTEM...
> LOADING MODULES [████████░░] 80%
> AUTHENTICATION COMPLETE
> SYSTEM READY
ERROR: ACCESS DENIED
ERR_CONNECTION_REFUSED: Timeout after 30s
WARNING: Low disk space (< 10%)
CONFIRM DELETE? [Y/N]
SELECT OPTION [1-5]:> INITIALIZING SYSTEM...
> LOADING MODULES [████████░░] 80%
> AUTHENTICATION COMPLETE
> SYSTEM READY
ERROR: ACCESS DENIED
ERR_CONNECTION_REFUSED: Timeout after 30s
WARNING: Low disk space (< 10%)
CONFIRM DELETE? [Y/N]
SELECT OPTION [1-5]:Avoid
避免使用
- "Please", "Sorry", "Oops"
- "Just", "Maybe", "Might"
- Excessive exclamation points
- Emoji (unless specifically requested)
See copywriting-guide.md for complete voice and tone reference.
- "请"、"抱歉"、"哎呀"这类表述
- "仅"、"可能"、"也许"这类模糊词汇
- 过多感叹号
- 表情符号(除非明确要求)
查看 copywriting-guide.md 获取完整的语气风格参考。
Platform: React with Tuimorphic
平台:基于Tuimorphic的React实现
Tuimorphic is a React component library providing 37 terminal-styled, accessible UI components.
Tuimorphic是一个React组件库,提供37个终端风格、可访问的UI组件。
Quick Start
快速开始
bash
npm install tuimorphictsx
import { Button, Card, Input } from 'tuimorphic';
import 'tuimorphic/styles.css';
function App() {
return (
<div className="theme-dark tint-green">
<Card>
<h1>SYSTEM ACCESS</h1>
<Input placeholder="Enter command..." />
<Button variant="primary">EXECUTE</Button>
</Card>
</div>
);
}bash
npm install tuimorphictsx
import { Button, Card, Input } from 'tuimorphic';
import 'tuimorphic/styles.css';
function App() {
return (
<div className="theme-dark tint-green">
<Card>
<h1>SYSTEM ACCESS</h1>
<Input placeholder="Enter command..." />
<Button variant="primary">EXECUTE</Button>
</Card>
</div>
);
}Theme Configuration
主题配置
Apply themes via CSS classes on a parent element:
jsx
// Dark mode with green tint
<div className="theme-dark tint-green">
// Light mode with cyan tint
<div className="theme-light tint-blue">Available tints: , , , , , ,
tint-greentint-bluetint-redtint-yellowtint-purpletint-orangetint-pink通过父元素的CSS类应用主题:
jsx
// 深色模式 + 绿色调
<div className="theme-dark tint-green">
// 浅色模式 + 青色调
<div className="theme-light tint-blue">可用色调: , , , , , ,
tint-greentint-bluetint-redtint-yellowtint-purpletint-orangetint-pinkKey Components
核心组件
| Component | Usage |
|---|---|
| Actions with |
| Text input with terminal styling |
| Container with box-drawing borders |
| Modal dialogs |
| Dropdown menus |
| Syntax-highlighted code |
| Data tables |
| Tabbed navigation |
| File tree display |
See tuimorphic-reference.md for complete API.
| 组件 | 用途 |
|---|---|
| 操作按钮,支持 |
| 终端风格的文本输入框 |
| 带盒绘边框的容器 |
| 模态对话框 |
| 下拉菜单 |
| 带语法高亮的代码块 |
| 数据表格 |
| 标签导航 |
| 文件树展示 |
查看 tuimorphic-reference.md 获取完整API。
Adding Neon Glow
添加霓虹发光效果
Enhance Tuimorphic with CSS glow effects:
css
/* Neon text glow */
.neon-text {
color: #0ff;
text-shadow:
0 0 5px #fff,
0 0 10px #fff,
0 0 20px #0ff,
0 0 40px #0ff,
0 0 80px #0ff;
}
/* Neon border glow */
.neon-border {
border-color: #0ff;
box-shadow:
0 0 5px #0ff,
0 0 10px #0ff,
inset 0 0 5px #0ff;
}
/* Flickering animation */
@keyframes flicker {
0%, 100% { opacity: 1; }
50% { opacity: 0.95; }
52% { opacity: 1; }
54% { opacity: 0.9; }
}
.flicker {
animation: flicker 3s infinite;
}使用CSS发光效果增强Tuimorphic组件:
css
/* 霓虹文本发光 */
.neon-text {
color: #0ff;
text-shadow:
0 0 5px #fff,
0 0 10px #fff,
0 0 20px #0ff,
0 0 40px #0ff,
0 0 80px #0ff;
}
/* 霓虹边框发光 */
.neon-border {
border-color: #0ff;
box-shadow:
0 0 5px #0ff,
0 0 10px #0ff,
inset 0 0 5px #0ff;
}
/* 闪烁动画 */
@keyframes flicker {
0%, 100% { opacity: 1; }
50% { opacity: 0.95; }
52% { opacity: 1; }
54% { opacity: 0.9; }
}
.flicker {
animation: flicker 3s infinite;
}Platform: SwiftUI with Metal Shaders
平台:基于Metal着色器的SwiftUI实现
iOS 17+ supports Metal shaders directly in SwiftUI via , , and .
.colorEffect().distortionEffect().layerEffect()iOS 17+支持通过、和在SwiftUI中直接使用Metal着色器。
.colorEffect().distortionEffect().layerEffect()CRT Effect Implementation
CRT效果实现
CRT.metal:
metal
#include <metal_stdlib>
#include <SwiftUI/SwiftUI.h>
using namespace metal;
[[stitchable]] half4 crtEffect(
float2 position,
SwiftUI::Layer layer,
float time,
float2 size,
float scanlineIntensity,
float distortionStrength
) {
float2 uv = position / size;
// Barrel distortion
float2 center = uv - 0.5;
float dist = length(center);
float2 distorted = center * (1.0 + distortionStrength * dist * dist);
float2 samplePos = (distorted + 0.5) * size;
// Bounds check
if (samplePos.x < 0 || samplePos.x > size.x ||
samplePos.y < 0 || samplePos.y > size.y) {
return half4(0, 0, 0, 1);
}
// Sample color
half4 color = layer.sample(samplePos);
// Scanlines
float scanline = sin(position.y * 3.14159 * 2.0) * scanlineIntensity;
color.rgb *= 1.0 - scanline;
// Subtle color shift (chromatic aberration)
color.r *= 1.0 + 0.02 * sin(time * 2.0);
color.b *= 1.0 - 0.02 * sin(time * 2.0);
// Slight flicker
color.rgb *= 1.0 + 0.01 * sin(time * 60.0);
return color;
}SwiftUI View Modifier:
swift
struct CRTEffectModifier: ViewModifier {
@State private var startTime = Date()
var scanlineIntensity: Float = 0.1
var distortionStrength: Float = 0.1
func body(content: Content) -> some View {
TimelineView(.animation) { timeline in
let time = Float(timeline.date.timeIntervalSince(startTime))
GeometryReader { geo in
content
.layerEffect(
ShaderLibrary.crtEffect(
.float(time),
.float2(geo.size),
.float(scanlineIntensity),
.float(distortionStrength)
),
maxSampleOffset: .init(width: 10, height: 10)
)
}
}
}
}
extension View {
func crtEffect(
scanlines: Float = 0.1,
distortion: Float = 0.1
) -> some View {
modifier(CRTEffectModifier(
scanlineIntensity: scanlines,
distortionStrength: distortion
))
}
}Usage:
swift
Text("SYSTEM ONLINE")
.font(.system(size: 24, weight: .bold, design: .monospaced))
.foregroundColor(.green)
.crtEffect(scanlines: 0.15, distortion: 0.08)CRT.metal:
metal
#include <metal_stdlib>
#include <SwiftUI/SwiftUI.h>
using namespace metal;
[[stitchable]] half4 crtEffect(
float2 position,
SwiftUI::Layer layer,
float time,
float2 size,
float scanlineIntensity,
float distortionStrength
) {
float2 uv = position / size;
// 桶形畸变
float2 center = uv - 0.5;
float dist = length(center);
float2 distorted = center * (1.0 + distortionStrength * dist * dist);
float2 samplePos = (distorted + 0.5) * size;
// 边界检查
if (samplePos.x < 0 || samplePos.x > size.x ||
samplePos.y < 0 || samplePos.y > size.y) {
return half4(0, 0, 0, 1);
}
// 采样颜色
half4 color = layer.sample(samplePos);
// 扫描线效果
float scanline = sin(position.y * 3.14159 * 2.0) * scanlineIntensity;
color.rgb *= 1.0 - scanline;
// 细微色彩偏移(色差)
color.r *= 1.0 + 0.02 * sin(time * 2.0);
color.b *= 1.0 - 0.02 * sin(time * 2.0);
// 轻微闪烁
color.rgb *= 1.0 + 0.01 * sin(time * 60.0);
return color;
}SwiftUI视图修饰符:
swift
struct CRTEffectModifier: ViewModifier {
@State private var startTime = Date()
var scanlineIntensity: Float = 0.1
var distortionStrength: Float = 0.1
func body(content: Content) -> some View {
TimelineView(.animation) { timeline in
let time = Float(timeline.date.timeIntervalSince(startTime))
GeometryReader { geo in
content
.layerEffect(
ShaderLibrary.crtEffect(
.float(time),
.float2(geo.size),
.float(scanlineIntensity),
.float(distortionStrength)
),
maxSampleOffset: .init(width: 10, height: 10)
)
}
}
}
}
extension View {
func crtEffect(
scanlines: Float = 0.1,
distortion: Float = 0.1
) -> some View {
modifier(CRTEffectModifier(
scanlineIntensity: scanlines,
distortionStrength: distortion
))
}
}使用示例:
swift
Text("SYSTEM ONLINE")
.font(.system(size: 24, weight: .bold, design: .monospaced))
.foregroundColor(.green)
.crtEffect(scanlines: 0.15, distortion: 0.08)Neon Glow in SwiftUI
SwiftUI中的霓虹发光效果
swift
extension View {
func neonGlow(color: Color, radius: CGFloat = 10) -> some View {
self
.shadow(color: color.opacity(0.8), radius: radius / 4)
.shadow(color: color.opacity(0.6), radius: radius / 2)
.shadow(color: color.opacity(0.4), radius: radius)
.shadow(color: color.opacity(0.2), radius: radius * 2)
}
}
// Usage
Text("NEON")
.font(.system(size: 48, design: .monospaced))
.foregroundColor(.cyan)
.neonGlow(color: .cyan, radius: 15)See metal-shaders-ios.md for complete shader code.
swift
extension View {
func neonGlow(color: Color, radius: CGFloat = 10) -> some View {
self
.shadow(color: color.opacity(0.8), radius: radius / 4)
.shadow(color: color.opacity(0.6), radius: radius / 2)
.shadow(color: color.opacity(0.4), radius: radius)
.shadow(color: color.opacity(0.2), radius: radius * 2)
}
}
// 用法
Text("NEON")
.font(.system(size: 48, design: .monospaced))
.foregroundColor(.cyan)
.neonGlow(color: .cyan, radius: 15)查看 metal-shaders-ios.md 获取完整着色器代码。
Platform: CSS/Vanilla Web
平台:CSS/原生Web实现
Scanlines Overlay
扫描线覆盖层
css
.crt-container {
position: relative;
background: #000800;
}
.crt-container::after {
content: '';
position: absolute;
inset: 0;
background: repeating-linear-gradient(
0deg,
rgba(0, 0, 0, 0.15),
rgba(0, 0, 0, 0.15) 1px,
transparent 1px,
transparent 2px
);
pointer-events: none;
}css
.crt-container {
position: relative;
background: #000800;
}
.crt-container::after {
content: '';
position: absolute;
inset: 0;
background: repeating-linear-gradient(
0deg,
rgba(0, 0, 0, 0.15),
rgba(0, 0, 0, 0.15) 1px,
transparent 1px,
transparent 2px
);
pointer-events: none;
}Neon Text Effect
霓虹文本效果
css
.neon-text {
color: #0ff;
text-shadow:
/* White core */
0 0 5px #fff,
0 0 10px #fff,
/* Colored glow layers */
0 0 20px #0ff,
0 0 30px #0ff,
0 0 40px #0ff,
0 0 55px #0ff,
0 0 75px #0ff;
}css
.neon-text {
color: #0ff;
text-shadow:
/* 白色核心 */
0 0 5px #fff,
0 0 10px #fff,
/* 彩色发光层 */
0 0 20px #0ff,
0 0 30px #0ff,
0 0 40px #0ff,
0 0 55px #0ff,
0 0 75px #0ff;
}CRT Curvature (CSS Transform)
CRT曲率(CSS Transform实现)
css
.crt-screen {
border-radius: 20px;
transform: perspective(1000px) rotateX(2deg);
box-shadow:
inset 0 0 50px rgba(0, 255, 0, 0.1),
0 0 20px rgba(0, 255, 0, 0.2);
}css
.crt-screen {
border-radius: 20px;
transform: perspective(1000px) rotateX(2deg);
box-shadow:
inset 0 0 50px rgba(0, 255, 0, 0.1),
0 0 20px rgba(0, 255, 0, 0.2);
}WebGL CRT with CRTFilter.js
基于CRTFilter.js的WebGL CRT效果
html
<script type="module">
import { CRTFilterWebGL } from 'crtfilter';
const canvas = document.getElementById('crt-canvas');
const crt = new CRTFilterWebGL(canvas, {
scanlineIntensity: 0.15,
glowBloom: 0.3,
chromaticAberration: 0.002,
barrelDistortion: 0.1,
staticNoise: 0.03,
flicker: true,
retraceLines: true
});
crt.start();
</script>See crt-effects-web.md for complete techniques.
html
<script type="module">
import { CRTFilterWebGL } from 'crtfilter';
const canvas = document.getElementById('crt-canvas');
const crt = new CRTFilterWebGL(canvas, {
scanlineIntensity: 0.15,
glowBloom: 0.3,
chromaticAberration: 0.002,
barrelDistortion: 0.1,
staticNoise: 0.03,
flicker: true,
retraceLines: true
});
crt.start();
</script>查看 crt-effects-web.md 获取完整实现技巧。
Effect Patterns
效果实现模式
Scanlines
扫描线
| Platform | Implementation |
|---|---|
| CSS | |
| SwiftUI | Metal shader with |
| WebGL | Fragment shader brightness modulation |
| 平台 | 实现方案 |
|---|---|
| CSS | |
| SwiftUI | 基于 |
| WebGL | 片元着色器亮度调制 |
Bloom/Glow
Bloom/发光效果
| Platform | Implementation |
|---|---|
| CSS | Multiple |
| SwiftUI | Multiple |
| WebGL | Gaussian blur pass + additive blend |
| Three.js | |
| 平台 | 实现方案 |
|---|---|
| CSS | 多层叠加不同模糊半径的 |
| SwiftUI | 多层 |
| WebGL | 高斯模糊通道 + 加法混合 |
| Three.js | 带 |
Chromatic Aberration
色差效果
| Platform | Implementation |
|---|---|
| CSS | Three overlapping elements with color channel offset |
| SwiftUI | Sample texture at offset positions per RGB channel |
| WebGL | Sample UV with slight offset per channel |
| 平台 | 实现方案 |
|---|---|
| CSS | 三个重叠元素,每个通道设置不同偏移 |
| SwiftUI | 每个RGB通道单独采样偏移位置的纹理 |
| WebGL | 每个通道采样UV时添加轻微偏移 |
Flicker
闪烁效果
| Platform | Implementation |
|---|---|
| CSS | |
| SwiftUI | Timer-driven opacity or shader time-based |
| WebGL | Time-based noise multiplier |
| 平台 | 实现方案 |
|---|---|
| CSS | |
| SwiftUI | 定时器驱动透明度变化或基于着色器时间参数实现 |
| WebGL | 基于时间的噪点乘数 |
Performance Considerations
性能注意事项
CSS Effects
CSS特效
- and
box-shadoware GPU-accelerated but expensive with many layerstext-shadow - Limit to 4-5 shadow layers for glow effects
- Use for animated elements
will-change: transform - Consider media query
prefers-reduced-motion
- 和
box-shadow是GPU加速的,但多层叠加时性能开销较大text-shadow - 发光效果最多使用4-5层阴影
- 为动画元素添加属性
will-change: transform - 考虑适配媒体查询
prefers-reduced-motion
SwiftUI/Metal
SwiftUI/Metal
- Metal shaders run at 60-120fps on all devices supporting iOS 17+
- processes every pixel - keep shaders simple
.layerEffect() - Pre-compile shaders with (iOS 18+)
.compile() - Test on older devices (A12 minimum for iOS 17)
- Metal着色器在所有支持iOS 17+的设备上都能达到60-120fps的运行效率
- 会处理每个像素,尽量保持着色器逻辑简单
.layerEffect() - 使用预编译着色器(iOS 18+支持)
.compile() - 在旧设备上测试(iOS 17最低支持A12芯片)
WebGL
WebGL
- CRTFilter.js uses hardware acceleration, minimal performance impact
- Bloom effects in Three.js require render-to-texture passes
- Consider lower resolution render targets for mobile
- CRTFilter.js使用硬件加速,性能影响极小
- Three.js中的发光效果需要渲染到纹理的步骤
- 移动端可考虑使用更低分辨率的渲染目标
General
通用建议
- Reduce effect intensity on mobile devices
- Provide option to disable effects for accessibility
- Profile with actual content, not just empty screens
- 在移动端降低特效强度
- 提供关闭特效的选项以提升可访问性
- 使用真实内容而非空页面进行性能测试
Templates
模板
Ready-to-use starter files:
- react-tuimorphic-starter.tsx - React app with Tuimorphic
- swiftui-crt-view.swift - SwiftUI view with CRT effect
- crt-shader.metal - Complete Metal shader
- neon-glow.css - CSS neon effects
开箱即用的启动文件:
- react-tuimorphic-starter.tsx - 集成Tuimorphic的React应用
- swiftui-crt-view.swift - 带有CRT效果的SwiftUI视图
- crt-shader.metal - 完整Metal着色器
- neon-glow.css - CSS霓虹特效
Resources
资源
Libraries
类库
- Tuimorphic - React terminal UI components
- Inferno - Metal shaders for SwiftUI
- CRTFilter.js - WebGL CRT effects
- @react-three/postprocessing - React Three.js effects
- Tuimorphic - React终端UI组件库
- Inferno - 适用于SwiftUI的Metal着色器库
- CRTFilter.js - WebGL CRT特效库
- @react-three/postprocessing - React Three.js特效库
Documentation
文档
Inspiration
灵感参考
- SRCL / Sacred Computer - Design influence for Tuimorphic
- Cool Retro Term - Terminal emulator with CRT effects
- SRCL / Sacred Computer - Tuimorphic的设计灵感来源
- Cool Retro Term - 带有CRT效果的终端模拟器