<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sorry Prachi 💌</title>
<style>
body {
margin: 0;
padding: 0;
background:
font-family: "Poppins", sans-serif;
overflow-x: hidden;
}
/* Falling Hearts */
.heart {
position: fixed;
top: -10px;
color:
font-size: 20px;
animation: fall 4s linear infinite;
opacity: 0.8;
}
@keyframes fall {
0% { transform: translateY(-10px); }
100% { transform: translateY(110vh); }
}
/* Envelope */
.envelope-container {
display: flex;
justify-content: center;
margin-top: 120px;
}
.envelope {
width: 300px;
height: 200px;
background:
position: relative;
cursor: pointer;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
transition: transform 0.3s;
}
.envelope:hover {
transform: scale(1.02);
}
.flap {
width: 0;
height: 0;
border-left: 150px solid transparent;
border-right: 150px solid transparent;
border-bottom: 120px solid
position: absolute;
top: -120px;
left: 0;
border-radius: 10px;
}
/* Letter */
.letter {
width: 280px;
height: 180px;
background: white;
position: absolute;
top: 10px;
left: 10px;
border-radius: 10px;
padding: 20px;
box-sizing: border-box;
text-align: center;
transform: translateY(120px);
transition: 0.6s;
box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.envelope.open .letter {
transform: translateY(-10px);
}
h2 {
color:
margin-bottom: 10px;
}
p {
color:
font-size: 15px;
line-height: 1.5;
}
</style>
</head>
<body>
<div id="hearts"></div>
<div class="envelope-container">
<div class="envelope" onclick="openLetter()">
<div class="flap"></div>
<div class="letter">
<h2>Dear Prachi ❤️</h2>
<p>
I'm really sorry…
I never meant to hurt you.
You matter to me more than you know.
Please forgive me? 💗
</p>
</div>
</div>
</div>
<script>
function openLetter() {
document.querySelector(".envelope").classList.toggle("open");
}
/* Random falling hearts */
function createHeart() {
const heart = document.createElement("div");
heart.classList.add("heart");
heart.innerHTML = "❤";
heart.style.left = Math.random() * window.innerWidth + "px";
heart.style.fontSize = (20 + Math.random() * 20) + "px";
heart.style.animationDuration = (3 + Math.random() * 3) + "s";
document.body.appendChild(heart);
setTimeout(() => {
heart.remove();
}, 6000);
}
setInterval(createHeart, 300);
</script>
</body>
</html>