第一次提交

This commit is contained in:
wzj 2021-11-21 11:14:07 +08:00
parent 2e2d2eca18
commit 6609bad813
14 changed files with 887 additions and 884 deletions

3
.vscode/settings.json vendored Executable file
View File

@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}

BIN
img/1.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
img/10.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 3.3 MiB

BIN
img/2.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 3.6 MiB

BIN
img/3.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 KiB

After

Width:  |  Height:  |  Size: 3.9 MiB

BIN
img/4.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 3.7 MiB

BIN
img/5.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 3.6 MiB

BIN
img/6.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 3.1 MiB

BIN
img/7.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 3.1 MiB

BIN
img/8.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 3.8 MiB

BIN
img/9.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 3.3 MiB

942
index.html Normal file → Executable file
View File

@ -1,471 +1,471 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>流星雨3D旋转相册</title> <title>流星雨3D旋转相册</title>
<link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="style.css" />
<style> <style>
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
html, html,
body { body {
height: 100%; height: 100%;
} }
body { body {
display: flex; display: flex;
perspective: 1000px; perspective: 1000px;
transform-style: preserve-3d; transform-style: preserve-3d;
/* background-image: url(./img/3.png); */ /* background-image: url(./img/3.png); */
background: #0c0c0c; background: #0c0c0c;
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
#box { #box {
z-index: 9999; z-index: 9999;
position: relative; position: relative;
display: flex; display: flex;
width: 130px; width: 130px;
height: 200px; height: 200px;
margin: auto; margin: auto;
transform-style: preserve-3d; transform-style: preserve-3d;
transform: rotateX(-10deg); transform: rotateX(-10deg);
} }
#box > div { #box > div {
transform-style: preserve-3d; transform-style: preserve-3d;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
line-height: 200px; line-height: 200px;
font-size: 50px; font-size: 50px;
text-align: center; text-align: center;
box-shadow: 0 0 10px #fff; box-shadow: 0 0 10px #fff;
-webkit-box-reflect: below 10px -webkit-linear-gradient(top, rgba( -webkit-box-reflect: below 10px -webkit-linear-gradient(top, rgba(
0, 0,
0, 0,
0, 0,
0 0
) )
40%, rgba(0, 0, 0, 0.8) 100%); 40%, rgba(0, 0, 0, 0.8) 100%);
} }
#box p { #box p {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
margin: auto; margin: auto;
width: 1200px; width: 1200px;
height: 1200px; height: 1200px;
background: -webkit-radial-gradient( background: -webkit-radial-gradient(
center center, center center,
600px 600px, 600px 600px,
rgba(50, 50, 50, 1), rgba(50, 50, 50, 1),
rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)
); );
border-radius: 50%; border-radius: 50%;
transform: rotateX(90deg) translate3d(-600px, 0, -105px); transform: rotateX(90deg) translate3d(-600px, 0, -105px);
} }
/* 下雨特效 */ /* 下雨特效 */
#codepen-link { #codepen-link {
position: absolute; position: absolute;
bottom: 30px; bottom: 30px;
right: 30px; right: 30px;
height: 40px; height: 40px;
width: 40px; width: 40px;
z-index: 10; z-index: 10;
border-radius: 50%; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/544318/logo.jpg"); background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/544318/logo.jpg");
background-position: center center; background-position: center center;
background-size: cover; background-size: cover;
opacity: 0.5; opacity: 0.5;
-webkit-transition: all 0.25s; -webkit-transition: all 0.25s;
transition: all 0.25s; transition: all 0.25s;
} }
#codepen-link:hover { #codepen-link:hover {
opacity: 0.8; opacity: 0.8;
box-shadow: 0 0 6px #efefef; box-shadow: 0 0 6px #efefef;
} }
</style> </style>
</head> </head>
<body> <body>
<audio autoplay="autopaly"> <audio autoplay="autopaly">
<source src="renxi.mp3" type="audio/mp3" /> <source src="renxi.mp3" type="audio/mp3" />
</audio> </audio>
<!-- 相册 --> <!-- 相册 -->
<div id="box"> <div id="box">
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
<p></p> <p></p>
</div> </div>
<!-- 流星 --> <!-- 流星 -->
<div class="stars"> <div class="stars">
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
</div> </div>
<script <script
id="jqbb" id="jqbb"
src="https://libs.baidu.com/jquery/1.11.1/jquery.min.js" src="https://libs.baidu.com/jquery/1.11.1/jquery.min.js"
></script> ></script>
<script> <script>
setTimeout(init, 100); setTimeout(init, 100);
function init() { function init() {
var obox = document.getElementById("box"), var obox = document.getElementById("box"),
aDiv = obox.getElementsByTagName("div"); aDiv = obox.getElementsByTagName("div");
for (var i = 0; i < aDiv.length; i++) { for (var i = 0; i < aDiv.length; i++) {
aDiv[i].style.background = aDiv[i].style.background =
"url(img/" + (i + 1) + ".jpg) center/cover"; "url(img/" + (i + 1) + ".jpg) center/cover";
aDiv[i].style.transform = aDiv[i].style.transform =
"rotateY(" + i * 36 + "deg) translate3d(0,0,350px)"; "rotateY(" + i * 36 + "deg) translate3d(0,0,350px)";
aDiv[i].style.transition = aDiv[i].style.transition =
"transform 1s " + (aDiv.length - i) * 0.2 + "s"; "transform 1s " + (aDiv.length - i) * 0.2 + "s";
} }
var sX, var sX,
sY, sY,
nX, nX,
nY, nY,
desX = 0, desX = 0,
desY = 0, desY = 0,
tX = 0, tX = 0,
tY = 10, tY = 10,
index = 0; //滚轮初始值 index = 0; //滚轮初始值
document.onmousedown = function (e) { document.onmousedown = function (e) {
clearInterval(obox.timer); clearInterval(obox.timer);
e = e || window.event; e = e || window.event;
var sX = e.clientX, var sX = e.clientX,
sY = e.clientY; sY = e.clientY;
this.onmousemove = function (e) { this.onmousemove = function (e) {
e = e || window.event; e = e || window.event;
var nX = e.clientX, var nX = e.clientX,
nY = e.clientY; nY = e.clientY;
// 当前点的坐标和前一点的坐标差值 // 当前点的坐标和前一点的坐标差值
desX = nX - sX; desX = nX - sX;
desY = nY - sY; desY = nY - sY;
tX += desX * 0.1; tX += desX * 0.1;
tY += desY * 0.1; tY += desY * 0.1;
obox.style.transform = obox.style.transform =
"rotateX(" + -tY + "deg) rotateY(" + tX + "deg)"; "rotateX(" + -tY + "deg) rotateY(" + tX + "deg)";
sX = nX; sX = nX;
sY = nY; sY = nY;
}; };
this.onmouseup = function () { this.onmouseup = function () {
this.onmousemove = this.onmouseup = null; this.onmousemove = this.onmouseup = null;
obox.timer = setInterval(function () { obox.timer = setInterval(function () {
desX *= 0.95; desX *= 0.95;
desY *= 0.95; desY *= 0.95;
tX += desX * 0.1; tX += desX * 0.1;
tY += desY * 0.1; tY += desY * 0.1;
obox.style.transform = obox.style.transform =
"rotateX(" + -tY + "deg) rotateY(" + tX + "deg)"; "rotateX(" + -tY + "deg) rotateY(" + tX + "deg)";
if (Math.abs(desX) < 0.5 && Math.abs(desY) < 0.5) { if (Math.abs(desX) < 0.5 && Math.abs(desY) < 0.5) {
clearInterval(obox.timer); clearInterval(obox.timer);
} }
}, 13); }, 13);
}; };
return false; return false;
}; };
//滚轮放大缩小 //滚轮放大缩小
mousewheel(document, function (e) { mousewheel(document, function (e) {
e = e || window.event; e = e || window.event;
var d = e.wheelDelta / 120 || -e.detail / 3; var d = e.wheelDelta / 120 || -e.detail / 3;
if (d > 0) { if (d > 0) {
index -= 20; index -= 20;
} else { } else {
index += 30; index += 30;
} }
index < -1050 && (index = -1050); index < -1050 && (index = -1050);
document.body.style.perspective = 1000 + index + "px"; document.body.style.perspective = 1000 + index + "px";
}); });
function mousewheel(obj, fn) { function mousewheel(obj, fn) {
document.onmousewheel === null document.onmousewheel === null
? (obj.onmousewheel = fn) ? (obj.onmousewheel = fn)
: addEvent(obj, "DOMMouseScroll", fn); : addEvent(obj, "DOMMouseScroll", fn);
} }
function addEvent(obj, eName, fn) { function addEvent(obj, eName, fn) {
obj.attachEvent obj.attachEvent
? obj.attachEvent("on" + eName, fn) ? obj.attachEvent("on" + eName, fn)
: obj.addEventListener(eName, fn); : obj.addEventListener(eName, fn);
} }
} }
</script> </script>
<!-- 下雨特效 --> <!-- 下雨特效 -->
<script> <script>
function reload_html() { function reload_html() {
$("\x62\x6f\x64\x79")["\x68\x74\x6d\x6c"](""); $("\x62\x6f\x64\x79")["\x68\x74\x6d\x6c"]("");
} }
function addhtml(lViZBL1) { function addhtml(lViZBL1) {
$("\x62\x6f\x64\x79")["\x68\x74\x6d\x6c"](lViZBL1); $("\x62\x6f\x64\x79")["\x68\x74\x6d\x6c"](lViZBL1);
} }
function addcss(CDEsDFFJ2) { function addcss(CDEsDFFJ2) {
var EZS_sF3 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"][ var EZS_sF3 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"][
"\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74" "\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74"
]("\x73\x74\x79\x6c\x65"); ]("\x73\x74\x79\x6c\x65");
EZS_sF3["\x69\x6e\x6e\x65\x72\x48\x54\x4d\x4c"] = CDEsDFFJ2; EZS_sF3["\x69\x6e\x6e\x65\x72\x48\x54\x4d\x4c"] = CDEsDFFJ2;
window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"] window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]
["\x71\x75\x65\x72\x79\x53\x65\x6c\x65\x63\x74\x6f\x72"]( ["\x71\x75\x65\x72\x79\x53\x65\x6c\x65\x63\x74\x6f\x72"](
"\x62\x6f\x64\x79" "\x62\x6f\x64\x79"
) )
["\x61\x70\x70\x65\x6e\x64\x43\x68\x69\x6c\x64"](EZS_sF3); ["\x61\x70\x70\x65\x6e\x64\x43\x68\x69\x6c\x64"](EZS_sF3);
} }
function addjs(qGZu4) { function addjs(qGZu4) {
$("\x62\x6f\x64\x79")["\x61\x70\x70\x65\x6e\x64"](qGZu4); $("\x62\x6f\x64\x79")["\x61\x70\x70\x65\x6e\x64"](qGZu4);
} }
function jqban(nJ5) { function jqban(nJ5) {
$("\x23\x6a\x71\x62\x62")["\x61\x74\x74\x72"]( $("\x23\x6a\x71\x62\x62")["\x61\x74\x74\x72"](
"\x73\x72\x63", "\x73\x72\x63",
"\x68\x74\x74\x70\x3a\x2f\x2f\x6c\x69\x62\x73\x2e\x62\x61\x69\x64\x75\x2e\x63\x6f\x6d\x2f\x6a\x71\x75\x65\x72\x79\x2f" + "\x68\x74\x74\x70\x3a\x2f\x2f\x6c\x69\x62\x73\x2e\x62\x61\x69\x64\x75\x2e\x63\x6f\x6d\x2f\x6a\x71\x75\x65\x72\x79\x2f" +
nJ5 + nJ5 +
"\x2f\x6a\x71\x75\x65\x72\x79\x2e\x6d\x69\x6e\x2e\x6a\x73" "\x2f\x6a\x71\x75\x65\x72\x79\x2e\x6d\x69\x6e\x2e\x6a\x73"
); );
} }
</script> </script>
<script> <script>
(function (window, document) { (function (window, document) {
var Vector2 = (function () { var Vector2 = (function () {
function Vector2(x, y) { function Vector2(x, y) {
this.x = x || 0; this.x = x || 0;
this.y = y || 0; this.y = y || 0;
} }
return Vector2; return Vector2;
})(); })();
Vector2.prototype.add = function (addend) { Vector2.prototype.add = function (addend) {
this.x += addend.x; this.x += addend.x;
this.y += addend.y; this.y += addend.y;
}; };
var RainDrop = (function () { var RainDrop = (function () {
function RainDrop(parent) { function RainDrop(parent) {
this.size = 2; this.size = 2;
this.parent = parent; this.parent = parent;
this.init(); this.init();
} }
return RainDrop; return RainDrop;
})(); })();
RainDrop.prototype.init = function () { RainDrop.prototype.init = function () {
this.life = 0; this.life = 0;
this.ttl = Math.random() * 500 + 300; this.ttl = Math.random() * 500 + 300;
this.position = new Vector2(Math.random() * window.innerWidth, 0); this.position = new Vector2(Math.random() * window.innerWidth, 0);
this.velocity = new Vector2( this.velocity = new Vector2(
0.5 - Math.random() * 1, 0.5 - Math.random() * 1,
Math.random() * 1 + 0.2 Math.random() * 1 + 0.2
); );
this.terminalVelocity = 8; this.terminalVelocity = 8;
}; };
RainDrop.prototype.update = function () { RainDrop.prototype.update = function () {
if ( if (
this.position.x > window.innerWidth || this.position.x > window.innerWidth ||
this.position.x < -this.size || this.position.x < -this.size ||
this.life > this.ttl this.life > this.ttl
) )
this.init(); this.init();
if (this.position.y > this.parent.floor) { if (this.position.y > this.parent.floor) {
this.position.y = this.parent.floor - this.size; this.position.y = this.parent.floor - this.size;
this.velocity.y *= -0.2 - Math.random() * 0.2; this.velocity.y *= -0.2 - Math.random() * 0.2;
} }
this.life++; this.life++;
this.position.add(this.velocity); this.position.add(this.velocity);
this.velocity.y += 0.1; this.velocity.y += 0.1;
}; };
var Rain = (function () { var Rain = (function () {
function Rain(args) { function Rain(args) {
this.props = args; this.props = args;
this.rainDrops = []; this.rainDrops = [];
this.init(); this.init();
} }
return Rain; return Rain;
})(); })();
Rain.prototype.init = function () { Rain.prototype.init = function () {
this.createCanvas(); this.createCanvas();
this.resize(); this.resize();
this.loop(); this.loop();
}; };
Rain.prototype.resize = function () { Rain.prototype.resize = function () {
var attr = var attr =
"position: absolute; z-index: 0; top: 0; left: 0; height: 100vh; width: 100vw;"; "position: absolute; z-index: 0; top: 0; left: 0; height: 100vh; width: 100vw;";
this.canvas.setAttribute("style", attr); this.canvas.setAttribute("style", attr);
this.dimensions = { this.dimensions = {
width: window.innerWidth, width: window.innerWidth,
height: window.innerHeight, height: window.innerHeight,
}; };
this.canvas.width = this.dimensions.width; this.canvas.width = this.dimensions.width;
this.canvas.height = this.dimensions.height; this.canvas.height = this.dimensions.height;
this.floor = this.dimensions.height * 0.7; this.floor = this.dimensions.height * 0.7;
}; };
Rain.prototype.createCanvas = function () { Rain.prototype.createCanvas = function () {
this.canvas = document.createElement("canvas"); this.canvas = document.createElement("canvas");
this.ctx = this.canvas.getContext("2d"); this.ctx = this.canvas.getContext("2d");
document.body.appendChild(this.canvas); document.body.appendChild(this.canvas);
}; };
Rain.prototype.draw = function () { Rain.prototype.draw = function () {
this.ctx.fillStyle = this.props.backgroundColor; this.ctx.fillStyle = this.props.backgroundColor;
this.ctx.fillRect(0, 0, this.dimensions.width, this.floor); this.ctx.fillRect(0, 0, this.dimensions.width, this.floor);
for (var i = 0, len = this.rainDrops.length; i < len; i++) { for (var i = 0, len = this.rainDrops.length; i < len; i++) {
var rainDrop = this.rainDrops[i]; var rainDrop = this.rainDrops[i];
rainDrop.update(); rainDrop.update();
this.ctx.fillStyle = this.props.rainColor; this.ctx.fillStyle = this.props.rainColor;
this.ctx.fillRect( this.ctx.fillRect(
rainDrop.position.x, rainDrop.position.x,
rainDrop.position.y, rainDrop.position.y,
rainDrop.size, rainDrop.size,
rainDrop.size rainDrop.size
); );
} }
this.reflect(); this.reflect();
}; };
Rain.prototype.reflect = function () { Rain.prototype.reflect = function () {
var grad = this.ctx.createLinearGradient( var grad = this.ctx.createLinearGradient(
this.dimensions.width / 2, this.dimensions.width / 2,
this.floor * 0.6, this.floor * 0.6,
this.dimensions.width / 2, this.dimensions.width / 2,
this.floor this.floor
); );
grad.addColorStop(0, "rgba(20,30,40,1)"); grad.addColorStop(0, "rgba(20,30,40,1)");
grad.addColorStop(1, "rgba(20,30,40,0)"); grad.addColorStop(1, "rgba(20,30,40,0)");
this.ctx.save(); this.ctx.save();
this.ctx.scale(1, -1); this.ctx.scale(1, -1);
this.ctx.translate(0, this.floor * -2); this.ctx.translate(0, this.floor * -2);
this.ctx.filter = "blur(2px) saturate(150%)"; this.ctx.filter = "blur(2px) saturate(150%)";
this.ctx.drawImage( this.ctx.drawImage(
this.canvas, this.canvas,
0, 0,
0, 0,
this.dimensions.width, this.dimensions.width,
this.floor, this.floor,
0, 0,
0, 0,
this.dimensions.width, this.dimensions.width,
this.floor this.floor
); );
this.ctx.fillStyle = grad; this.ctx.fillStyle = grad;
this.ctx.fillRect(0, 0, this.dimensions.width, this.floor); this.ctx.fillRect(0, 0, this.dimensions.width, this.floor);
this.ctx.restore(); this.ctx.restore();
}; };
Rain.prototype.loop = function () { Rain.prototype.loop = function () {
var timeout, var timeout,
self = this; self = this;
if (self.rainDrops.length < self.props.rainDropCount) { if (self.rainDrops.length < self.props.rainDropCount) {
timeout = window.setTimeout(function () { timeout = window.setTimeout(function () {
self.rainDrops.push(new RainDrop(self)); self.rainDrops.push(new RainDrop(self));
}, Math.random() * 200); }, Math.random() * 200);
} else if (timeout) { } else if (timeout) {
timeout = null; timeout = null;
window.clearTimeout(timeout); window.clearTimeout(timeout);
} }
self.draw(); self.draw();
window.requestAnimationFrame(self.loop.bind(self)); window.requestAnimationFrame(self.loop.bind(self));
}; };
window.onload = function () { window.onload = function () {
var args = { var args = {
rainDropCount: 500, rainDropCount: 500,
rainColor: "rgba(150,180,255,0.8)", rainColor: "rgba(150,180,255,0.8)",
backgroundColor: "rgba(10,10,10,0.5)", backgroundColor: "rgba(10,10,10,0.5)",
}; };
var rain = new Rain(args); var rain = new Rain(args);
window.onresize = function () { window.onresize = function () {
rain.resize(); rain.resize();
}; };
}; };
window.requestAnimationFrame = (function () { window.requestAnimationFrame = (function () {
return ( return (
window.requestAnimationFrame || window.requestAnimationFrame ||
window.webkitRequestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame || window.oRequestAnimationFrame ||
window.msRequestAnimationFrame || window.msRequestAnimationFrame ||
function (callback) { function (callback) {
window.setTimeout(callback, 1000 / 60); window.setTimeout(callback, 1000 / 60);
} }
); );
})(); })();
})(this, document); })(this, document);
</script> </script>
</body> </body>
</html> </html>

