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 {
	margin-top: 20px;
}

.gear {
	font-size: 50px;
	color: silver;
	opacity: 0.5;
	transition: opacity 0.5s ease-in-out;
}

/* Battery */
.battery-container {
	margin-top: 20px;
	font-size: 35px;
}

.battery {
	color: gray;
	opacity: 0.5;
	transition: opacity 0.5s ease-in-out, color 0.5s;
}

.battery.on {
	color: green;
	opacity: 1;
}

/* WiFi */
.wifi-container {
	margin-top: 20px;
	font-size: 35px;
}

.wifi {
	color: black;
	opacity: 0.5;
	transition: opacity 0.5s ease-in-out, color 0.5s;
}

.wifi.connected {
	color: lightblue;
	opacity: 1;
	animation: pulse 1s infinite alternate;
}

@keyframes pulse {
	0% {
		transform: scale(1);
	}
	100% {
		transform: scale(1.1);
	}
}

.atom-icon {
	padding: 10px;
	font-size: 50px;
	color: gray;
	opacity: 0.3;
	transition: opacity 0.5s ease-in-out, text-shadow 0.5s ease-in-out;
}

.atom-icon.active {
	color: cyan;
	opacity: 1;
	text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
	animation: spinAtom 3s linear infinite, glow 1.5s alternate infinite;
}

#screen-flicker {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: black;
	opacity: 0;
	visibility: hidden;
	z-index: 100;
	transition: opacity 0.2s ease-in-out;
}

#screen-flicker.active {
	visibility: visible;
	animation: flicker 1s ease-in-out;
}

@keyframes flicker {
	0% {
		opacity: 1;
	}
	25% {
		opacity: 0.7;
	}
	50% {
		opacity: 1;
	}
	75% {
		opacity: 0.5;
	}
	100% {
		opacity: 0;
	}
}

body.power-on {
	animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
	0% .........完整代码请登录后点击上方下载按钮下载查看

网友评论0