-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathemailBanner.scroll
32 lines (31 loc) · 1.08 KB
/
emailBanner.scroll
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
div
id emailBanner
class banner hide
form
onsubmit handleSubmit(event)
span Like PLDB? Join our email list:
button Join
type submit
a X
onclick hideEmailList()
class closeBannerButton
css
.banner {
background: #f0f0f0;
padding: 10px;
text-align: center;
}
.closeBannerButton {cursor:pointer;display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, 0.1); color: #666; text-decoration: none; font-family: arial; font-size: 14px; line-height: 1; transition: all 0.2s ease; position: relative; top: -1px;}
.hide { display: none; }
script
if (localStorage.getItem('subscribed') !== 'true')
document.getElementById('emailBanner').classList.remove('hide');
function hideEmailList() {
localStorage.setItem('subscribed', 'true');
document.getElementById('emailBanner').classList.add('hide');
}
function handleSubmit(e) {
e.preventDefault();
window.location.href = `mailto:[email protected]?subject=Join PLDB email list&body=Please add me to the PLDB email list`;
hideEmailList()
}