性能
通过帧率: 平均 60 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 1.7 KB · 运行时 2.8 KB
massive-dodo-67MIT开关Uiverse.io
Admin12121 用纯 HTML 和 CSS 做的开关。按 MIT 许可从 Uiverse.io 收录,此处为实时预览。
质量报告
等级和分数来自构建或测试时跑过的自动检查。没跑过的项目会标成「未检测」,不会填假数据。
帧率: 平均 60 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 1.7 KB · 运行时 2.8 KB
问题 0 · 读屏: 通过
没有持续动效
无溢出
帧率和长任务是在无界面的 Chromium 里用软件 WebGL 测的,只适合在本站组件之间比较,不代表真机表现。
不适用:静止时没有可见动画;由悬停触发的动画没有测试。
没有 axe-core 违规。

检测于 2026年11月15日 · 数据来自自动脚本,不是手工填写。
按实际尺寸显示。
复制内容以许可声明开头,使用代码时请保留。
<label class="switch-button" for="switch">
<div class="switch-outer">
<input id="switch" type="checkbox">
<div class="button">
<span class="button-toggle"></span>
<span class="button-indicator"></span>
</div>
</div>
</label>/* From Uiverse.io by Admin12121 - Tags: switch, animated, click effect */
.switch-button {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
justify-content: center;
margin: auto;
height: 55px;
}
.switch-button .switch-outer {
height: 100%;
background: #252532;
width: 115px;
border-radius: 165px;
-webkit-box-shadow: inset 0px 5px 10px 0px #16151c, 0px 3px 6px -2px #403f4e;
box-shadow: inset 0px 5px 10px 0px #16151c, 0px 3px 6px -2px #403f4e;
border: 1px solid #32303e;
padding: 6px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.switch-button .switch-outer input[type="checkbox"] {
opacity: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
position: absolute;
}
.switch-button .switch-outer .button-toggle {
height: 42px;
width: 42px;
background: -webkit-gradient(
linear,
left top,
left bottom,
from(#3b3a4e),
to(#272733)
);
background: -o-linear-gradient(#3b3a4e, #272733);
background: linear-gradient(#3b3a4e, #272733);
border-radius: 100%;
-webkit-box-shadow: inset 0px 5px 4px 0px #424151, 0px 4px 15px 0px #0f0e17;
box-shadow: inset 0px 5px 4px 0px #424151, 0px 4px 15px 0px #0f0e17;
position: relative;
z-index: 2;
-webkit-transition: left 0.3s ease-in;
-o-transition: left 0.3s ease-in;
transition: left 0.3s ease-in;
left: 0;
}
.switch-button
.switch-outer
input[type="checkbox"]:checked
+ .button
.button-toggle {
left: 58%;
}
.switch-button
.switch-outer
input[type="checkbox"]:checked
+ .button
.button-indicator {
-webkit-animation: indicator 1s forwards;
animation: indicator 1s forwards;
}
.switch-button .switch-outer .button {
width: 100%;
height: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: relative;
-webkit-box-pack: justify;
justify-content: space-between;
}
.switch-button .switch-outer .button-indicator {
height: 25px;
width: 25px;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
border-radius: 50%;
border: 3px solid #ef565f;
-webkit-box-sizing: border-box;
box-sizing: border-box;
right: 10px;
position: relative;
}
@-webkit-keyframes indicator {
30% {
opacity: 0;
}
0% {
opacity: 1;
}
100% {
opacity: 1;
border: 3px solid #60d480;
left: -68%;
}
}
@keyframes indicator {
30% {
opacity: 0;
}
0% {
opacity: 1;
}
100% {
opacity: 1;
border: 3px solid #60d480;
left: -68%;
}
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

在线编辑每个组件,用控件微调,下载完整源码,复制进阶提示词。
一次性 $49占位价格
测试模式:不会真实扣款。
免费:预览、复制按钮和课程说明。
深深凹下的轨道和顶部带高光、底部带投影的圆钮,看起来像精密加工过,像音响功放上的开关。
深色仪表盘、音频或录音棚工具和高级感的设置。
改 #252532 轨道、#3b3a4e 到 #272733 的旋钮渐变、115px × 55px 尺寸和 42px 旋钮。
用纯 HTML、CSS 和 JavaScript(不用框架)做一个「深色硬件旋钮开关」组件。深深凹下的轨道和顶部带高光、底部带投影的圆钮,看起来像精密加工过,像音响功放上的开关。 适用场景:深色仪表盘、音频或录音棚工具和高级感的设置。 开放这些可调项:改 #252532 轨道、#3b3a4e 到 #272733 的旋钮渐变、115px × 55px 尺寸和 42px 旋钮。 支持浅色和深色主题,遵守 prefers-reduced-motion 并给出静止画面,保证文字清晰、控件可用键盘操作。请写原创代码,不要从付费或受限的组件库复制。
更完整的提示词,包含调参、无障碍和接入步骤。