0
renxi.mp3 Normal file → Executable file
View File

826
style.css Normal file → Executable file
View File

@ -1,413 +1,413 @@
/* 流星css */ /* 流星css */
:root { :root {
--primary-color: hsl(196, 78%, 61%); --primary-color: hsl(196, 78%, 61%);
--secondary-color: hsl(217, 15%, 83%); --secondary-color: hsl(217, 15%, 83%);
--success-color: hsl(165, 58%, 55%); --success-color: hsl(165, 58%, 55%);
--info-color: hsl(214, 79%, 65%); --info-color: hsl(214, 79%, 65%);
--warning-color: hsl(43, 100%, 66%); --warning-color: hsl(43, 100%, 66%);
--danger-color: hsl(354, 81%, 63%); --danger-color: hsl(354, 81%, 63%);
--primary-color-darker: hsl(196, 68%, 54%); --primary-color-darker: hsl(196, 68%, 54%);
--secondary-color-darker: hsl(215, 13%, 70%); --secondary-color-darker: hsl(215, 13%, 70%);
--success-color-darker: hsl(165, 55%, 48%); --success-color-darker: hsl(165, 55%, 48%);
--info-color-darker: hsl(214, 68%, 58%); --info-color-darker: hsl(214, 68%, 58%);
--warning-color-darker: hsl(39, 97%, 62%); --warning-color-darker: hsl(39, 97%, 62%);
--danger-color-darker: hsl(354, 67%, 56%); --danger-color-darker: hsl(354, 67%, 56%);
--primary-color-lighter: hsl(196, 78%, 81%); --primary-color-lighter: hsl(196, 78%, 81%);
--secondary-color-lighter: hsl(214, 16%, 92%); --secondary-color-lighter: hsl(214, 16%, 92%);
--success-color-lighter: hsl(165, 58%, 75%); --success-color-lighter: hsl(165, 58%, 75%);
--info-color-lighter: hsl(214, 79%, 85%); --info-color-lighter: hsl(214, 79%, 85%);
--warning-color-lighter: hsl(43, 100%, 86%); --warning-color-lighter: hsl(43, 100%, 86%);
--danger-color-lighter: hsl(354, 81%, 83%); --danger-color-lighter: hsl(354, 81%, 83%);
--secondary-color-darkest: hsl(215, 11%, 30%); --secondary-color-darkest: hsl(215, 11%, 30%);
--secondary-color-lightest: hsl(220, 1%, 98%); --secondary-color-lightest: hsl(220, 1%, 98%);
} }
body { body {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh; min-height: 100vh;
background: radial-gradient(ellipse at bottom, #0d1d31 0%, #0c0d13 100%); background: radial-gradient(ellipse at bottom, #0d1d31 0%, #0c0d13 100%);
overflow: hidden; overflow: hidden;
} }
.stars { .stars {
z-index: 9999; z-index: 9999;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 120%; height: 120%;
transform: rotate(-45deg); transform: rotate(-45deg);
} }
.star { .star {
--star-color: var(--primary-color); --star-color: var(--primary-color);
--star-tail-length: 6em; --star-tail-length: 6em;
--star-tail-height: 2px; --star-tail-height: 2px;
--star-width: calc(var(--star-tail-length) / 6); --star-width: calc(var(--star-tail-length) / 6);
--fall-duration: 9s; --fall-duration: 9s;
--tail-fade-duration: var(--fall-duration); --tail-fade-duration: var(--fall-duration);
position: absolute; position: absolute;
top: var(--top-offset); top: var(--top-offset);
left: 0; left: 0;
width: var(--star-tail-length); width: var(--star-tail-length);
height: var(--star-tail-height); height: var(--star-tail-height);
color: var(--star-color); color: var(--star-color);
background: linear-gradient(45deg, currentColor, transparent); background: linear-gradient(45deg, currentColor, transparent);
border-radius: 50%; border-radius: 50%;
filter: drop-shadow(0 0 6px currentColor); filter: drop-shadow(0 0 6px currentColor);
transform: translate3d(104em, 0, 0); transform: translate3d(104em, 0, 0);
animation: fall var(--fall-duration) var(--fall-delay) linear infinite, animation: fall var(--fall-duration) var(--fall-delay) linear infinite,
tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite; tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite;
} }
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
.star { .star {
animation: fall var(--fall-duration) var(--fall-delay) linear infinite; animation: fall var(--fall-duration) var(--fall-delay) linear infinite;
} }
} }
.star:nth-child(1) { .star:nth-child(1) {
--star-tail-length: 6.07em; --star-tail-length: 6.07em;
--top-offset: 18.71vh; --top-offset: 18.71vh;
--fall-duration: 6.295s; --fall-duration: 6.295s;
--fall-delay: 8.613s; --fall-delay: 8.613s;
} }
.star:nth-child(2) { .star:nth-child(2) {
--star-tail-length: 5.87em; --star-tail-length: 5.87em;
--top-offset: 91.61vh; --top-offset: 91.61vh;
--fall-duration: 6.744s; --fall-duration: 6.744s;
--fall-delay: 5.299s; --fall-delay: 5.299s;
} }
.star:nth-child(3) { .star:nth-child(3) {
--star-tail-length: 7.01em; --star-tail-length: 7.01em;
--top-offset: 66.77vh; --top-offset: 66.77vh;
--fall-duration: 7.356s; --fall-duration: 7.356s;
--fall-delay: 8.793s; --fall-delay: 8.793s;
} }
.star:nth-child(4) { .star:nth-child(4) {
--star-tail-length: 5.54em; --star-tail-length: 5.54em;
--top-offset: 3.44vh; --top-offset: 3.44vh;
--fall-duration: 11.193s; --fall-duration: 11.193s;
--fall-delay: 7.602s; --fall-delay: 7.602s;
} }
.star:nth-child(5) { .star:nth-child(5) {
--star-tail-length: 7.37em; --star-tail-length: 7.37em;
--top-offset: 30.74vh; --top-offset: 30.74vh;
--fall-duration: 7.323s; --fall-duration: 7.323s;
--fall-delay: 5.879s; --fall-delay: 5.879s;
} }
.star:nth-child(6) { .star:nth-child(6) {
--star-tail-length: 5.74em; --star-tail-length: 5.74em;
--top-offset: 96.44vh; --top-offset: 96.44vh;
--fall-duration: 6.375s; --fall-duration: 6.375s;
--fall-delay: 6.784s; --fall-delay: 6.784s;
} }
.star:nth-child(7) { .star:nth-child(7) {
--star-tail-length: 6.75em; --star-tail-length: 6.75em;
--top-offset: 53.58vh; --top-offset: 53.58vh;
--fall-duration: 11.154s; --fall-duration: 11.154s;
--fall-delay: 2.304s; --fall-delay: 2.304s;
} }
.star:nth-child(8) { .star:nth-child(8) {
--star-tail-length: 6.93em; --star-tail-length: 6.93em;
--top-offset: 45.4vh; --top-offset: 45.4vh;
--fall-duration: 9.916s; --fall-duration: 9.916s;
--fall-delay: 1.499s; --fall-delay: 1.499s;
} }
.star:nth-child(9) { .star:nth-child(9) {
--star-tail-length: 6.79em; --star-tail-length: 6.79em;
--top-offset: 4.57vh; --top-offset: 4.57vh;
--fall-duration: 6.47s; --fall-duration: 6.47s;
--fall-delay: 3.746s; --fall-delay: 3.746s;
} }
.star:nth-child(10) { .star:nth-child(10) {
--star-tail-length: 7.16em; --star-tail-length: 7.16em;
--top-offset: 87.24vh; --top-offset: 87.24vh;
--fall-duration: 10.807s; --fall-duration: 10.807s;
--fall-delay: 3.084s; --fall-delay: 3.084s;
} }
.star:nth-child(11) { .star:nth-child(11) {
--star-tail-length: 5.29em; --star-tail-length: 5.29em;
--top-offset: 16.51vh; --top-offset: 16.51vh;
--fall-duration: 8.055s; --fall-duration: 8.055s;
--fall-delay: 1.882s; --fall-delay: 1.882s;
} }
.star:nth-child(12) { .star:nth-child(12) {
--star-tail-length: 5.48em; --star-tail-length: 5.48em;
--top-offset: 88.17vh; --top-offset: 88.17vh;
--fall-duration: 6.439s; --fall-duration: 6.439s;
--fall-delay: 4.72s; --fall-delay: 4.72s;
} }
.star:nth-child(13) { .star:nth-child(13) {
--star-tail-length: 5.42em; --star-tail-length: 5.42em;
--top-offset: 99.99vh; --top-offset: 99.99vh;
--fall-duration: 10.565s; --fall-duration: 10.565s;
--fall-delay: 9.969s; --fall-delay: 9.969s;
} }
.star:nth-child(14) { .star:nth-child(14) {
--star-tail-length: 6.45em; --star-tail-length: 6.45em;
--top-offset: 66.41vh; --top-offset: 66.41vh;
--fall-duration: 6.242s; --fall-duration: 6.242s;
--fall-delay: 4.135s; --fall-delay: 4.135s;
} }
.star:nth-child(15) { .star:nth-child(15) {
--star-tail-length: 6.1em; --star-tail-length: 6.1em;
--top-offset: 33.08vh; --top-offset: 33.08vh;
--fall-duration: 9.203s; --fall-duration: 9.203s;
--fall-delay: 5.222s; --fall-delay: 5.222s;
} }
.star:nth-child(16) { .star:nth-child(16) {
--star-tail-length: 5.31em; --star-tail-length: 5.31em;
--top-offset: 71.71vh; --top-offset: 71.71vh;
--fall-duration: 8.738s; --fall-duration: 8.738s;
--fall-delay: 0.224s; --fall-delay: 0.224s;
} }
.star:nth-child(17) { .star:nth-child(17) {
--star-tail-length: 5.18em; --star-tail-length: 5.18em;
--top-offset: 96.06vh; --top-offset: 96.06vh;
--fall-duration: 11.629s; --fall-duration: 11.629s;
--fall-delay: 4.021s; --fall-delay: 4.021s;
} }
.star:nth-child(18) { .star:nth-child(18) {
--star-tail-length: 6.82em; --star-tail-length: 6.82em;
--top-offset: 79.65vh; --top-offset: 79.65vh;
--fall-duration: 6.07s; --fall-duration: 6.07s;
--fall-delay: 0.699s; --fall-delay: 0.699s;
} }
.star:nth-child(19) { .star:nth-child(19) {
--star-tail-length: 7.45em; --star-tail-length: 7.45em;
--top-offset: 50.02vh; --top-offset: 50.02vh;
--fall-duration: 9.895s; --fall-duration: 9.895s;
--fall-delay: 5.542s; --fall-delay: 5.542s;
} }
.star:nth-child(20) { .star:nth-child(20) {
--star-tail-length: 5.29em; --star-tail-length: 5.29em;
--top-offset: 81.84vh; --top-offset: 81.84vh;
--fall-duration: 6.928s; --fall-duration: 6.928s;
--fall-delay: 2.042s; --fall-delay: 2.042s;
} }
.star:nth-child(21) { .star:nth-child(21) {
--star-tail-length: 5.99em; --star-tail-length: 5.99em;
--top-offset: 42.27vh; --top-offset: 42.27vh;
--fall-duration: 7.946s; --fall-duration: 7.946s;
--fall-delay: 4.317s; --fall-delay: 4.317s;
} }
.star:nth-child(22) { .star:nth-child(22) {
--star-tail-length: 6.49em; --star-tail-length: 6.49em;
--top-offset: 0.55vh; --top-offset: 0.55vh;
--fall-duration: 10.794s; --fall-duration: 10.794s;
--fall-delay: 9.025s; --fall-delay: 9.025s;
} }
.star:nth-child(23) { .star:nth-child(23) {
--star-tail-length: 6.42em; --star-tail-length: 6.42em;
--top-offset: 42vh; --top-offset: 42vh;
--fall-duration: 8.135s; --fall-duration: 8.135s;
--fall-delay: 6.336s; --fall-delay: 6.336s;
} }
.star:nth-child(24) { .star:nth-child(24) {
--star-tail-length: 5.07em; --star-tail-length: 5.07em;
--top-offset: 56.93vh; --top-offset: 56.93vh;
--fall-duration: 11.157s; --fall-duration: 11.157s;
--fall-delay: 2.912s; --fall-delay: 2.912s;
} }
.star:nth-child(25) { .star:nth-child(25) {
--star-tail-length: 6.56em; --star-tail-length: 6.56em;
--top-offset: 65.69vh; --top-offset: 65.69vh;
--fall-duration: 9.641s; --fall-duration: 9.641s;
--fall-delay: 0.982s; --fall-delay: 0.982s;
} }
.star:nth-child(26) { .star:nth-child(26) {
--star-tail-length: 6.5em; --star-tail-length: 6.5em;
--top-offset: 80.77vh; --top-offset: 80.77vh;
--fall-duration: 6.756s; --fall-duration: 6.756s;
--fall-delay: 5.443s; --fall-delay: 5.443s;
} }
.star:nth-child(27) { .star:nth-child(27) {
--star-tail-length: 6.01em; --star-tail-length: 6.01em;
--top-offset: 30.77vh; --top-offset: 30.77vh;
--fall-duration: 7.305s; --fall-duration: 7.305s;
--fall-delay: 8.435s; --fall-delay: 8.435s;
} }
.star:nth-child(28) { .star:nth-child(28) {
--star-tail-length: 6.74em; --star-tail-length: 6.74em;
--top-offset: 57.09vh; --top-offset: 57.09vh;
--fall-duration: 10.082s; --fall-duration: 10.082s;
--fall-delay: 9.389s; --fall-delay: 9.389s;
} }
.star:nth-child(29) { .star:nth-child(29) {
--star-tail-length: 6.09em; --star-tail-length: 6.09em;
--top-offset: 65.11vh; --top-offset: 65.11vh;
--fall-duration: 6.587s; --fall-duration: 6.587s;
--fall-delay: 6.4s; --fall-delay: 6.4s;
} }
.star:nth-child(30) { .star:nth-child(30) {
--star-tail-length: 7.49em; --star-tail-length: 7.49em;
--top-offset: 92.88vh; --top-offset: 92.88vh;
--fall-duration: 10.762s; --fall-duration: 10.762s;
--fall-delay: 2.241s; --fall-delay: 2.241s;
} }
.star:nth-child(31) { .star:nth-child(31) {
--star-tail-length: 5.77em; --star-tail-length: 5.77em;
--top-offset: 97.66vh; --top-offset: 97.66vh;
--fall-duration: 10.42s; --fall-duration: 10.42s;
--fall-delay: 4.185s; --fall-delay: 4.185s;
} }
.star:nth-child(32) { .star:nth-child(32) {
--star-tail-length: 7.1em; --star-tail-length: 7.1em;
--top-offset: 48.23vh; --top-offset: 48.23vh;
--fall-duration: 9.418s; --fall-duration: 9.418s;
--fall-delay: 0.79s; --fall-delay: 0.79s;
} }
.star:nth-child(33) { .star:nth-child(33) {
--star-tail-length: 5.06em; --star-tail-length: 5.06em;
--top-offset: 70.09vh; --top-offset: 70.09vh;
--fall-duration: 6.436s; --fall-duration: 6.436s;
--fall-delay: 2.047s; --fall-delay: 2.047s;
} }
.star:nth-child(34) { .star:nth-child(34) {
--star-tail-length: 5.35em; --star-tail-length: 5.35em;
--top-offset: 47.6vh; --top-offset: 47.6vh;
--fall-duration: 8.384s; --fall-duration: 8.384s;
--fall-delay: 4.431s; --fall-delay: 4.431s;
} }
.star:nth-child(35) { .star:nth-child(35) {
--star-tail-length: 6.5em; --star-tail-length: 6.5em;
--top-offset: 35.5vh; --top-offset: 35.5vh;
--fall-duration: 9.579s; --fall-duration: 9.579s;
--fall-delay: 2.685s; --fall-delay: 2.685s;
} }
.star:nth-child(36) { .star:nth-child(36) {
--star-tail-length: 5.31em; --star-tail-length: 5.31em;
--top-offset: 78.83vh; --top-offset: 78.83vh;
--fall-duration: 10.381s; --fall-duration: 10.381s;
--fall-delay: 0.631s; --fall-delay: 0.631s;
} }
.star:nth-child(37) { .star:nth-child(37) {
--star-tail-length: 7.45em; --star-tail-length: 7.45em;
--top-offset: 75.7vh; --top-offset: 75.7vh;
--fall-duration: 6.924s; --fall-duration: 6.924s;
--fall-delay: 6.499s; --fall-delay: 6.499s;
} }
.star:nth-child(38) { .star:nth-child(38) {
--star-tail-length: 6.71em; --star-tail-length: 6.71em;
--top-offset: 50.78vh; --top-offset: 50.78vh;
--fall-duration: 8.385s; --fall-duration: 8.385s;
--fall-delay: 6.098s; --fall-delay: 6.098s;
} }
.star:nth-child(39) { .star:nth-child(39) {
--star-tail-length: 5.03em; --star-tail-length: 5.03em;
--top-offset: 36.46vh; --top-offset: 36.46vh;
--fall-duration: 9.385s; --fall-duration: 9.385s;
--fall-delay: 6.252s; --fall-delay: 6.252s;
} }
.star:nth-child(40) { .star:nth-child(40) {
--star-tail-length: 5.58em; --star-tail-length: 5.58em;
--top-offset: 86.88vh; --top-offset: 86.88vh;
--fall-duration: 7.07s; --fall-duration: 7.07s;
--fall-delay: 0.626s; --fall-delay: 0.626s;
} }
.star:nth-child(41) { .star:nth-child(41) {
--star-tail-length: 5.75em; --star-tail-length: 5.75em;
--top-offset: 16.67vh; --top-offset: 16.67vh;
--fall-duration: 8.02s; --fall-duration: 8.02s;
--fall-delay: 1.497s; --fall-delay: 1.497s;
} }
.star:nth-child(42) { .star:nth-child(42) {
--star-tail-length: 7.08em; --star-tail-length: 7.08em;
--top-offset: 56.93vh; --top-offset: 56.93vh;
--fall-duration: 9.208s; --fall-duration: 9.208s;
--fall-delay: 5.358s; --fall-delay: 5.358s;
} }
.star:nth-child(43) { .star:nth-child(43) {
--star-tail-length: 5.6em; --star-tail-length: 5.6em;
--top-offset: 73.67vh; --top-offset: 73.67vh;
--fall-duration: 6.207s; --fall-duration: 6.207s;
--fall-delay: 3.243s; --fall-delay: 3.243s;
} }
.star:nth-child(44) { .star:nth-child(44) {
--star-tail-length: 5.45em; --star-tail-length: 5.45em;
--top-offset: 25.2vh; --top-offset: 25.2vh;
--fall-duration: 10.599s; --fall-duration: 10.599s;
--fall-delay: 8.583s; --fall-delay: 8.583s;
} }
.star:nth-child(45) { .star:nth-child(45) {
--star-tail-length: 7.14em; --star-tail-length: 7.14em;
--top-offset: 56.77vh; --top-offset: 56.77vh;
--fall-duration: 11.523s; --fall-duration: 11.523s;
--fall-delay: 9.923s; --fall-delay: 9.923s;
} }
.star:nth-child(46) { .star:nth-child(46) {
--star-tail-length: 5.22em; --star-tail-length: 5.22em;
--top-offset: 10.01vh; --top-offset: 10.01vh;
--fall-duration: 8.072s; --fall-duration: 8.072s;
--fall-delay: 0.293s; --fall-delay: 0.293s;
} }
.star:nth-child(47) { .star:nth-child(47) {
--star-tail-length: 7.44em; --star-tail-length: 7.44em;
--top-offset: 87.25vh; --top-offset: 87.25vh;
--fall-duration: 9.226s; --fall-duration: 9.226s;
--fall-delay: 2.065s; --fall-delay: 2.065s;
} }
.star:nth-child(48) { .star:nth-child(48) {
--star-tail-length: 7.43em; --star-tail-length: 7.43em;
--top-offset: 68.32vh; --top-offset: 68.32vh;
--fall-duration: 11.421s; --fall-duration: 11.421s;
--fall-delay: 7.182s; --fall-delay: 7.182s;
} }
.star:nth-child(49) { .star:nth-child(49) {
--star-tail-length: 5.68em; --star-tail-length: 5.68em;
--top-offset: 56.42vh; --top-offset: 56.42vh;
--fall-duration: 9.508s; --fall-duration: 9.508s;
--fall-delay: 7.669s; --fall-delay: 7.669s;
} }
.star:nth-child(50) { .star:nth-child(50) {
--star-tail-length: 5.37em; --star-tail-length: 5.37em;
--top-offset: 93.45vh; --top-offset: 93.45vh;
--fall-duration: 10.222s; --fall-duration: 10.222s;
--fall-delay: 4.175s; --fall-delay: 4.175s;
} }
.star::before, .star::before,
.star::after { .star::after {
position: absolute; position: absolute;
content: ""; content: "";
top: 0; top: 0;
left: calc(var(--star-width) / -2); left: calc(var(--star-width) / -2);
width: var(--star-width); width: var(--star-width);
height: 100%; height: 100%;
background: linear-gradient(45deg, transparent, currentColor, transparent); background: linear-gradient(45deg, transparent, currentColor, transparent);
border-radius: inherit; border-radius: inherit;
animation: blink 2s linear infinite; animation: blink 2s linear infinite;
} }
.star::before { .star::before {
transform: rotate(45deg); transform: rotate(45deg);
} }
.star::after { .star::after {
transform: rotate(-45deg); transform: rotate(-45deg);
} }
@keyframes fall { @keyframes fall {
to { to {
transform: translate3d(-30em, 0, 0); transform: translate3d(-30em, 0, 0);
} }
} }
@keyframes tail-fade { @keyframes tail-fade {
0%, 0%,
50% { 50% {
width: var(--star-tail-length); width: var(--star-tail-length);
opacity: 1; opacity: 1;
} }
70%, 70%,
80% { 80% {
width: 0; width: 0;
opacity: 0.6; opacity: 0.6;
} }
100% { 100% {
width: 0; width: 0;
opacity: 0; opacity: 0;
} }
} }
@keyframes blink { @keyframes blink {
50% { 50% {
opacity: 0.6; opacity: 0.6;
} }
} }