Moltbook API Client
通过API自动发布、评论和点赞Moltbook社区内容,内置反垃圾验证功能。
提供 macOS 风格终端界面的设计规范,含颜色、字体、间距等完整 CSS 变量体系。
openclaw skills install @chyinan/terminal-ui-website-design命令、参数、文件名以原文为准
一个完整的终端风格用户界面设计系统,采用 macOS 风格窗口装饰、等宽字体和温暖的开发者友好配色方案。该设计系统专为开发工具、代码市场、技术文档以及任何需要命令行美学的界面而优化。
核心原则:
品牌主色:
--primary: #cc7a60 - 暖陶土/橙棕色,用于主要操作、强调和高光--primary-foreground: #fff - 主色背景上的白色文字--primary-dark: #b56850 - 悬停状态使用的深色版本--primary-light: #d8907a - 用于细微强调的浅色版本--ring: #cc7a60 - 聚焦环颜色(与主色一致)暖色强调:
--warm-red: #c85a3f - 用于代码块边框和暖色调强调背景色:
--background: #fff - 纯白,用于主背景--bg-main: #f8f8f8 - 浅灰,用于页面背景(带细微网格图案)--bg-card: #fff - 白色,用于卡片组件--bg-code: #fafafa - 极浅灰,用于代码块和窗口标题栏--secondary: #f9fafb - 浅灰,用于次要背景--muted: #f3f4f6 - 柔和灰,用于低强度背景文字颜色:
--foreground: #111827 - 接近黑色,用于主要文字(可读性极佳)--text-primary: #111827 - 主要文字颜色--text-secondary: #666666 - 中等灰色,用于次要文字--text-muted: #5b6370 - 柔和灰,用于不重要的文字--muted-foreground: #5b6370 - 在柔和背景上的前景色边框颜色:
--border: #8b929e - 主边框中等灰色--border-light: #e5e7eb - 细微分隔线的浅灰色--input: #8b929e - 输入框边框颜色状态颜色:
--success: #22c55e - 绿色,用于成功状态--warning: #f59e0b - 橙黄色,用于警告--danger: #ef4444 - 红色,用于错误或破坏性操作--accent: #f59e0b - 橙黄色强调色代码语法:
--syntax-keyword: #cc7a60 - 关键字颜色(如 const、export 等)--syntax-string: #22c55e - 字符串绿色--syntax-number: #cc7a60 - 数字使用主色--syntax-comment: #6a9955 - 注释使用柔绿色--syntax-function: #dcdcaa - 函数名使用浅黄色命令前缀:
$)使用荧光绿色:#39ff14,营造终端风格代码元素:
--text-comment: #6a9955 - 注释文本颜色终端窗口控制按钮:
--dot-red: #ff5f57 - 关闭按钮(macOS 红色)--dot-yellow: #febc2e - 最小化按钮(macOS 黄色)--dot-green: #28c840 - 最大化按钮(macOS 绿色)主色 (#cc7a60) 使用场景:
>)荧光绿 (#39ff14) 使用场景:
$)——营造真实终端感绿色 (#22c55e) 使用场景:
蓝色 (#3b82f6) 使用场景:
主字体堆栈:
--font-mono: "JetBrains Mono", "JetBrains Mono Fallback", 'Fira Code', 'Consolas', monospace;无衬线备用字体:
--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";基础单位系统:
--text-xs: 0.75rem (12px) - 小标签、提示、窗口状态--text-sm: 0.875rem (14px) - 次要文字、描述信息--text-base: 1rem (16px) - 正文默认字号--text-lg: 1.125rem (18px) - 稍微强调的文字--text-xl: 1.25rem (20px) - 副标题--text-2xl: 1.5rem (24px) - 节标题--text-3xl: 1.875rem (30px) - 大数字、统计数据--text-4xl: 2.25rem (36px) - 主标题数字--text-5xl: 3rem (48px) - 大标题--text-6xl: 3.75rem (60px) - 特大标题字重:
--font-weight-normal: 400 - 正文--font-weight-medium: 500 - 中等强调--font-weight-semibold: 600 - 半粗体(关键字、标签)--font-weight-bold: 700 - 粗体(标题、重要文字)--font-weight-extrabold: 800 - 特粗体(主标题文字)行高:
--leading-tight: 1.25 - 标题紧凑间距--leading-relaxed: 1.625 - 正文宽松间距标题:
正文:
--text-secondary--text-muted代码/命令文本:
基础单位: --spacing: 0.25rem(4px)
间距比例:
--spacing-xs: 4px(0.25rem)——紧密间距,图标内边距--spacing-sm: 8px(0.5rem)——小间距,按钮内边距--spacing-md: 16px(1rem)——标准间距,卡片内边距--spacing-lg: 24px(1.5rem)——大间距,区块间距--spacing-xl: 32px(2rem)——超大间距,主要区块--spacing-2xl: 48px(3rem)——最大间距,页面区块使用规范:
--spacing-md 至 --spacing-lg--spacing-xl 至 --spacing-2xl--spacing-sm 至 --spacing-md--spacing-sm 至 --spacing-md圆角比例:
--radius-xs: 2px(0.125rem)——极小圆角--radius-sm: 4px(0.25rem)——小元素--radius-md: 6px(0.375rem)——按钮、输入框--radius-lg: 8px(0.5rem)——卡片、终端窗口(最常用)--radius-xl: 12px(0.75rem)——大卡片--radius-2xl: 16px(1rem)——超大元素--radius: 10px(0.625rem)——默认圆角使用建议:
--radius-lg(8px)--radius-lg(8px)--radius-lg(8px)--radius-md(6px)9999px(完全圆形)阴影比例:
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05) —— 微弱抬升--shadow-md: 0 4px 6px rgba(0,0,0,0.07) —— 中等抬升(卡片悬停状态)--shadow-lg: 0 10px 25px rgba(0,0,0,0.1) —— 大幅抬升(浮动按钮)使用建议:
--shadow-sm--shadow-md--shadow-lgrgba(204, 122, 96, 0.1) 用于主色调元素结构:
<div class="terminal-window">
<div class="window-header">
<div class="window-dots">
<span class="dot red"></span>
<span class="dot yellow"></span>
<span class="dot green"></span>
</div>
<span class="window-title">filename.ext</span>
<span class="window-status">ready</span>
</div>
<div class="window-content">
<!-- 内容 -->
</div>
</div>样式:
--bg-card(#fff)1px solid --border(#8b929e)--radius-lg(8px)--shadow-sm--bg-code(#fafafa)1px solid --border-light(#e5e7eb)--spacing-sm --spacing-md(8px 16px)--spacing-lg(24px)窗口控制点:
12px × 12px6px窗口标题:
0.85rem--text-secondary(#666666)窗口状态:
0.75rem--text-muted(#5b6370)结构:
<nav class="navbar">
<div class="navbar-container">
<div class="navbar-content">
<!-- Logo、命令、操作 -->
</div>
</div>
</nav>样式:
sticky,top: 0rgba(255, 255, 255, 0.8),配合 backdrop-filter: blur(8px)1px solid --border64px,移动端 56px80rem(1280px),居中显示Logo:
~/,使用主色调 (#cc7a60)导航命令:
--spacing-md1px solid --border--radius-lg命令按钮结构:
<button class="nav-cmd">
<span class="cmd-prefix">$</span>
<span class="cmd-keyword">ai</span>
<span class="cmd-flag">--search</span>
</button>命令颜色:
$):荧光绿色 (#39ff14)技能卡片:
--bg-card(浅色主题为 #fff,深色主题为 #111)1px solid --border--radius-xl(12px)100%,采用 flex 列布局0 25px 50px -12px rgba(204, 122, 96, 0.1)),垂直位移 translateY(-4px)translateY(0) scale(0.99)all 0.3s ease2rem,带有轻微背景分类卡片:
提及卡片:
主按钮(激活状态):
--primary(#cc7a60)--primary-foreground(#fff)1px solid --primary--radius-lg6px 12px(小尺寸)或 --spacing-md --spacing-lg(中等尺寸)--text-xs 或 --text-sm次要按钮:
--bg-card1px solid --border--foregroundtransform: scale(0.95)图标按钮:
6px 12px14px 或 16px搜索输入框:
--text-muted文本输入框:
--bg-card1px solid --border--radius-sm 或 --radius-md--spacing-sm代码块:
rgba(255, 255, 255, 0.5),带背景模糊效果1px solid --border--radius-lg--spacing-md--leading-relaxed代码行:
--spacing-sm描述区块(注释风格):
4px solid rgba(204, 122, 96, 0.5)rgba(204, 122, 96, 0.05)--spacing-md--radius-lg)技能网格:
repeat(3, 1fr),平板端 repeat(2, 1fr),移动端 1fr--spacing-lg(24px)分类网格:
repeat(4, 1fr),平板端 repeat(2, 1fr),移动端 1fr--spacing-lg提及网格:
1fr 1fr,移动端 1fr--spacing-lg默认过渡:
0.15s 或 0.2scubic-bezier(.4,0,.2,1)(ease-in-out)all 或具体属性常见过渡:
all 0.2s easetransform 0.2s easecolor 0.2s ease 或 background-color 0.2s ease闪烁动画(光标):
@keyframes blink {
0%, 50% { opacity: 1; }
51%, 100% { opacity: 0; }
}1s脉冲边框动画:
@keyframes pulse-border {
0%, 100% { border-color: rgba(204, 122, 96, 0.5); }
50% { border-color: var(--ring); }
}2sease-in-out淡入上移动画:
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}0.5sease0.1s 递增悬停状态:
按下状态:
transform: scale(0.95) —— 微妙的按压效果0.2s聚焦状态:
2px solid --ring,偏移 2pxbackground-image:
linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
background-size: 20px 20px;body 背景头像渐变:
background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);图表渐变:
linearGradient: #cc7a60 with opacity stops (0%: 0.6, 100%: 0)**移动端:< 640px**
**平板端:640px - 1024px**
**桌面端:1024px - 1200px**
**大桌面端:> 1200px**
1400px导航:
英雄区域:
网格:
排版:
始终使用 CSS 变量,包括:
示例:
.button {
background: var(--bg-card);
color: var(--foreground);
padding: var(--spacing-sm) var(--spacing-md);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
}终端窗口模式:
命令行模式:
$)使用荧光绿色name: Terminal UI Website Design
version: 1.0.0
description: 为终端风格网站设计提供统一的视觉与交互规范,涵盖配色、排版、间距、动画、组件模式及暗色模式实现。
summary: 一套专为终端风格界面设计的完整视觉系统,支持明暗主题切换,确保一致性与可访问性。
主色调 (#cc7a60):
rgba(204, 122, 96, 0.5),背景使用 rgba(204, 122, 96, 0.05)荧光绿 (#39ff14):
$)绿色 (#22c55e):
始终使用等宽字体,适用于:
字体粗细规范:
使用统一的间距尺度:
13px、27px)--spacing-sm 至 --spacing-md--spacing-xl 至 --spacing-2xl保持动画简洁:
性能优化:
transform 和 opacity 实现动画(GPU 加速)width、height、margin、padding 进行动画<div class="terminal-window">
<div class="window-header">
<div class="window-dots">
<span class="dot red"></span>
<span class="dot yellow"></span>
<span class="dot green"></span>
</div>
<span class="window-title">filename.ext</span>
<span class="window-status">ready</span>
</div>
<div class="window-content">
<!-- 内容在此 -->
</div>
</div><button class="nav-cmd">
<span class="cmd-prefix">$</span>
<span class="cmd-keyword">command</span>
<span class="cmd-flag">--flag</span>
</button><div class="stats-code-block">
<div class="code-line">
<span class="keyword">const</span>
<span class="variable-name">variable</span>
<span class="operator">=</span>
<span class="number">123</span>
<span class="operator">;</span>
</div>
<div class="code-comment">
<span class="comment-symbol">// </span>注释内容
</div>
</div><div class="description-block">
<div class="comment-start">/**</div>
<div class="comment-text">
<span class="comment-asterisk"> * </span>描述文本
</div>
<div class="comment-end"> */</div>
</div>颜色对比度:
焦点状态:
键盘导航:
屏幕阅读器支持:
设计系统通过 [data-theme="dark"] 属性选择器完整支持暗色模式。暗色模式已全面集成,具备平滑过渡效果,并保持所有设计原则一致。
主色调(暗色模式):
--primary: #d99178 —— 更浅的赭石色,提升在深背景上的对比度--primary-foreground: #0a0a0a —— 主色调背景上的深色文字--primary-dark: #c57f66 —— 悬停状态使用的更深色调--primary-light: #e5a890 —— 用于细微装饰的浅色调--ring: #d99178 —— 焦点环颜色(较浅的主色调)背景色(暗色模式):
--background: #0a0a0a —— 主要背景的深黑色--bg-main: #0a0a0a —— 带轻微白色网格图案的深背景--bg-card: #111 —— 卡片组件的稍浅黑色--bg-code: #18181b —— 代码块和窗口标题的深灰色--secondary: #1a1a1a —— 次要背景的深灰色--muted: #262626 —— 用于弱化背景的哑光深灰色文字颜色(暗色模式):
--foreground: #ededed —— 主要文字的浅灰色--text-primary: #ededed —— 主要文字颜色--text-secondary: #a3a3a3 —— 中等灰度的次要文字--text-muted: #a3a3a3 —— 较不重要文本的灰度--muted-foreground: #a3a3a3 —— 在弱化背景上的前景色边框颜色(暗色模式):
--border: #606068 —— 在深背景上更清晰可见的浅灰--border-light: #27272a —— 用于分隔线的微暗灰语法高亮(暗色模式):
--syntax-keyword: #d99178 —— 关键词使用较浅的主色调--syntax-string: #22c55e —— 绿色(与浅色模式一致)--syntax-number: #d99178 —— 数字使用较浅的主色调--syntax-comment: #6a9955 —— 淡绿色(与浅色模式一致)#60a5fa(blue-400)—— 更明亮的蓝色以增强对比#c084fc(purple-400)—— 更明亮的紫色以增强对比阴影(暗色模式):
--shadow-sm: 0 1px 2px rgba(0,0,0,0.3) —— 更强的阴影以增强层次感--shadow-md: 0 4px 6px rgba(0,0,0,0.4) —— 中等阴影--shadow-lg: 0 10px 25px rgba(0,0,0,0.5) —— 大型阴影暗色模式使用微妙的白色网格图案替代纯黑背景:
[data-theme="dark"] body {
background-image:
linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}HTML 结构:
<button class="theme-toggle-btn theme-toggle" title="切换主题" aria-label="切换主题">
<svg class="icon-sun theme-icon"><!-- 太阳图标 --></svg>
<svg class="icon-moon theme-icon" style="display: none;"><!-- 月亮图标 --></svg>
</button>JavaScript 实现:
localStorage 持久化用户主题偏好核心功能:
localStorage导航栏:
rgba(10, 10, 10, 0.8),带背景模糊效果终端窗口:
#111(略高于主背景色)rgba(38, 38, 38, 0.3),提供微妙对比技能卡片:
rgba(38, 38, 38, 0.2)rgba(38, 38, 38, 0.2)分类卡片:
- 青蓝色:#22d3ee(深色) vs #06b6d4(浅色)
- 蓝色:#60a5fa(深色) vs #3b82f6(浅色)
- 紫色:#c084fc(深色) vs #a855f7(浅色)
- 橙黄色:#fbbf24(深色) vs #f59e0b(浅色)
图表:
#27272a,透明度 0.5rgba(17, 17, 17, 0.3)浮动操作按钮(FAB):
#1a1a1a,白色图标色彩对比:
过渡动画:
transition: color 0.2s ease-in-outtransition: background-color 0.2s ease-in-out实现模式:
/* 浅色模式(默认) */
.component {
background: var(--bg-card);
color: var(--foreground);
}
/* 深色模式 */
[data-theme="dark"] .component {
background: var(--bg-card); /* 自动应用深色值 */
color: var(--foreground); /* 自动应用深色值 */
}保持一致:
CSS 变量:
:root 中,确保全局可用动画:
transform 和 opacity(GPU 加速)字体加载:
font-display: swap 提升性能表现现代浏览器:
backdrop-filter 添加 -webkit- 前缀)使用特性:
-webkit- 前缀快速参考:
/* 颜色 - 浅色模式 */
Primary: #cc7a60
Fluorescent Green: #39ff14(仅命令前缀使用)
Success: #22c55e
Blue: #3b82f6
Foreground: #111827
Border: #8b929e
/* 颜色 - 深色模式 */
Primary: #d99178
Foreground: #ededed
Background: #0a0a0a
Card: #111
Border: #606068
Blue: #60a5fa(为增强对比度而更明亮)
/* 间距 */
xs: 4px, sm: 8px, md: 16px, lg: 24px, xl: 32px, 2xl: 48px
/* 字体 */
Font: JetBrains Mono
Sizes: 0.75rem - 3.75rem 递增
Weights: 400, 500, 600, 700, 800
/* 圆角 */
xs: 2px, sm: 4px, md: 6px, lg: 8px, xl: 12px, 2xl: 16px
/* 阴影 - 浅色模式 */
sm: 0 1px 2px rgba(0,0,0,0.05)
md: 0 4px 6px rgba(0,0,0,0.07)
lg: 0 10px 25px rgba(0,0,0,0.1)
/* 阴影 - 深色模式 */
sm: 0 1px 2px rgba(0,0,0,0.3)
md: 0 4px 6px rgba(0,0,0,0.4)
lg: 0 10px 25px rgba(0,0,0,0.5)完整实现:
(function() {
const themeToggles = document.querySelectorAll('.theme-toggle');
const html = document.documentElement;
// 获取初始主题:优先使用 localStorage 中保存的,否则检查系统偏好
function getInitialTheme() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme) {
return savedTheme;
}
// 检查系统主题偏好
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
}
return 'light';
}
// 设置主题并更新图标显示
function setTheme(theme) {
if (theme === 'dark') {
html.setAttribute('data-theme', 'dark');
document.querySelectorAll('.icon-sun').forEach(icon => {
icon.style.display = 'none';
});
document.querySelectorAll('.icon-moon').forEach(icon => {
icon.style.display = 'block';
});
} else {
html.removeAttribute('data-theme');
document.querySelectorAll('.icon-sun').forEach(icon => {
icon.style.display = 'block';
});
document.querySelectorAll('.icon-moon').forEach(icon => {
icon.style.display = 'none';
});
}
localStorage.setItem('theme', theme);
}
// 切换主题
function toggleTheme() {
const currentTheme = html.getAttribute('data-theme');
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
setTheme(newTheme);
}
// 初始化
const initialTheme = getInitialTheme();
setTheme(initialTheme);
// 添加事件监听器
themeToggles.forEach(button => {
button.addEventListener('click', toggleTheme);
});
// 监听系统主题变化(仅在未手动设置时生效)
if (window.matchMedia) {
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
mediaQuery.addEventListener('change', (e) => {
if (!localStorage.getItem('theme')) {
setTheme(e.matches ? 'dark' : 'light');
}
});
}
})();核心功能:
localStorage在实现此设计系统时,请遵循以下步骤:
terminal-window 组件中该设计系统构建了一个统一、开发者友好的界面,既现代又符合终端使用者的操作习惯。完整的深色模式实现确保界面在任何光照条件下都能良好呈现。
已收录 1 个 Skill