-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubscribe-modal.html
140 lines (131 loc) · 5.56 KB
/
subscribe-modal.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mailchimp Subscription Modal</title>
<link href="//cdn-images.mailchimp.com/embedcode/classic-071822.css" rel="stylesheet" type="text/css">
<style>
/* Modal Background */
.modal {
display: none; /* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* Dimmed background */
z-index: 1000;
justify-content: center;
align-items: center;
}
#openModalBtn {
background-color: tomato; /* background */
color: white; /* White text */
border: none; /* Remove border */
padding: 10px 20px; /* Add padding */
font-size: 24px; /* Adjust font size */
border-radius: 5px; /* Rounded corners */
cursor: pointer; /* Pointer cursor on hover */
transition: background-color 0.3s ease; /* Smooth hover effect */
width: 100%;
margin-bottom: 20px; /* Add space after the button */
}
#openModalBtn:hover {
background-color: rgb(255, 58, 23); /* Darker on hover */
}
/* Modal Content */
.modal-content {
background-color: #fff;
padding: 20px;
border-radius: 8px;
max-width: 600px;
width: 90%;
text-align: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
overflow: auto;
}
/* Close Button */
.close-btn {
position: absolute;
top: 15px;
right: 15px;
font-size: 20px;
font-weight: bold;
color: #aaa;
cursor: pointer;
}
.close-btn:hover {
color: #000;
}
</style>
</head>
<body>
<!-- Trigger Button -->
<button id="openModalBtn">Wanna subscribe?</button>
<!-- Modal Structure -->
<div id="subscriptionModal" class="modal">
<div class="modal-content">
<span class="close-btn">×</span>
<!-- Mailchimp Signup Form -->
<div>
<div id="mc_embed_signup">
<form action="https://emrekaragul.us21.list-manage.com/subscribe/post?u=e72720e0214b2266cab41097e&id=5cddb1a68e&f_id=0038dfe1f0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Submit your e-mail to subscribe!</h2>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span></label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" required>
<span id="mce-EMAIL-HELPERTEXT" class="helper_text"></span>
</div>
<div id="mce-responses" class="clear foot">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<input type="text" name="b_e72720e0214b2266cab41097e_5cddb1a68e" tabindex="-1" value="">
</div>
<div class="optionalParent">
<div class="clear foot">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div>
</div>
</form>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript'>
(function($) {
window.fnames = new Array();
window.ftypes = new Array();
fnames[0] = 'EMAIL';
ftypes[0] = 'email';
}(jQuery));
var $mcj = jQuery.noConflict(true);
</script>
<!--End mc_embed_signup-->
</div>
</div>
</div>
<script>
// Get the modal, button, and close elements
const modal = document.getElementById("subscriptionModal");
const openModalBtn = document.getElementById("openModalBtn");
const closeBtn = document.querySelector(".close-btn");
// Open the modal when the button is clicked
openModalBtn.addEventListener("click", () => {
modal.style.display = "flex"; // Show the modal
});
// Close the modal when the close button is clicked
closeBtn.addEventListener("click", () => {
modal.style.display = "none"; // Hide the modal
});
// Close the modal when clicking outside of it
window.addEventListener("click", (e) => {
if (e.target === modal) {
modal.style.display = "none";
}
});
</script>
</body>
</html>