新拟态
Neumorphism
成对的柔光和阴影,让同色控件像从底板凸起或压进去。
适用场景
让装饰性的控件面板呈现模塑外壳的质感。 适合小面积界面,控件最好有清晰的边界或图标,阴影很淡时也能辨认。
应用示例
桌面计时器把开始和暂停按钮放在浅灰色面板上。按下暂停时,外部的明暗阴影切换为内凹阴影,按钮上的暂停图标仍然清楚。
AI 提示词
给【目标区域】做新拟态。控件填充色与底板相同,搭配左上亮影和右下暗影,按下时改用内阴影。添加清楚的轮廓或图标,保证在低对比下仍能辨识。
示例代码
保存为 HTML 文件后,用浏览器打开即可运行。代码与页面里的演示一致。
查看 HTML
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>新拟态</title>
<style>
:root {
color-scheme: dark;
--demo-bg: #171629;
--demo-ink: #f8f5ff;
--demo-accent: #b9a6ff;
--demo-muted: #bfbbd3;
font-family: system-ui, sans-serif;
color: var(--demo-ink);
background: var(--demo-bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
.demo {
display: grid;
place-items: center;
align-content: center;
min-height: 100vh;
padding: 14px;
overflow: hidden;
background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
}
.demo-button {
border: 1px solid #ffffff3d;
border-radius: 7px;
background: #ffffff12;
color: var(--demo-ink);
padding: 6px 11px;
font-size: 12px;
cursor: pointer;
}
:focus-visible {
outline: 2px solid var(--demo-accent);
outline-offset: 3px;
}
.visual-specimen {
width: min(100%, 290px);
height: 124px;
display: grid;
place-items: center;
position: relative;
isolation: isolate;
}
.molded-panel { width: min(100%, 224px); height: 104px; display: flex; align-items: center; justify-content: center; gap: 26px; background: #bbb5cd; border-radius: 15px; }
.molded-panel i {
display: grid; place-items: center; width: 49px; aspect-ratio: 1; border-radius: 50%;
box-shadow: -6px -6px 12px #e0dce9, 6px 6px 12px #817894;
}
.molded-panel i:last-child { box-shadow: inset -6px -6px 12px #ddd9e8, inset 6px 6px 12px #847a96; }
.molded-panel i::before { content: ''; width: 15px; aspect-ratio: 1; border: 2px solid #594d71; border-radius: 4px; transform: rotate(45deg); }
.molded-panel i:last-child::before { background: #76668e; border-radius: 50%; }
</style>
</head>
<body>
<main class="demo">
<div class="visual-specimen" aria-hidden="true"><div class="molded-panel"><i></i><i></i></div></div>
</main>
</body>
</html>UI Skills 原创示例