| <!DOCTYPE html>
|
| <html lang="en">
|
| <head>
|
| <meta charset="UTF-8">
|
| <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| <title>Be My Valentine π</title>
|
|
|
|
|
| <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script>
|
|
|
| <style>
|
| *{
|
| box-sizing:border-box;
|
| margin:0;
|
| padding:0;
|
| }
|
|
|
| body{
|
| min-height:100vh;
|
| display:flex;
|
| align-items:center;
|
| justify-content:center;
|
| background:linear-gradient(-45deg,#ff9a9e,#fad0c4,#fbc2eb,#a18cd1);
|
| background-size:400% 400%;
|
| animation:bgMove 12s ease infinite;
|
| font-family:sans-serif;
|
| overflow:hidden;
|
| }
|
|
|
| @keyframes bgMove{
|
| 0%{background-position:0% 50%;}
|
| 50%{background-position:100% 50%;}
|
| 100%{background-position:0% 50%;}
|
| }
|
|
|
|
|
| .card{
|
| width:min(92%,420px);
|
| padding:40px 30px;
|
| background:rgba(255,255,255,0.8);
|
| border-radius:28px;
|
| text-align:center;
|
| box-shadow:0 30px 80px rgba(0,0,0,0.25);
|
| transition:0.6s ease;
|
| }
|
|
|
|
|
| .card.hide{
|
| opacity:0;
|
| transform:scale(0.9);
|
| pointer-events:none;
|
| }
|
|
|
| .emoji{
|
| font-size:60px;
|
| margin-bottom:12px;
|
| }
|
|
|
| h2{
|
| margin-bottom:30px;
|
| }
|
|
|
| .buttons{
|
| position:relative;
|
| height:70px;
|
| }
|
|
|
| button{
|
| position:absolute;
|
| padding:12px 30px;
|
| border-radius:40px;
|
| border:none;
|
| cursor:pointer;
|
| }
|
|
|
| #yes{
|
| left:12%;
|
| background:#ff4d6d;
|
| color:white;
|
| }
|
|
|
| #no{
|
| left:55%;
|
| }
|
|
|
|
|
| .flower{
|
| position:absolute;
|
| top:30%;
|
| left:85%;
|
|
|
| animation:scale 4s linear infinite;
|
| }
|
|
|
| @keyframes scale{
|
| from{transform:scale(1);}
|
| to{transform:scale(4);}
|
| }
|
|
|
|
|
| .result{
|
| position:absolute;
|
| top:50%;
|
| left:50%;
|
| transform:translate(-50%,-50%);
|
| display:flex;
|
| gap:60px;
|
| align-items:center;
|
| opacity:0;
|
| pointer-events:none;
|
| transition:0.8s ease;
|
| }
|
|
|
|
|
| .result.show{
|
| opacity:1;
|
| pointer-events:auto;
|
| }
|
|
|
|
|
| .qr img{
|
| width:260px;
|
| border-radius:20px;
|
| box-shadow:0 20px 50px rgba(0,0,0,0.3);
|
| }
|
|
|
|
|
| .me{
|
| transform:scale(0) rotate(0deg);
|
| }
|
|
|
| .result.show .me{
|
| animation:growRotate 2.5s ease forwards;
|
| }
|
|
|
| @keyframes growRotate{
|
| from{
|
| transform:scale(0) rotate(0deg);
|
| }
|
| to{
|
| transform:scale(1.6) rotate(360deg);
|
| }
|
| }
|
|
|
| .me img{
|
| width:200px;
|
| border-radius:20px;
|
| }
|
|
|
|
|
| .heart{
|
| position:absolute;
|
| bottom:-20px;
|
| animation:floatUp linear forwards;
|
| }
|
|
|
| @keyframes floatUp{
|
| from{transform:translateY(0);opacity:1;}
|
| to{transform:translateY(-120vh);opacity:0;}
|
| }
|
| </style>
|
| </head>
|
|
|
| <body>
|
| <audio id="bgMusic" src="song.mp3" loop></audio>
|
|
|
|
|
| <div class="card">
|
| <div class="emoji">πΈβ€οΈ</div>
|
| <h2>Aavash,<br>Will you be my Valentine?</h2>
|
|
|
| <div class="buttons">
|
| <button id="yes">Yes π</button>
|
| <button id="no">No π </button>
|
| </div>
|
| </div>
|
|
|
|
|
| <div class="flower">
|
| <img src="flower.png" width="120">
|
| </div>
|
|
|
|
|
| <div class="result">
|
|
|
| <div class="qr">
|
|
|
| <h2>Sittai maa kaa paainxa?! π</h2>
|
| <marquee scrollamount="4"><b></b>QR bhitra rakhera pathaudai xu mero maya, ma timilai...scan garideuna hai</marquee></b></marquee>
|
| <img src="qr.jpeg">
|
| </div>
|
|
|
| <div class="me">
|
| <img src="Me.png">
|
| </div>
|
|
|
| </div>
|
|
|
|
|
| <audio id="hoverSound" src="https://assets.mixkit.co/sfx/preview/mixkit-cartoon-voice-laugh-343.mp3"></audio>
|
| <audio id="yesSound" src="https://assets.mixkit.co/sfx/preview/mixkit-achievement-bell-600.mp3"></audio>
|
|
|
| <script>
|
| const noBtn=document.getElementById("no");
|
| const yesBtn=document.getElementById("yes");
|
| const card=document.querySelector(".card");
|
| const result=document.querySelector(".result");
|
| const hoverSound=document.getElementById("hoverSound");
|
| const yesSound=document.getElementById("yesSound");
|
|
|
|
|
| noBtn.addEventListener("mouseenter",()=>{
|
| hoverSound.currentTime=0;
|
| hoverSound.play();
|
|
|
| const cardRect=card.getBoundingClientRect();
|
| const btnRect=noBtn.getBoundingClientRect();
|
|
|
| const maxX=cardRect.width-btnRect.width-10;
|
| const maxY=cardRect.height-btnRect.height-10;
|
|
|
| noBtn.style.left=Math.random()*maxX+"px";
|
| noBtn.style.top=Math.random()*maxY+"px";
|
| });
|
|
|
|
|
| yesBtn.addEventListener("click",()=>{
|
| yesSound.play();
|
|
|
| confetti({
|
| particleCount:260,
|
| spread:120,
|
| origin:{y:0.65}
|
| });
|
|
|
|
|
| card.classList.add("hide");
|
|
|
| setTimeout(()=>{
|
| result.classList.add("show");
|
| },500);
|
| });
|
|
|
|
|
| function createHeart(){
|
| const heart=document.createElement("div");
|
| heart.className="heart";
|
| heart.innerHTML=Math.random()>0.5?"β€οΈ":"π";
|
| heart.style.left=Math.random()*100+"vw";
|
| heart.style.fontSize=Math.random()*22+14+"px";
|
| heart.style.animationDuration=Math.random()*3+4+"s";
|
|
|
| document.body.appendChild(heart);
|
| setTimeout(()=>heart.remove(),8000);
|
| }
|
|
|
| setInterval(createHeart,380);
|
|
|
| const bgMusic = document.getElementById("bgMusic");
|
|
|
|
|
| window.addEventListener("load", () => {
|
| bgMusic.currentTime = 16;
|
|
|
| bgMusic.play().catch(() => {
|
|
|
|
|
| document.addEventListener("click", () => {
|
| bgMusic.currentTime = 16;
|
| bgMusic.play();
|
| }, { once: true });
|
| });
|
| });
|
|
|
| </script>
|
|
|
| </body>
|
| </html>
|
|
|