css+div实现电器电源开关点击启动效果代码

代码语言:html

所属分类:布局界面

代码描述:css+div实现电器电源开关点击启动效果代码

代码标签: css div 电器 电源 开关 点击 启动

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.7.0.css">
  
<style>
/* General Styles */
body {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	background-color: #1a1a1a;
	margin: 0;
	flex-direction: column;
}

/* Power Button */
.power-btn {
	width: 80px;
	height: 80px;
	border: none;
	border-radius: 50%;
	background: radial-gradient(circle, #ff6600 30%, #cc5500 60%);
	box-shadow: 0 4px 8px rgba(255, 102, 0, 0.5),
		inset 0 2px 6px rgba(0, 0, 0, 0.4);
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	transition: all 0.3s ease-in-out;
	position: relative;
}

.power-btn:hover {
	box-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
	transform: scale(1.05);
}

.power-btn.on {
	background: radial-gradient(circle, #ff3300 30%, #cc2200 60%);
	box-shadow: 0 0 20px rgba(255, 102, 0, 0.8);
}

/* Status Text */
.status {
	margin-top: 10px;
	font-size: 18px;
	color: white;
	font-family: Arial, sans-serif;
	opacity: 0;
	transition: opacity 0.5s ease-in-out;
}

/* Lightbulbs */
.lightbulbs {
	display: flex;
	gap: 15px;
	margin-top: 20px;
}

.lightbulb {
	font-size: 40px;
	color: gray;
	opacity: 0.2;
	transition: opacity 0.5s ease-in-out, transform 0.3s;
}

.lightbulb.on {
	color: yellow;
	opacity: 1;
	text-shadow: 0 0 15px rgba(255, 255, 0, 0.7);
	transform: scale(1.1);
}

/* Gear */
.gear-container.........完整代码请登录后点击上方下载按钮下载查看

网友评论0