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

檢測於 2026年11月15日 · 資料來自自動腳本,不是手工填寫。
以實際尺寸顯示。
複製內容以授權聲明開頭,使用程式碼時請保留。
<div class="container">
<input name="power" id="power" type="checkbox" />
<label class="power" for="power">
<span class="icon-off"></span>
<span class="light"></span>
</label>
</div>/* From Uiverse.io by neerajbaniwal - Tags: button, hover button, button hover effect , 2d button */
.container {
width: 150px;
height: 130px;
padding-top: 20px;
margin: 50px auto;
}
#power {
position: absolute;
left: -9999px;
}
label {
display: block;
width: 100px;
height: 100px;
border-radius: 50%;
position: relative;
margin: auto;
border: 4px solid #636679;
background: -webkit-radial-gradient(
center,
ellipse cover,
#efefef 0%,
#eee 80%,
#fff 100%
);
background: -moz-radial-gradient(
center,
ellipse cover,
#efefef 0%,
#eee 80%,
#fff 100%
);
background: radial-gradient(
center,
ellipse cover,
#fefefe 0%,
#eee 80%,
#fff 100%
);
box-shadow: inset 0 -5px 10px 0 #d0d5eb, inset 0 5px 10px 0 #fff,
0 0 0 1px #333;
cursor: pointer;
text-align: center;
font-size: 40px;
color: #0f0;
line-height: 100px;
text-shadow: -1px -1px 0px #fff, 1px 1px 0px #fff;
transition: all 0.1s ease-in-out;
}
label:after,
label:before {
display: block;
content: "";
position: absolute;
}
label:before {
width: 150px;
height: 150px;
border-radius: 20px;
background: -webkit-linear-gradient(
top,
#fefefe 0%,
#eee 30%,
#ddd 82%,
#ddd 100%
);
background: -moz-linear-gradient(
top,
#fefefe 0%,
#eee 30%,
#ddd 82%,
#ddd 100%
);
background: linear-gradient(top, #fefefe 0%, #eee 30%, #ddd 82%, #ddd 100%);
box-shadow: 0 10px 30px 0 #000;
top: -25px;
left: -25px;
z-index: -2;
}
label:after {
width: 130px;
height: 130px;
border-radius: 50%;
background: #fff;
top: -15px;
left: -15px;
z-index: -1;
box-shadow: 0 -2px 5px 0px #fefefe, 0 2px 5px 0 #ccc;
background: rgb(210, 215, 237);
background: -webkit-linear-gradient(
top,
#ddd 0%,
#ddd 30%,
#eee 82%,
#efefef 100%
);
background: -moz-linear-gradient(
top,
#ddd 0%,
#ddd 30%,
#eee 82%,
#efefef 100%
);
background: linear-gradient(top, #ddd 0%, #ddd 30%, #eee 82%, #efefef 100%);
}
.light {
display: block;
width: 12px;
height: 12px;
position: absolute;
top: -12px;
right: -12px;
background: -webkit-radial-gradient(
center,
ellipse cover,
#fff 0%,
#d6f804 80%,
#bade32 100%
);
background: -moz-radial-gradient(
center,
ellipse cover,
#fff 0%,
#d6f804 80%,
#bade32 100%
);
background: radial-gradient(
center,
ellipse cover,
#fff 0%,
#d6f804 80%,
#bade32 100%
);
box-shadow: inset 0 1px 1px 0 #333, inset 0 -1px 1px 0 #333,
0 0 5px 1px #bade32;
border-radius: 50%;
transition: all 0.1s ease-in-out;
}
.icon-off {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 40px;
height: 40px;
border-radius: 50%;
background: #d6f804;
box-shadow: inset 0 0 4px 0 #999;
transition: all 0.1s ease-in-out;
}
.icon-off:after {
display: block;
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 26px;
height: 26px;
border-radius: 50%;
background: #eee;
box-shadow: 0 0 3px 0 #999;
z-index: 2;
}
.icon-off:before {
display: block;
content: "";
position: absolute;
top: -5px;
left: 0;
right: 0;
margin: auto;
width: 8px;
height: 25px;
background: #d6f804;
box-shadow: inherit;
border-radius: 10px;
border-style: solid;
border-width: 0 3px 0;
border-color: #eee;
z-index: 3;
transition: all 0.1s ease-in-out;
}
#power:checked + label {
background: -webkit-radial-gradient(
center,
ellipse cover,
#ddd 0%,
#eee 80%,
#efefef 100%
);
background: radial-gradient(
center,
ellipse cover,
#ddd 0%,
#eee 80%,
#efefef 100%
);
background: radial-gradient(
center,
ellipse cover,
#ddd 0%,
#eee 80%,
#efefef 100%
);
box-shadow: inset 0 -5px 10px 0 #aaa, inset 0 5px 10px 0 #aaa, 0 0 0 1px #333;
transition: all 0.1s linear;
}
#power:checked + label .light {
background: -webkit-radial-gradient(
center,
ellipse cover,
#fcc 0%,
#f88 60%,
#f00 100%
);
background: -moz-radial-gradient(
center,
ellipse cover,
#fcc 0%,
#f88 60%,
#f00 100%
);
background: radial-gradient(
center,
ellipse cover,
#fcc 0%,
#f88 60%,
#f00 100%
);
box-shadow: inset 0 1px 1px 0 #555, inset 0 -1px 1px 0 #555, 0 0 5px 0 #f55;
transition: all 0.1s linear;
}
#power:checked + label .icon-off {
background: transparent;
box-shadow: inset 0 0 5px 0 #777;
transition: all 0.1s linear;
}
#power:checked + label .icon-off:after {
background: inherit;
box-shadow: 0 0 5px 0 #777;
}
#power:checked + label .icon-off:before {
background: #ddd;
border-color: #dfdfdf;
box-shadow: inherit;
transition: all 0.1s linear;
}控制項 · HTML · CSS · JS
直接改程式碼,再用控制項微調,預覽會隨輸入即時更新。

線上編輯每個元件,用控制項微調,下載完整原始碼,複製進階提示詞。
一次性 $49暫定價格
測試模式:不會真的扣款。
免費:預覽、複製按鈕和課程說明。
100px 的淺色圓按鈕帶灰色邊框和電源圖示,勾選時亮起光暈,像按下真正的電源開關。
裝置和物聯網應用裡的電源、啟動和連線控制。
改 100px 尺寸、4px 的 #636679 邊框、徑向漸變和開啟狀態的光色。
用純 HTML、CSS 和 JavaScript(不用框架)做一個「圓形電源按鈕」元件。100px 的淺色圓按鈕帶灰色邊框和電源圖示,勾選時亮起光暈,像按下真正的電源開關。 適用場景:裝置和物聯網應用裡的電源、啟動和連線控制。 開放這些可調項:改 100px 尺寸、4px 的 #636679 邊框、徑向漸變和開啟狀態的光色。 支援淺色和深色主題,遵守 prefers-reduced-motion 並給出靜止畫面,保證文字清晰、控制元件可用鍵盤操作。請寫原創程式碼,不要從付費或受限的元件庫複製。
更完整的提示詞,包含調參、無障礙和接入步驟。