js实现开关控制背景小球运动动画效果代码

代码语言:html

所属分类:动画

代码描述:用js实现一个开关来控制背景中彩色小球运动动画效果代码

代码标签: 开关 小球 背景 动画

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

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

<head>

  <meta charset="UTF-8">
  

   <link rel="preconnect" href="https://fonts.googleapis.com">

<link href="https://fonts.googleapis.com/css2?family=Spectral:wght@200;400&display=swap" rel="stylesheet">
  
  
  
<style>
* {
	box-sizing: border-box;
}

:root {
	--buttonColor: #ff1fb0;
}

body {
	font-family: 'Spectral', serif;
	font-size: clamp(100%, 1rem + 2vw, 2rem);
	margin: 0;
	background: #2c67d4;
	color: #ffffff;
	min-height: 100vh;
	max-width: 100%;
	overflow-x: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
}

main {
	width: 100%;
	max-width: 86rem;
	padding: 2rem;
	position: relative;
	z-index: 1;
}

h1 {
	font-weight: 200;
	font-size: clamp(4rem, 10vw, 12rem);
	line-height: 1.2;
	letter-spacing: -0.07em;
	margin: 0;
}

p {
	margin: 0 0 2rem;
}

button {
	display: flex;
	align-items: center;
	justify-content: center.........完整代码请登录后点击上方下载按钮下载查看

网友评论0