效能
通過幀率: 平均 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 並給出靜止畫面,保證文字清晰、控制元件可用鍵盤操作。請寫原創程式碼,不要從付費或受限的元件庫複製。
更完整的提示詞,包含調參、無障礙和接入步驟。