Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
body, html { width: 100%; height: 100%; } body { background-color: #1d1f20; display: flex; align-items: center; justify-content: center; } .switch { background-color: black; width: 150px; height: 195px; box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black, inset 0 2px 2px -2px white, inset 0 0 2px 15px #47434c, inset 0 0 2px 22px black; border-radius: 5px; padding: 20px; perspective: 700px; } .switch input { display: none; } .switch input:checked + .button { transform: translateZ(20px) rotateX(25deg); box-shadow: 0 -10px 20px #ff0202; } .switch input:checked + .button .light { animation: flicker 0.2s infinite 0.3s; } .switch input:checked + .button .shine { opacity: 1; } .switch input:checked + .button .shadow { opacity: 0; } .switch .button { transition: all 0.3s cubic-bezier(1, 0, 1, 1); transform-origin: center center -20px; transform: translateZ(20px) rotateX(-25deg); transform-style: preserve-3d; background-color: #9b0621; width: 100%; height: 100%; position: relative; cursor: pointer; background: linear-gradient(#9b0621 0%, #6d0719 30%, #6d0719 70%, #9b0621 100%); background-repeat: no-repeat; } .switch .button::before { content: ""; background: linear-gradient(rgba(255, 255, 255, 0.8) 20%, #650c1d 55%, #3c0610) 50% 50%/97% 97%, #9b0621; background-repeat: no-repeat; width: 100%; height: 50px; transform-origin: top; transform: rotateX(-90deg); position: absolute; top: 0; } .switch .button::after { content: ""; background-image: linear-gradient(#650c1d, #3c0610); width: 100%; height: 50px; transform-origin: top; transform: translateY(50px) rotateX(-90deg); position: absolute; bottom: 0; box-shadow: 0 50px 8px 0px black, 0 80px 20px 0px rgba(0, 0, 0, 0.5); } .switch .light { opacity: 0; animation: light-off 1s; position: absolute; width: 100%; height: 100%; background-image: radial-gradient(#f8b64b, transparent 40%), radial-gradient(circle, #ff1818 50%, transparent 80%); } .switch .dots { position: absolute; width: 100%; height: 100%; background-image: radial-gradient(transparent 30%, rgba(101, 12, 29, 0.7) 70%); background-size: 10px 10px; } .switch .characters { position: absolute; width: 100%; height: 100%; background: linear-gradient(white, white) 50% 20%/5% 20%, radial-gradient(circle, transparent 50%, white 52%, white 70%, transparent 72%) 50% 80%/33% 25%; background-repeat: no-repeat; } .switch .shine { transition: all 0.3s cubic-bezier(1, 0, 1, 1); opacity: 0.3; position: absolute; width: 100%; height: 100%; background: linear-gradient(white, transparent 3%) 50% 50%/97% 97%, linear-gradient(rgba(255, 255, 255, 0.5), transparent 50%, transparent 80%, rgba(255, 255, 255, 0.5)) 50% 50%/97% 97%; background-repeat: no-repeat; } .switch .shadow { transition: all 0.3s cubic-bezier(1, 0, 1, 1); opacity: 1; position: absolute; width: 100%; height: 100%; background: linear-gradient(transparent 70%, rgba(0, 0, 0, 0.8)); background-repeat: no-repeat; } @keyframes flicker { 0% { opacity: 1; } 80% { opacity: 0.8; } 100% { opacity: 1; } } @keyframes light-off { 0% { opacity: 1; } 80% { opacity: 0; } }
JavaScript
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>纯CSS红色开关-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号