最近看到这个还是比较火,来跟个风…
废话不多说,直接上代码
一、H5页面
<!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>
<meta name="keywords" content="复刻李峋爱心,李峋爱心代码,李峋同款爱心代码,爱心代码,李峋爱心代码,爱心">
<meta name="description" content="这可是李峋同款爱心代码~">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- 这里心形中间文字 -->
<p class="love_you">李峋爱心~</p>
<!-- 这里替换音乐 -->
<audio src="lovexf.mp3" autoplay="autoplay" loop="loop" controls="controls" hidden></audio>
<canvas id="lovexf"></canvas>
<script src="script.js"></script>
<script src="a5ec945e-dcee-4e49-ba1e-dc4025392692.js"></script>
</body>
</html>
二、CSS样式
* {
padding: 0;
margin: 0;
}
body {
background: url(https://oss.qiaoxiao.top/view.php/9d160de9ce3aa57a332f30e4dca718b2.webp) no-repeat center center;
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;
}
}
三、效果演示
四、代码下载
地址链接:https://qxqx.lanzoum.com/iTtoS0g8e84b
提取码:f8e7