<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Popup Test</title>
<style>
#openFormBtn {
padding: 15px 30px;
font-size: 25px;
font-weight: bold;
background-color: #C7253E;
color: #FFF5E4;
border: solid;
border-radius: 5px;
border-color: #821131;
cursor: pointer;
transition: background-color 0.5s ease;
}
#openFormBtn:hover {
background-color: #821131;
color: #FFF5E4;
}
#popupForm {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #9CAFAA;
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
animation: fadeIn 0.5s ease-in-out;
}
#popupContent {
background-color: #D6DAC8;
padding: 30px;
border-radius: 10px;
width: 600px;
position: relative;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}
#closePopup {
position: absolute;
top: 10px;
right: 10px;
font-size: 20px;
font-weight: bold;
color: #aaa;
}
#closePopup:hover {
color: #000;
}
form {
display: flex;
flex-direction: column;
}
form h2 {
margin-bottom: 20px;
font-size: 24px;
color: #333;
}
form label {
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
form input[type=”text”],
form input[type=”email”],
form input[type=”tel”] {
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
width: calc(100% – 22px);
}
form input[type=”submit”] {
padding: 10px 20px;
font-size: 25px;
font-weight: bold;
background-color: #9CAFAA;
color: #FBF3D5;
border: none;
border-radius: 5px;
cursor: pointer;
width: calc(100% – 22px);
transition: background-color 0.3s ease;
}
form input[type=”submit”]:hover {
background-color: #FBF3D5;
color: #9CAFAA;
}
</style>
</head>
<body>
<button id=”openFormBtn”>Join Now For 100 ZAR<br></br><br><span style=”font-size: 20px; font-weight: normal;”>And Claim your Bonus</span></button>
<div id=”popupForm” style=”display:none;”>
<div id=”popupContent”>
<span id=”closePopup” style=”cursor:pointer;”>×</span>
<form id=”myForm”>
<h2>Welcome</h2>
<h3>Fill the details and get a full course straight to your mail box</h3>
<br></br>
<label for=”name”>Name:</label>
<input type=”text” id=”name” name=”name” required><br><br>
<label for=”email”>Email:</label>
<input type=”email” id=”email” name=”email” required><br><br>
<input type=”submit” value=”Submit”>
</form>
</div>
</div>
<script>
document.getElementById(‘openFormBtn’).onclick = function() {
document.getElementById(‘popupForm’).style.display = ‘flex’;
}
document.getElementById(‘closePopup’).onclick = function() {
document.getElementById(‘popupForm’).style.display = ‘none’;
}
window.onclick = function(event) {
if (event.target == document.getElementById(‘popupForm’)) {
document.getElementById(‘popupForm’).style.display = ‘none’;
}
}
</script>
</body>
</html>