layered-design
它能做什么
打造元素刻意重叠的界面,像浮动的图层一样,营造出层次感。这就像把纸张一层层叠放,但会以有序且视觉上有趣的方式呈现。
适用场景
- ✓当你想让一个元素(如文字或图片)显示在另一个元素之上时。
- ✓想在网站或应用中创造景深或立体效果时。
- ✓想打破网格的僵硬外观,获得更多视觉自由度时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/design-it/layered-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“设计一个页面,主标题显示在背景图片之上,同时一张小文字卡片浮在图片上方。”
每周 5 个新技能,1 分钟读完。
工作原理
这是通过编程技术实现的,让元素可以彼此叠放,就像一摞扑克牌。每个图层都是独立处理的,并且可以拥有自己的阴影或边框,以便突出显示。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Layered Design
"Stacking context. Interfaces built from overlapping, independent layers."
When to Use
Use this sub-style when the user's request matches the aesthetic described above. This is a child reference of the design-it skill and is not meant to be triggered directly.
Core Principles
- Explicit Overlap: Elements intentionally overlap each other to break the grid and show depth.
- Clear Stratification: Every layer must be visually distinct via shadow, border, or contrasting color.
- Parallax Scrolling: Background layers move slower than foreground layers during interaction/scrolling.
Visual DNA
- Colors: Monochromatic Brown or Sophisticated Neutral. Layering works best when the background is distinct from the floating elements.
- Typography: Often large, overlapping text that spans across image and background layers.
- Spacing: Negative space is required around overlapping elements so they don't feel cluttered.
Web Implementation
- Heavy use of
position: absolute, negative margins, andz-index. - CSS Example:
.layer-container {
position: relative;
padding: 100px;
}
.layer-bg-image {
position: absolute;
top: 0; right: 0;
width: 60%;
height: 400px;
object-fit: cover;
z-index: 1;
}
.layer-text-box {
position: relative;
z-index: 2; /* Sits above the image */
background: white;
padding: 40px;
width: 50%;
margin-top: 200px; /* Pulls it down over the image */
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
/* Optional: border to define edge */
border-left: 4px solid var(--cta-highlight);
}
App Implementation
SwiftUI
struct LayeredDesignView: View {
var body: some View {
ScrollView {
ZStack(alignment: .top) {
// Background Image Layer (Back)
Image("architectural-bg")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(height: 400)
.offset(x: 40, y: 0) // Shifted right
.zIndex(1)
// Content Card Layer (Front)
VStack(alignment: .leading, spacing: 16) {
Text("Stacking Context")
.font(.largeTitle).bold()
Text("This card intentionally overlaps the background image to create depth without relying on a grid.")
.foregroundColor(.secondary)
}
.padding(40)
.background(Color.white)
.shadow(color: Color.black.opacity(0.1), radius: 30, y: 20)
.offset(x: -40, y: 200) // Shifted left and pulled down
.zIndex(2)
}
.padding(.bottom, 200) // Account for the offset
}
}
}
ZStackis the foundation of layered design in SwiftUI.- Use
.offset()to intentionally break the alignment and create overlapping compositions. - Explicitly set
.zIndex()if your offsets might cause unexpected paint orders.
Flutter
class LayeredDesignScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: SizedBox(
height: 600, // Fixed height stack or use constraints
child: Stack(
children: [
// Background Image Layer
Positioned(
top: 0,
right: -40, // Shifted offscreen right
width: MediaQuery.of(context).size.width * 0.8,
height: 400,
child: Image.asset('assets/architectural-bg.jpg', fit: BoxFit.cover),
),
// Content Card Layer
Positioned(
top: 250, // Overlaps the bottom of the image
left: 20, // Overlaps the left of the image
width: MediaQuery.of(context).size.width * 0.7,
child: Container(
padding: const EdgeInsets.all(40),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 30, offset: const Offset(0, 20))
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
…
常见问题
为什么要使用重叠的图层?
为了获得更具动感、更现代的外观,营造层次感,并突出重要元素。
这会让网站变慢吗?
不一定。如果实现得当,这种效果只是视觉上的变化,不会明显影响性能。关键在于重叠是有意为之且有条理的。
我需要是经验丰富的设计师才能使用吗?
不需要,概念很简单:让元素重叠。编程工具可以帮助你控制重叠的方式和位置。
详情
作者的原始描述
Web and App implementation guide for Layered Design. Trigger when user wants multiple depth levels, floating panels, and overlapping content.
热度
- GitHub 星标
- 48k
- 排名
- #4404
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。