《不可达代码(BL)我娶了儿子当老婆?!》
<!DOCTYPEhtml>
<htmllang="zh-CN">
<head>
<metacharset="UTF-8">
<title>To.ShiLin:HAPPYBIRTHDAY!!!</title>
<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
}
body{
width:100vw;
height:100vh;
overflow:hidden;
background:#081430;
background-image:radial-gradient(#102b600%,#050c20100%);
font-family:"MicrosoftYaHei",sans-serif;
display:flex;
align-items:center;
justify-content:center;
}
.text-box{
text-align:center;
z-index:2;
}
h1{
font-size:4rem;
color:#74c0ff;
text-shadow:0012px#409cff,0024px#2078ff;
margin-bottom:20px;
}
p{
font-size:1.8rem;
color:#b8e0ff;
text-shadow:008px#55aaff;
}
canvas{
position:absolute;
top:0;
left:0;
z-index:1;
}
</style>
</head>
<body>
<canvasid="fireCanvas"></canvas>
<divclass="text-box">
<h1>To.ShiLin:HAPPYBIRTHDAY!!!</h1>
<p>HAPPYBIRTHDAY</p>
</div>
<script>
constcanvas=document.getElementById("fireCanvas");
constctx=canvas.getContext("2d");
canvas.width=window.innerWidth;
canvas.height=window.innerHeight;
window.addEventListener('resize',()=>{
canvas.width=window.innerWidth;
canvas.height=window.innerHeight;
})
classParticle{
constructor(x,y,color){
this.x=x;
this.y=y;
this.speedX=(Math.random()-0.5)*6;
this.speedY=(Math.random()-0.5)*6;
this.alpha=1;
this.color=color;
this.size=Math.random()*3+1;
this.gravity=0.05;
}
update(){
this.x+=this.speedX;
this.y+=this.speedY;
this.speedY+=this.gravity;
this.alpha-=0.012;
}
draw(){
ctx.save();
ctx.globalAlpha=this.alpha;
ctx.fillStyle=this.color;
ctx.beginPath();
ctx.arc(this.x,this.y,this.size,0,Math.PI*2);
ct
【当前章节不完整】
【阅读完整章节请前往原站】
【ggd8.cc】
【退出畅读,阅读完整章节!】