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

检测于 2026年11月15日 · 数据来自自动脚本,不是手工填写。
按实际尺寸显示。
复制内容以许可声明开头,使用代码时请保留。
<div class="form">
<input type="checkbox" id="bubble">
<label class="bubble" for="bubble"></label>
</div>/* From Uiverse.io by csemszepp - Source: https://codepen.io/onediv/pen/pjgNqJ - Tags: switch, toggle switch */
.form {
position: absolute;
top: 50%;
left: 50%;
height: 100px;
padding: 10px 0;
width: 260px;
transform: translate3d(-50%,-50%,0);
}
.form:before {
content: '';
position: absolute;
top: 0;
left: -5px;
height: 100%;
width: 120px;
background-color: #243548;
border-radius: 50%;
box-shadow: 75px 0 0 #243548, 150px 0 0 #243548;
}
.form:after {
content: '';
position: absolute;
top: -94px;
left: 70px;
height: 100%;
width: 120px;
border-radius: 50%;
}
.form input {
position: absolute;
left: -9999px;
}
.bubble {
position: absolute;
z-index: 2;
cursor: pointer;
top: 50%;
left: 50%;
height: 100px;
width: 100px;
transform: translate3d(-75%,-50%,0);
margin-left: -50px;
background: #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
border-right: 0px solid #BBBBBB;
border-left: 0px solid #BBBBBB;
animation: toggle-reverse 2s 1;
}
#bubble:checked + .bubble {
animation: toggle 2s 1;
transform: translate3d(75%,-50%,0);
background: #3CCC97;
}
.bubble:after {
content: '';
position: absolute;
top: 50%;
margin-top: -15px;
margin-left: -2px;
height: 30px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(45deg);
border-radius: 2px;
transition: 500ms ease all 1.25s;
}
.bubble:before {
content: '';
position: absolute;
top: 50%;
margin-top: -15px;
margin-left: -2px;
height: 30px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(-45deg);
border-radius: 2px;
transition: 500ms ease all 1.25s;
}
#bubble:checked + .bubble:after {
content: '';
position: absolute;
top: 50%;
margin-top: -15px;
margin-left: 5px;
height: 30px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(225deg);
border-radius: 2px;
}
#bubble:checked + .bubble:before {
content: '';
position: absolute;
top: 50%;
margin-top: -7px;
margin-left: -10px;
height: 20px;
width: 4px;
background: #fff;
left: 50%;
transform: rotate(-215deg);
border-radius: 2px;
}
@keyframes toggle {
0% {
transform: translate3d(-75%,-50%,0);
border-right: 0 solid #BBBBBB;
border-left: 0 solid #BBBBBB;
background: #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 100px;
}
20% {
border-right: 0 solid #BBBBBB;
border-left: 0 solid #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform: translate3d(-75%,-50%,0);
height: 100px;
}
40% {
border-left: 0 solid #BBBBBB;
border-radius: 35% 65% 65% 35% / 50% 50% 50% 50%;
height: 90px;
}
50% {
transform: translate3d(0%,-50%,0);
border-right: 25px solid #BBBBBB;
border-left: 0 solid #BBBBBB;
background: #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 90px;
}
75% {
border-left: 25px solid #3CCC97;
border-color: #3CCC97;
background: #3CCC97;
border-radius: 65% 35% 35% 65% / 50% 50% 50% 50%;
height: 90px;
}
100% {
border-right: 0 solid #3CCC97;
border-left: 0 solid #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform: translate3d(75%,-50%,0);
height: 100px;
width: 100px
}
}
@keyframes toggle-reverse {
0% {
transform: translate3d(75%,-50%,0);
background: #3CCC97;
border-right: 0 solid #3CCC97;
border-left: 0 solid #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 100px;
}
20% {
border-right: 0 solid #3CCC97;
border-left: 0 solid #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform: translate3d(75%,-50%,0);
height: 100px;
}
40% {
border-right: 0 solid #3CCC97;
border-radius: 65% 35% 35% 65% / 50% 50% 50% 50%;
height: 90px;
}
50% {
transform: translate3d(0%,-50%,0);
border-left: 25px solid #3CCC97;
border-right: 0 solid #3CCC97;
background: #3CCC97;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
height: 90px;
}
75% {
border-right: 25px solid #BBBBBB;
border-color: #BBBBBB;
background: #BBBBBB;
border-radius: 35% 65% 65% 35% / 50% 50% 50% 50%;
height: 90px;
}
100% {
border-right: 0 solid #BBBBBB;
border-left: 0 solid #BBBBBB;
border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
transform: translate3d(-75%,-50%,0);
height: 100px;
width: 100px
}
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

在线编辑每个组件,用控件微调,下载完整源码,复制进阶提示词。
一次性 $49占位价格
测试模式:不会真实扣款。
免费:预览、复制按钮和课程说明。
轨道是三个连在一起像云朵的深藏蓝圆,一颗气泡旋钮从上面飘过,柔和又梦幻。
夜间模式、睡眠应用和奇趣的设置。
改 #243548 云朵颜色、75px 和 150px 的圆偏移、260px 宽度和气泡样式。
用纯 HTML、CSS 和 JavaScript(不用框架)做一个「云朵气泡开关」组件。轨道是三个连在一起像云朵的深藏蓝圆,一颗气泡旋钮从上面飘过,柔和又梦幻。 适用场景:夜间模式、睡眠应用和奇趣的设置。 开放这些可调项:改 #243548 云朵颜色、75px 和 150px 的圆偏移、260px 宽度和气泡样式。 支持浅色和深色主题,遵守 prefers-reduced-motion 并给出静止画面,保证文字清晰、控件可用键盘操作。请写原创代码,不要从付费或受限的组件库复制。
更完整的提示词,包含调参、无障碍和接入步骤。