<!--
* @Author: 柒刻
* @Date: 2022-11-08 11:24:53
* @LastEditTime: 2022-11-08 16:16:24
* @FilePath: \love-code-master\index.html
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> 柒刻 爱心代码</title>
<link rel="shortcut icon" href="https://s10.aconvert.com/convert/p3r68-cdx67/a5fmg-k3nhq-001.ico" type="image/x-icon">
<!-- <link rel="stylesheet" href="style.css"> -->
<style>
* {
padding: 0;
margin: 0;
}
body {
background: #000;
background-size: cover;
height: 100vh;
}
body::after {
content: '';
display: block;
position: absolute;
width: 100%;
height: 100vh;
-webkit-background-color: rgba(0, 0, 0, .5);
background-color: rgba(0, 0, 0, .5);
}
audio,
.love_you {
position: absolute;
left: 50%;
top: 1.5rem;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
z-index: 1809185784;
}
.love_you {
top: 45%;
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 1.3rem;
font-weight: bold;
color: #ffc0cb;
letter-spacing: .05rem;
-moz-animation: love-xf 1.2s alternate ease-in-out;
-webkit-animation: love-xf 1.2s alternate ease-in-out;
animation: love-xf 1.2s alternate ease-in-out;
user-select: none;
-webkit-text-shadow: 0 0 8px #fff;
text-shadow: 0 0 8px #fff;
}
#lovexf {
position: absolute;
width: 100%;
height: 100%;
z-index: 520;
}
@keyframes love-xf {
0% {
opacity: 0.08;
filter: blur(8px);
letter-spacing: .1rem;
}
100% {
opacity: 1;
filter: blur(0);
letter-spacing: .05rem;
}
}
</style>
</head>
<body>
<!-- 这里修改名字 -->
<p class="love_you">XXX</p>
<!-- 这里替换音乐 -->
<audio id="music" src="loveqk.mp3" autoplay loop="false" autostart></audio>
<canvas id="lovexf"></canvas>
<script>
//love
!function (e, t, a) {
function r() {
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px; top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform: scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index: 1809185784");
requestAnimationFrame(r)
}
function n() {
var t = "function" == typeof e.onclick && e.onclick;
e.onclick = function (e) {
t && t(),
o(e)
}
}
function o(e) {
var a = t.createElement("div");
a.className = "heart",
s.push({
el: a,
x: e.clientX - 5,
y: e.clientY - 5,
scale: 1,
alpha: 1,
color: c()
}),
t.body.appendChild(a)
}
function i(e) {
var a = t.createElement("style");
a.type = "text/css";
try {
a.appendChild(t.createTextNode(e))
} catch (t) {
a.styleSheet.cssText = e
}
t.getElementsByTagName("head")[0].appendChild(a)
}
function c() {
return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
}
var s = [];
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame ||
function (e) {
setTimeout(e, 1e3 / 60)
},
i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),
n(),
r()
}(window, document);
console.log('柒刻');
</script>
<script>
var settings = {
particles: {
length: 500, // maximum amount of particles
duration: 2, // particle duration in sec
velocity: 100, // particle velocity in pixels/sec
effect: -0.6, // play with this for a nice effect
size: 28, // particle size in pixels
},
};
(function () {
var b = 0; var c = ["ms", "moz", "webkit", "o"]; for (var a = 0; a < c.length && !window.requestAnimationFrame; ++a) { window.requestAnimationFrame = window[c[a] + "RequestAnimationFrame"]; window.cancelAnimationFrame = window[c[a] + "CancelAnimationFrame"] || window[c[a] + "CancelRequestAnimationFrame"] } if (!window.requestAnimationFrame) { window.requestAnimationFrame = function (h, e) { var d = new Date().getTime(); var f = Math.max(0, 16 - (d - b)); var g = window.setTimeout(function () { h(d + f) }, f); b = d + f; return g } } if (!window.cancelAnimationFrame) { window.cancelAnimationFrame = function (d) { clearTimeout(d) } }
}());
/*
* Point class
*/
var Point = (function () {
function Point(x, y) {
this.x = (typeof x !== 'undefined') ? x : 0;
this.y = (typeof y !== 'undefined') ? y : 0;
}
Point.prototype.clone = function () {
return new Point(this.x, this.y);
};
Point.prototype.length = function (length) {
if (typeof length == 'undefined')
return Math.sqrt(this.x * this.x + this.y * this.y);
this.normalize();
this.x *= length;
this.y *= length;
return this;
};
Point.prototype.normalize = function () {
var length = this.length();
this.x /= length;
this.y /= length;
return this;
};
return Point;
})();
/*
* Particle class
*/
var Particle = (function () {
function Particle() {
this.position = new Point();
this.velocity = new Point();
this.acceleration = new Point();
this.age = 0;
}
Particle.prototype.initialize = function (x, y, dx, dy) {
this.position.x = x;
this.position.y = y;
this.velocity.x = dx;
this.velocity.y = dy;
this.acceleration.x = dx * settings.particles.effect;
this.acceleration.y = dy * settings.particles.effect;
this.age = 0;
};
Particle.prototype.update = function (deltaTime) {
this.position.x += this.velocity.x * deltaTime;
this.position.y += this.velocity.y * deltaTime;
this.velocity.x += this.acceleration.x * deltaTime;
this.velocity.y += this.acceleration.y * deltaTime;
this.age += deltaTime;
};
Particle.prototype.draw = function (context, image) {
function ease(t) {
return (--t) * t * t +