Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Confirmation Window #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Images/confirmation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,55 @@ footer {
padding-top: 5%;
}

/* Confirmation Popup */

.popup {
width: 100%;
height: 100%;
position: fixed;
display: none;
justify-content: center;
text-align: center;
align-items: center;
z-index: 1;
top: 0;
left: 0;
}
.popup-content {
height: 55%;
width: 300px;
padding: 5%;
background: rgb(235, 233, 233);
border-radius: 10px;
position: relative;
}
.popup-content h1 {
font-family: "Varela Round", sans-serif;
font-weight: 800;
color: black;
font-size:xx-large;
}
.popup-content h6 {
color: gray;
padding: 12px 0px;
}
.popup-content button {
border-radius: 7px;
font-family: Georgia;
color: #ffffff;
font-size: 13px;
background: #232b2b;
padding: 10px 30px 10px 30px;
text-decoration: none;
}
.popup-content img {
width: 55%;
}
.popup-content button:hover {
background: #000000;
text-decoration: none;
}

.about {
padding-top: 2%;
padding-bottom: 3%;
Expand Down Expand Up @@ -281,6 +330,13 @@ form {
header ul li a {
font-size: 15px;
}
.popup-content {
height: 50%;
width: 80%;
}
.popup-content img {
width: 50%;
}
}

/* Mobile View */
Expand Down Expand Up @@ -326,6 +382,14 @@ form {
padding-left: 4px;
padding-top: 2%;
}
.popup-content {
height: 50%;
width: 80%;
}
.popup-content img {
width: 50%;
}

.head-1,
.ex,
.follow {
Expand Down
47 changes: 41 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewportm" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="index.css" />
<link rel="icon" href="./Images/banner.jpg" />
<script src="https://kit.fontawesome.com/9603a582d3.js" crossorigin="anonymous"></script>
Expand Down Expand Up @@ -144,6 +144,7 @@ <h2 class="head-1">About</h2>
<br />reducing traffic & commute costs.
</p>


<div class="explore">
<h2 class="ex">Explore</h2>

Expand All @@ -167,13 +168,27 @@ <h2 class="follow">Follow Us</h2>
<h2 class="news">Subscribe Our Newsletter</h2>
<p class="sub">Get frequent updates from us .</p>
<div class="newsletter-box">
<input class="emailbox" type="email" name="" value="" placeholder="Enter your email id" />
<button type="button" name="button" class="letter">
Subscribe
</button>
<input class="emailbox" type="email" name="email" value="" id="email" placeholder="Enter your email id" />
<button type="button" name="button" class="letter"
onclick="ValidateEmail(document.getElementById('email').value)">Subscribe</button>
</div>
</form>
</form>
</div>


<div class="popup">
<div>
<div class="popup-content">
<img src="./Images/confirmation.png" alt="Confirmation Image">
<br>
<h1>Success!</h1>
<h6>You have successfully registered</h6>
<button class="ok-btn">OK</button>
</div>

</div>
</div>


<!-- Footer 2 -->
<div class="foot2">
Expand Down Expand Up @@ -205,6 +220,26 @@ <h2 class="news">Subscribe Our Newsletter</h2>
}
}, 3000);
});

//Confirmation Window
function ValidateEmail(mail) {
var mailFormat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if (mail.match(mailFormat)) {
document.querySelector(".popup").style.display = "flex";
document.querySelector(".ok-btn").addEventListener("click", function () {
document.querySelector(".popup").style.display = "none";
})
window.onclick = function (event) {
if (event.target == document.querySelector(".popup")) {
document.querySelector(".popup").style.display = "none";
}
}
return (true);

}
return (false)
}

// Dynamic copyright year

const yearEl = document.getElementById('year');
Expand Down