DSA_Tutorials / index.html
Json026's picture
Update index.html
5e12356 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Surprise for Mummy</title>
<style>
/* --- CSS STYLES --- */
body {
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(180deg, #fff5f7 0%, #fce4ec 100%);
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
color: #4a4a4a;
}
header {
margin-top: 40px;
text-align: center;
}
h1 { color: #d81b60; font-weight: 300; }
/* Balloon Area */
.balloon-container {
display: flex;
gap: 20px;
margin: 50px 0;
flex-wrap: wrap;
justify-content: center;
}
.balloon {
width: 70px;
height: 90px;
border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
cursor: pointer;
transition: transform 0.2s ease-in-out;
box-shadow: inset -5px -5px 10px rgba(0,0,0,0.1);
animation: float 3s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-15px); }
}
.balloon:hover { transform: scale(1.2); }
/* Polaroid Popup Overlay */
.overlay {
display: none; /* Hidden by default */
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.7);
justify-content: center;
align-items: center;
z-index: 1000;
}
.polaroid {
background: white;
padding: 15px 15px 50px 15px;
box-shadow: 0 15px 30px rgba(0,0,0,0.3);
text-align: center;
max-width: 300px;
border-radius: 2px;
}
.polaroid img {
width: 100%;
height: 350px;
object-fit: cover; /* Keeps photo from stretching */
border: 1px solid #eee;
}
.caption {
margin-top: 20px;
font-size: 1.2rem;
font-family: 'Cursive', sans-serif;
color: #d81b60;
}
.close-btn {
margin-top: 20px;
padding: 8px 20px;
background: #d81b60;
color: white;
border: none;
border-radius: 20px;
cursor: pointer;
}
</style>
</head>
<body>
<header>
<h1>Pop a Balloon, Mummy! 🎈</h1>
<p>Each one has a special memory inside.</p>
</header>
<div class="balloon-container">
<div class="balloon" style="background-color: #ff80ab;" onclick="openSurprise(0)"></div>
<div class="balloon" style="background-color: #ba68c8;" onclick="openSurprise(1)"></div>
<div class="balloon" style="background-color: #4fc3f7;" onclick="openSurprise(2)"></div>
</div>
<div class="overlay" id="overlay">
<div class="polaroid">
<img id="display-image" src="" alt="Memory">
<div class="caption" id="display-caption"></div>
<button class="close-btn" onclick="closeSurprise()">Close</button>
</div>
</div>
<script>
/* --- CONFIGURATION --- */
// Change the links below to your own photos!
const myMemories = [
{
image: "YOUR_IMAGE_URL_HERE_1.jpg",
text: "The prettiest woman I know! ✨"
},
{
image: "YOUR_IMAGE_URL_HERE_2.jpg",
text: "Always by my side. ❤️"
},
{
image: "YOUR_IMAGE_URL_HERE_3.jpg",
text: "Growing up to be just like you. 🌸"
}
];
function openSurprise(index) {
const data = myMemories[index];
document.getElementById('display-image').src = data.image;
document.getElementById('display-caption').innerText = data.text;
document.getElementById('overlay').style.display = 'flex';
}
function closeSurprise() {
document.getElementById('overlay').style.display = 'none';
}
</script>
</body>
</html>