forked from anuragverma108/SwapReads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subscribe.html
99 lines (88 loc) · 2.64 KB
/
subscribe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Subscribe to Newsletter</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #D4687F;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: Arial, sans-serif;
}
.subscribe-container {
text-align: center;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
max-width: 400px;
width: 100%;
}
.subscribe-container h2 {
color: #333;
margin-bottom: 20px;
}
.subscribe-container input[type="email"] {
width: 80%;
padding: 10px;
margin: 10px 0;
border: 2px solid #ccc;
border-radius: 5px;
font-size: 16px;
outline: none;
}
.subscribe-container input[type="email"]:focus {
border-color: #007BFF;
}
.subscribe-container button {
background-color: #007BFF;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.subscribe-container button:hover {
background-color: #0056b3;
}
@media (max-width: 600px) {
.subscribe-container {
padding: 15px;
}
.subscribe-container input[type="email"],
.subscribe-container button {
width: 90%;
font-size: 14px;
}
}
</style>
</head>
<body>
<div class="subscribe-container">
<h2>Subscribe to Newsletter</h2>
<input type="email" placeholder="Enter your email address" id="email" required>
<br>
<button onclick="subscribe()">Subscribe</button>
</div>
<script>
function subscribe() {
var email = document.getElementById('email').value;
var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
// Check if email is valid
if (email.match(emailPattern)) {
alert("Thank you for subscribing! A confirmation email has been sent to " + email);
} else {
alert("Please enter a valid email address.");
}
}
</script>
</body>
</html>