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 #44

Open
wants to merge 2 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.
83 changes: 74 additions & 9 deletions index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap");

* {
font-family: 'Poppins', sans-serif;
font-family: "Poppins", sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
Expand All @@ -22,7 +22,7 @@ header ul li a:hover {
text-underline-offset: transform scale(1.03);
}
header ul li::after {
content: '';
content: "";
height: 2.5px;
background: #fada5e;
display: block;
Expand Down Expand Up @@ -80,7 +80,7 @@ header ul li a {
font-weight: 500px;
transition: 0.6s;
font-size: 20px;
font-family: 'Roboto', sans-serif;
font-family: "Roboto", sans-serif;
}

.banner {
Expand Down 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: 60%;
width: 350px;
padding: 2%;
background: white;
background-image: linear-gradient(to right, rgb(220, 213, 213), white);
border-radius: 10px;
position: relative;
}
.popup-content h1 {
color: black;
}
.popup-content h3 {
color: gray;
}
.popup-content button {
-webkit-border-radius: 10;
-moz-border-radius: 10;
border-radius: 10px;
font-family: Arial;
color: #000000;
font-size: 1rem;
background: #faf737;
padding: 4% 9%;
text-decoration: none;
}
.popup-content img {
width: 30%;
height: 45%;
}
.popup-content button:hover {
background: #ffff00;
text-decoration: none;
}

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

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

.head-1,
.ex,
.follow {
Expand Down Expand Up @@ -364,7 +429,7 @@ form {
margin-left: 5%;
}
.span {
font-family: 'Overpass', sans-serif;
font-family: "Overpass", sans-serif;
}

.start a {
Expand Down Expand Up @@ -422,7 +487,7 @@ form {
width: 9em;
}
.ctn-preloader .animation-preloader .txt-loading {
font: bold 5em 'Montserrat', sans-serif;
font: bold 5em "Montserrat", sans-serif;
text-align: center;
user-select: none;
}
Expand Down Expand Up @@ -538,7 +603,7 @@ form {
width: 8em;
}
.ctn-preloader .animation-preloader .txt-loading {
font: bold 3.5em 'Montserrat', sans-serif;
font: bold 3.5em "Montserrat", sans-serif;
}
}

Expand All @@ -548,7 +613,7 @@ form {
width: 7em;
}
.ctn-preloader .animation-preloader .txt-loading {
font: bold 2em 'Montserrat', sans-serif;
font: bold 2em "Montserrat", sans-serif;
}
}
/* PRELOADER END */
44 changes: 39 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,31 @@ <h2 class="news">Subscribe Our Newsletter</h2>
<input
class="emailbox"
type="email"
name=""
value=""
name="email"
value=""
id="email"
placeholder="Enter your email id"
/>
<button type="button" name="button" class="letter">
Subscribe
</button>
<button type="button" name="button" class="letter"
onclick="ValidateEmail(document.getElementById('email').value)">Subscribe</button>
</div>
</form>
</div>

<div class="popup">
<div class="popup-content">
<div class="main">
<img src="./Images/confirmation.png" alt="Confirmation Image">
<br><br>
<h1>Saved!</h1>
<h3>Love. Nurture. Protect. Carpool.</h3>
<br>
<button class="ok-btn">OK</button>
</div>

</div>
</div>

<!-- Footer 2 -->
<div class="foot2">
<p class="f2">
Expand Down Expand Up @@ -147,6 +161,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