HTML生日快乐-生日祝福(烟花+粒子动画)
以下是一个HTML页面示例,使用了烟花和粒子动画作为装饰,来祝祝发送生日祝福的网页版应用。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>生日祝福</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
}
#particles-js {
width: 100%;
height: 100%;
background-color: #000;
position: fixed;
top: 0;
}
.content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
color: #fff;
font-size: 20px;
}
</style>
</head>
<body>
<div id="particles-js"></div>
<div class="content">
<p>亲爱的,</p>
<h1>祝你生日快乐!</h1>
</div>
<script src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>
<script>
/* 配置烟花动画 */
particlesJS('particles-js', {
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.25,
"sync": false
}
},
"size": {
"value": 5,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance":
评论已关闭