forked from mohdjameel2412/cyber-fraud-detector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
110 lines (78 loc) · 3.41 KB
/
index.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link type="image/x-icon" rel="icon" href="https://certifiedblackhatin.files.wordpress.com/2021/03/cropped-56bae-cropped-black-white-and-triangle-data-chase-games-logo-2-2.png?w=192">
<title>Cyber-Fraud-Detector</title>
<link rel="stylesheet" href="/assets/css/style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" charset="utf-8"></script>
</head>
<body>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="/__/firebase/8.2.5/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="/__/firebase/8.2.5/firebase-analytics.js"></script>
<!-- Initialize Firebase -->
<script src="/__/firebase/init.js"></script>
<main action="index.html" class="login-form">
<h1><img id="logo" src="/assets/images/main.png" >Cyber <br>Fraud Detector</h1>
<div class="checkbox">
<input type="checkbox" id="agree" required>
<label for="agree">Grant us access to your data for R&D purpose?</label><br>
</div>
<button id="logbtn">
<svg aria-hidden="true" class="native svg-icon iconGoogle" width="25" height="25" viewBox="0 0 18 18">
<path d="M16.51 8H8.98v3h4.3c-.18 1-.74 1.48-1.6 2.04v2.01h2.6a7.8 7.8 0 002.38-5.88c0-.57-.05-.66-.15-1.18z"
fill="#4285F4"></path>
<path d="M8.98 17c2.16 0 3.97-.72 5.3-1.94l-2.6-2a4.8 4.8 0 01-7.18-2.54H1.83v2.07A8 8 0 008.98 17z"
fill="#34A853"></path>
<path d="M4.5 10.52a4.8 4.8 0 010-3.04V5.41H1.83a8 8 0 000 7.18l2.67-2.07z" fill="#FBBC05"></path>
<path d="M8.98 4.18c1.17 0 2.23.4 3.06 1.2l2.3-2.3A8 8 0 001.83 5.4L4.5 7.49a4.77 4.77 0 014.48-3.3z"
fill="#EA4335"></path>
</svg>
</button>
<a class="skip" href="/skip.html">skip</a>
</main>
<script src="https://www.gstatic.com/firebasejs/8.0.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.0.0/firebase-auth.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCXFUbGyOPO5mGJ8dfBoVXfZ0IQIlrOi2s",
authDomain: "cyber-fraud-detector.firebaseapp.com",
projectId: "cyber-fraud-detector",
storageBucket: "cyber-fraud-detector.appspot.com",
messagingSenderId: "834489215383",
appId: "1:834489215383:web:a56abc84494d2f22fb7cd2",
measurementId: "G-NBBR6NWGB1"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
//------------------------------------------Authentication---------------------------------//
document.getElementById('logbtn').addEventListener('click', GoogleLogin, checkAuthState)
let provider = new firebase.auth.GoogleAuthProvider()
function GoogleLogin() {
if (document.getElementById('agree').checked) {
console.log('Login Btn Call')
firebase.auth().signInWithPopup(provider).then(res => {
alert('logged in');
}).catch(e => {
console.log(e)
})
} else {
alert('Checkbox');
}
}
function checkAuthState() {
firebase.auth().onAuthStateChanged(user => {
if (user) {
window.location = "home.html";
} else {
}
})
}
checkAuthState()
</script>
</body>
</html>