-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
49 lines (40 loc) · 1.4 KB
/
app.js
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
const firebaseConfig = {
apiKey: "AIzaSyCglRNJoI2Qw33E6jzFcs4t5nVDqwBWW_Q",
authDomain: "jibran-abdul-jabbar-portfolio.firebaseapp.com",
databaseURL: "https://jibran-abdul-jabbar-portfolio-default-rtdb.firebaseio.com",
projectId: "jibran-abdul-jabbar-portfolio",
storageBucket: "jibran-abdul-jabbar-portfolio.appspot.com",
messagingSenderId: "589343918799",
appId: "1:589343918799:web:f731821b81272d043905ba",
measurementId: "G-VKH6QXBMEQ"
};
firebase.initializeApp(firebaseConfig);
console.log(firebase)
var fname = document.getElementById("name");
var email = document.getElementById("email");
var project = document.getElementById("project");
var message = document.getElementById("subject");
function send(){
var database = firebase.database().ref('Messages')
var contact = {
name: fname.value,
email: email.value,
project: project.value,
message: message.value,
}
database.push(contact)
fname.value = "";
email.value = "";
project.value = "";
message.value = "";
alert("Thank you for contacting you will receive message in your gmail as soon as possible.");
}
// Login Model
// Get the modal
var modal = document.getElementById('id01');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}