svg+css实现白天黑夜切换radio按钮点击背景切换代码

代码语言:html

所属分类:其他

代码描述:svg+css实现白天黑夜切换radio按钮点击背景切换代码

代码标签: svg css 白天 黑夜 切换 radio 按钮 点击 背景 切换 代码

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

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

<head>
  <meta charset="UTF-8">
  
  
  
<style>
:root {
	--morning-color: #60a5fa;
	--night-color: #7c3aed;
	--morning-bg: #87ceeb;
	--night-bg: #1a237e;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	font-family: system-ui, sans-serif;
	background-color: var(--morning-bg);
	transition: background-color 0.5s ease;
	position: relative;
	overflow: hidden;
}

.background-elements {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.clouds {
	position: absolute;
	width: 100%;
	height: 100%;
	opacity: 1;
	transition: opacity 0.5s ease;
}

.cloud {
	position: absolute;
	width: 180px;
	height: 60px;
	opacity: 0.9;
}

.cloud:nth-child(1) {
	top: 12%;
	animation: float 25s linear infinite;
	animation-delay: -18s;
	transform: scale(0.9);
}
.cloud:nt.........完整代码请登录后点击上方下载按钮下载查看

网友评论0