<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<p>Making your Feature better!
</p>
<img src="https://th.bing.com/th/id/OIP.tVU_ep1ZXR1ONaJNoSUC5gHaHa?w=150&h=180&c=7&r=0&o=5&pid=1.7" alt="Product Image">
<li>Make everything on your pov under control
</li>
<li>No electric needed
</li>
<li>Avoid your failure future
</li>
<p>Our product is available at an amazing price of $999,999. Don't miss out!
</p>
<h2>Get Yours Today!
</h2>
<div id="purchaseFormOverlay">
<span onclick="closePurchaseForm()" class="closeBtn">×</span>
<h2>Fill in your details
</h2>
<input type="text" id="name" name="name" required>
<input type="email" id="email" name="email" required>
<button type="button" onclick="submitPurchase()">Submit Purchase
</button>
css :
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #f4f4f4;
}
header {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px;
}
section {
margin: 20px;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#productDetails {
display: flex;
flex-wrap: wrap;
}
#productDetails img {
max-width: 100%;
border: 1px solid #ccc;
border-radius: 8px;
margin-bottom: 20px;
}
#productDetails div {
flex: 1;
margin-left: 20px;
}
ul {
list-style-type: none;
padding: 0;
}
ul li {
margin-bottom: 10px;
}
ul li::before {
content: "\2022";
color: #333;
font-size: 16px;
margin-right: 5px;
}
button {
padding: 12px 24px;
font-size: 16px;
cursor: pointer;
background-color: #333;
color: #fff;
border: none;
border-radius: 4px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #555;
}
#purchaseFormOverlay {
display: none;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
#purchaseForm {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.closeBtn {
font-size: 24px;
font-weight: bold;
color: #777;
cursor: pointer;
position: absolute;
top: 10px;
right: 10px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 10px;
font-weight: bold;
}
input,
textarea {
padding: 8px;
margin-top: 5px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 4px;
}
button[type="button"] {
background-color: #333;
color: #fff;
border: none;
padding: 12px 24px;
font-size: 16px;
cursor: pointer;
border-radius: 4px;
transition: background-color 0.3s ease;
}
button[type="button"]:hover {
background-color: #555;
}
js :
function openPurchaseForm() {
document.getElementById("purchaseFormOverlay").style.display = "flex";
}
function closePurchaseForm() {
document.getElementById("purchaseFormOverlay").style.display = "none";
}
function submitPurchase() {
alert('You got scammed!, thank for infomation');
closePurchaseForm();
}