-
Notifications
You must be signed in to change notification settings - Fork 0
/
newsletter.html
138 lines (117 loc) · 3.43 KB
/
newsletter.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
<!DOCTYPE html>
<html>
<head>
<title>Newsletter subscription</title>
<style>
body {
background-image: linear-gradient(to right, #434343 0%, black 100%);
}
h1 {
color: white;
align-items: center;
text-align: center;
}
form {
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-image: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%);
border-radius: 5px;
}
label {
display: block;
font-size: 16px;
margin-bottom: 5px;
}
input[type="text"],
input[type="email"],
select {
width: 100%;
padding: 10px;
border-radius: 5px;
border: none;
margin-bottom: 10px;
font-size: 16px;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
input[type="submit"]:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div id="header"></div>
<p align='center'>
<img src="socials/announcement.png" width="100px" height="100px" align='center'>
</p>
<h1>Newsletter subscription</h1>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="name">Email:</label>
<input type="email" id="email" name="email" required>
<input type="submit" value="Submit">
</form>
<div id="footer"></div>
<script>
$(function () {
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script>
<script>
</script>
<script type="module">
import {initializeApp} from "https://www.gstatic.com/firebasejs/9.18.0/firebase-app.js";
import {getDatabase, ref, push} from "https://www.gstatic.com/firebasejs/9.18.0/firebase-database.js";
const firebaseConfig = {
apiKey: "AIzaSyBBoWMteoxgPM8zaYpr2yyI4I1D0g63Ezg",
authDomain: "hacktheplan-55346.firebaseapp.com",
databaseURL: "https://hacktheplan-55346-default-rtdb.firebaseio.com",
projectId: "hacktheplan-55346",
storageBucket: "hacktheplan-55346.appspot.com",
messagingSenderId: "65660152625",
appId: "1:65660152625:web:4e6cfaf5330887de399e10",
measurementId: "G-HPTW77E8NX"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
// const analytics = getAnalytics(app);
const database = getDatabase(app);
const form = document.querySelector('form');
form.addEventListener('submit', async (event) => {
event.preventDefault();
const formData = new FormData(form);
const databaseRef = ref(database, 'newsltter_db');
push(databaseRef, Object.fromEntries(formData.entries()));
const response = await fetch('/api/vendor', {
method: 'POST',
body: formData
});
alert('Subscription confirmed!');
form.reset();
});
</script>
<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date();
(function () {
var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
s1.async = true;
s1.src = 'https://embed.tawk.to/641f805d4247f20fefe7f8a6/1gsdgqs3v';
s1.charset = 'UTF-8';
s1.setAttribute('crossorigin', '*');
s0.parentNode.insertBefore(s1, s0);
})();
</script>
<!--End of Tawk.to Script-->
</body>
</html>