Install
openclaw skills install page-gen为文学作品(小说、电影、动漫、游戏等)生成精美的响应式单页 HTML 介绍和解析页面。当用户要求"介绍XX作品"、"做一个XX的介绍页面"、"生成作品解析页面"、"创建作品展示页"、"帮我做个XX的网页"时触发。支持主题配色提取、交互组件、多内容分区展示。
openclaw skills install page-gen为文学作品生成自包含的单页 HTML 展示页面,包含主题配色、响应式布局和交互功能。
根据作品类型选择配色方案(以下为参考建议,实际配色需根据作品具体氛围、用户偏好或品牌要求灵活调整):
| 作品类型 | 建议配色 |
|---|---|
| 武侠/修仙 | 金色 (#d4a853) + 翠绿 (#2dd4a8) + 深色 (#0a0e1a) |
| 奇幻/玄幻 | 冰蓝 (#4a9eff) + 深蓝 (#0a1628) |
| 历史/权谋 | 金色 (#d4a853) + 朱红 (#c0392b) + 深色 (#0f1419) |
| 神话/志怪 | 紫色 (#8e44ad) + 粉色 (#f8cdda) + 青色 (#a8edea) |
| 家庭/情感 | 暖棕 (#8B4513) + 金色 (#DAA520) + 米白 (#FFFAF0) |
| 科幻/赛博 | 霓虹青 (#00f5ff) + 深色 (#0a0a0a) + 紫罗兰 (#a78bfa) |
| 都市/现代 | 纯白 + 蓝色 (#3b82f6) + 灰色 |
重要提示:上表配色仅为参考建议,实际生成时应根据以下因素灵活调整:
使用 Google Fonts 国内镜像:
<link rel="preconnect" href="https://fonts.loli.net">
<link href="https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
'Noto Serif SC', serif — 优雅文艺'Noto Sans SC', sans-serif — 清晰易读768px — 平板:单列布局,缩小字体480px — 手机:紧凑布局,减少内边距<section class="hero">
<div class="hero-badge">
<span class="hero-badge-dot"></span>
{分类标签}
</div>
<h1 class="hero-title">
<span class="char-gold">{作品名}</span>
</h1>
<p class="hero-subtitle">{一句话概括}</p>
<blockquote class="hero-quote">"{经典语录}"</blockquote>
<div class="hero-stats">
<div class="hero-stat">
<div class="hero-stat-value">{数值}</div>
<div class="hero-stat-label">{标签}</div>
</div>
</div>
<a href="#section1" class="hero-cta">
开始探索
<span class="hero-cta-arrow">→</span>
</a>
</section>
<nav class="nav" id="nav">
<div class="nav-inner">
<div class="nav-brand">{作品名}</div>
<ul class="nav-links">
<li><a href="#intro" class="nav-link active">作品简介</a></li>
<li><a href="#author" class="nav-link">作者介绍</a></li>
</ul>
<div class="nav-right">
<div class="nav-progress">
<svg class="nav-progress-ring" viewBox="0 0 36 36">
<circle class="bg" cx="18" cy="18" r="15" />
<circle class="fill" id="progressRing" cx="18" cy="18" r="15"
stroke-dasharray="94.25" stroke-dashoffset="94.25" />
</svg>
<span id="progressText">0%</span>
</div>
</div>
</div>
</nav>
<div class="card">
<div class="card-icon">📚</div>
<h3 class="card-title">{标题}</h3>
<p class="card-text">{描述}</p>
<div class="card-tags">
<span class="tag">{标签1}</span>
<span class="tag jade">{标签2}</span>
</div>
</div>
<div class="character-card">
<div class="character-avatar">👤</div>
<div class="character-name">{角色名}</div>
<div class="character-role">{身份}</div>
<div class="character-desc">{描述}</div>
</div>
<div class="timeline">
<div class="timeline-item">
<div class="timeline-dot"></div>
<div class="timeline-year">{时间}</div>
<div class="timeline-title">{事件}</div>
<div class="timeline-desc">{描述}</div>
</div>
</div>
<div class="quote-card">
<p class="quote-text">"{语录内容}"</p>
<p class="quote-source">—— <strong>{出处}</strong></p>
</div>
const progressBar = document.getElementById('progressBar');
window.addEventListener('scroll', () => {
const scrollTop = window.scrollY;
const docHeight = document.documentElement.scrollHeight - window.innerHeight;
const progress = (scrollTop / docHeight) * 100;
progressBar.style.width = progress + '%';
});
const sections = document.querySelectorAll('section[id]');
const navLinks = document.querySelectorAll('.nav-link');
window.addEventListener('scroll', () => {
let current = '';
sections.forEach(section => {
const sectionTop = section.offsetTop - 100;
if (window.scrollY >= sectionTop) {
current = section.getAttribute('id');
}
});
navLinks.forEach(link => {
link.classList.remove('active');
if (link.getAttribute('href') === '#' + current) {
link.classList.add('active');
}
});
});
<button class="back-to-top" id="backToTop" aria-label="返回顶部">↑</button>
<script>
const backToTop = document.getElementById('backToTop');
window.addEventListener('scroll', () => {
backToTop.classList.toggle('visible', window.scrollY > 300);
});
backToTop.addEventListener('click', () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
});
</script>
.fade-in {
opacity: 0;
transform: translateY(20px);
transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.fade-in.visible {
opacity: 1;
transform: translateY(0);
}
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, { threshold: 0.1 });
document.querySelectorAll('.fade-in').forEach(el => observer.observe(el));
以下为示例模板,实际值需根据作品主题和配色方案调整:
:root {
/* 颜色 - 根据作品主题调整(以下为示例值) */
--bg-primary: #0a0e1a;
--bg-secondary: #111827;
--bg-card: rgba(15, 23, 42, 0.85);
--bg-card-hover: rgba(30, 41, 59, 0.95);
--gold-primary: #d4a853;
--gold-light: #f0d78c;
--gold-glow: rgba(212, 168, 83, 0.4);
--gold-subtle: rgba(212, 168, 83, 0.1);
--accent: #2dd4a8; /* 按主题更换 */
--accent-glow: rgba(45, 212, 168, 0.3);
--text-primary: #f1f5f9;
--text-secondary: #94a3b8;
--text-muted: #64748b;
--border-subtle: rgba(212, 168, 83, 0.15);
--border-active: rgba(212, 168, 83, 0.5);
/* 字体 */
--font-display: 'Noto Serif SC', serif;
--font-body: 'Noto Sans SC', sans-serif;
/* 间距 */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-8: 32px;
--space-10: 40px;
--space-12: 48px;
--space-16: 64px;
/* 圆角 */
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 20px;
--radius-xl: 28px;
/* 阴影 */
--shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
--shadow-hover: 0 12px 48px rgba(212, 168, 83, 0.25);
/* 过渡 */
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--duration-normal: 0.3s;
}
| 作品类型 | 推荐数据 |
|---|---|
| 小说 | 总字数、章节数、出版年份、销量 |
| 电影 | 豆瓣评分、票房、片长、上映年份 |
| 动漫 | 集数、评分、首播年份、制作公司 |
| 历史 | 跨度年数、册数、覆盖朝代 |
生成单个自包含 HTML 文件:
<style> 标签内<script> 标签内用户输入:
帮我做一个《三体》的介绍页面
提取信息: