console
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>无能</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{background:#111;overflow:hidden}
.note{
position:absolute;
width:110px;
height:70px;
border-radius:10px;
display:flex;
align-items:center;
justify-content:center;
font-size:14px;
font-weight:600;
padding:6px;
box-shadow:0 4px 14px rgba(255,105,135,0.35);
opacity:0;
transform:scale(0.6);
animation:popIn 0.35s ease forwards;
}
@keyframes popIn{
0%{opacity:0;transform:scale(0.4) rotate(-6deg)}
60%{opacity:1;transform:scale(1.08) rotate(2deg)}
100%{opacity:1;transform:scale(1) rotate(0deg)}
}
</style>
</head>
<body>
<script>
const textList = [
"我想你","嘻嘻","又梦到你了","好想见你","爱你三千遍",
"小k","心动啦","抱抱我","亲亲","一直喜欢你",
"今天也想你","晚安","早安","想见你","超喜欢你",
"你在干嘛","我陪你","别难过","有我在","甜甜",
"喜欢你呀","命中注定","只想见你","未来同行","爱心递给你",
"你好可爱","我好爱你","永远在一起","慢慢喜欢你","偷偷想你",
"是你呀","就现在","靠近一点","抱抱你","亲亲你",
"我愿意","陪着你","不离开","偏爱你","只对你心动",
"你是我的小幸运","每天都想你","你真的很好","我一直都在","想和你见面",
"把心给你","心动不止一次","你是例外","你是偏爱","你是我想要的结局"
];
const colorList = [
"#ffb6c1","#ffc0cb","#ff8da1","#ff6b81","#ffa6c9",
"#ffd1dc","#ff91a4","#f8bbd0","#f48fb1","#ec407a"
];
function createNote(x,y,text){
const div = document.createElement('div');
div.className = "note";
div.innerText = text;
div.style.background = colorList[Math.floor(Math.random()*colorList.length)];
div.style.left = x + "px";
div.style.top = y + "px";
document.body.appendChild(div);
}
function sleep(ms){
return new Promise(resolve=>setTimeout(resolve,ms));
}
(async function startAnimation(){
const cx = window.innerWidth / 2;
const cy = window.innerHeight / 2;
// 第一阶段:用带文字的卡片画爱心
for(let t = 0; t < 2 * Math.PI; t += 0.035){
const x = 16 * Math.pow(Math.sin(t), 3);
const y = 13 * Math.cos(t) - 5 * Math.cos(2*t) - 2 * Math.cos(3*t) - Math.cos(4*t);
const noteText = textList[Math.floor(Math.random()*textList.length)];
createNote(cx + x * 11, cy - y * 11, noteText);
await sleep(50);
}
// 第二阶段:保留爱心,继续密密麻麻铺满屏幕
for(let i = 0; i < 80; i++){
const maxX = Math.max(window.innerWidth - 120, 120);
const maxY = Math.max(window.innerHeight - 80, 80);
const x = Math.random() * maxX;
const y = Math.random() * maxY;
const text = textList[Math.floor(Math.random()*textList.length)];
createNote(x, y, text);
await sleep(200);
}
})();
</script>
</body>
</html>