效能
通過幀率: 平均 60 fps,p5 59.9 · 長任務: 0 個,共 0 毫秒,最長 0 毫秒 · 原始碼 gzip 1.7 KB · 執行時 2.7 KB
sharp-cheetah-12MIT開關Uiverse.io
vikramsinghnegi 用純 HTML 和 CSS 做的開關。依 MIT 授權從 Uiverse.io 收錄,此處為即時預覽。
品質報告
等級和分數來自建置或測試時跑過的自動檢查。沒跑過的項目會標成「未檢測」,不會填假資料。
幀率: 平均 60 fps,p5 59.9 · 長任務: 0 個,共 0 毫秒,最長 0 毫秒 · 原始碼 gzip 1.7 KB · 執行時 2.7 KB
問題 0 · 讀屏: 通過
沒有持續動效
無溢出
幀率和長任務是在無介面的 Chromium 裡用軟體 WebGL 測的,只適合在本站元件之間比較,不代表實機表現。
不適用:靜止時沒有可見動畫;由懸停觸發的動畫沒有測試。
沒有 axe-core 違規。

檢測於 2026年11月15日 · 資料來自自動腳本,不是手工填寫。
以實際尺寸顯示。
複製內容以授權聲明開頭,使用程式碼時請保留。
<div class="switch demo3">
<input type="checkbox" />
<label><i></i></label>
</div>/* From Uiverse.io by vikramsinghnegi - Tags: material design, animation, gradient, switch, on, off, toggle, figma */
.switch {
position: relative;
margin: 25px 20px;
}
.switch input {
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0;
z-index: 100;
position: absolute;
width: 100%;
height: 100%;
cursor: pointer;
}
.switch.demo3 {
width: 180px;
height: 50px;
}
.switch.demo3 label {
display: block;
width: 100%;
height: 100%;
background: #d8ba5f;
border-radius: 50px;
box-shadow: inset 0 4px 8px 2px rgba(248, 6, 6, 0.2),
0 1px 0 rgba(255, 255, 255, 0.5);
}
.switch.demo3 label:after {
content: "";
position: absolute;
z-index: -1;
top: -8px;
right: -8px;
bottom: -8px;
left: -8px;
border-radius: inherit;
background: #ababab;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ababab));
background: -webkit-linear-gradient(#f2f2f2, #ababab);
background: linear-gradient(#f2f2f2, #ababab);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25);
}
.switch.demo3 label:before {
content: "";
position: absolute;
z-index: -1;
top: -18px;
right: -18px;
bottom: -18px;
left: -18px;
border-radius: inherit;
background: #eee;
background: linear-gradient(#e5e7e6, #eee);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
filter: blur(1px);
}
.switch.demo3 label i {
display: block;
height: 100%;
width: 60%;
border-radius: inherit;
background: silver;
position: absolute;
z-index: 2;
right: 40%;
top: 0;
background: #b2ac9e;
background: linear-gradient(#f7f2f6, #b2ac9e);
box-shadow: inset 0 1px 0 white, 0 0 8px rgba(0, 0, 0, 0.3),
0 5px 5px rgba(0, 0, 0, 0.2);
}
.switch.demo3 label i:after {
content: "";
position: absolute;
left: 15%;
top: 25%;
width: 70%;
height: 50%;
background: #d2cbc3;
background: linear-gradient(#cbc7bc, #d2cbc3);
border-radius: inherit;
}
.switch.demo3 label i:before {
content: "off";
text-transform: uppercase;
font-style: normal;
font-weight: bold;
color: rgba(0, 0, 0, 0.4);
text-shadow: 0 1px 0 #bcb8ae, 0 -1px 0 #97958e;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
position: absolute;
top: 50%;
margin-top: -12px;
right: -50%;
}
.switch.demo3 input:checked ~ label {
background: #9abb82;
}
.switch.demo3 input:checked ~ label i {
right: -1%;
}
.switch.demo3 input:checked ~ label i:before {
content: "on";
right: 115%;
color: #82a06a;
text-shadow: 0 1px 0 #afcb9b, 0 -1px 0 #111311;
}控制項 · HTML · CSS · JS
直接改程式碼,再用控制項微調,預覽會隨輸入即時更新。

線上編輯每個元件,用控制項微調,下載完整原始碼,複製進階提示詞。
一次性 $49暫定價格
測試模式:不會真的扣款。
免費:預覽、複製按鈕和課程說明。
180px 寬的芥末色軌道帶偏紅的內陰影和外圈光環,裡面一顆大滑鈕,厚實又好點。
自助終端、觸控式螢幕和大尺寸設定控制元件。
改 #d8ba5f 軌道、rgba(248,6,6,0.2) 內陰影、180px × 50px 尺寸和 -8px 光環。
用純 HTML、CSS 和 JavaScript(不用框架)做一個「寬芥末色膠囊開關」元件。180px 寬的芥末色軌道帶偏紅的內陰影和外圈光環,裡面一顆大滑鈕,厚實又好點。 適用場景:自助終端、觸控式螢幕和大尺寸設定控制元件。 開放這些可調項:改 #d8ba5f 軌道、rgba(248,6,6,0.2) 內陰影、180px × 50px 尺寸和 -8px 光環。 支援淺色和深色主題,遵守 prefers-reduced-motion 並給出靜止畫面,保證文字清晰、控制元件可用鍵盤操作。請寫原創程式碼,不要從付費或受限的元件庫複製。
更完整的提示詞,包含調參、無障礙和接入步驟。