-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
63 lines (59 loc) · 2.42 KB
/
main.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$(document).ready(function()
{
$('#transBox').animate({opacity: "+=0.8"},1000);
var firebaseConfig = {
apiKey: "AIzaSyA7hoOJfiQF_JX99e7doHy48Zpv_i6IKqk",
authDomain: "projectrolnik2019.firebaseapp.com",
databaseURL: "https://projectrolnik2019.firebaseio.com",
projectId: "projectrolnik2019",
storageBucket: "",
messagingSenderId: "983291648629",
appId: "1:983291648629:web:dca51e98e312a7ad"
};
firebase.initializeApp(firebaseConfig);
$('#google').on("click", function(){
var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
Toastify({
text: "Logged in as "+result.user.email,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)"
}).showToast();
sessionStorage.setItem("logged_in",result.user.email);
}).catch(function(error) {
Toastify({
text: error.message,
backgroundColor: "linear-gradient(to right, red, orange)"
}).showToast();
});
});
$('#fb').on("click", function(){
var provider = new firebase.auth.FacebookAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
Toastify({
text: "Logged in as "+result.user.email,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)"
}).showToast();
sessionStorage.setItem("logged_in",result.user.email);
}).catch(function(error) {
Toastify({
text: error.message,
backgroundColor: "linear-gradient(to right, red, orange)"
}).showToast();
});
});
$('#twitter').on("click", function(){
var provider = new firebase.auth.TwitterAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
Toastify({
text: "Logged in as "+result.user.displayName,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)"
}).showToast();
sessionStorage.setItem("logged_in",result.user.displayName);
}).catch(function(error) {
Toastify({
text: error.message,
backgroundColor: "linear-gradient(to right, red, orange)"
}).showToast();
});
});
});