-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
101 lines (92 loc) · 3.36 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content=
"width=device-width,initial-scale=1.0">
<title>Social Media Login Form</title>
<script src="https://www.gstatic.com/firebasejs/11.0.0/firebase-auth.js"></script>
<link rel="stylesheet" href="m.css">
<link rel="stylesheet" href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
</head>
<body>
<div class="login-container">
<div class="header"></div>
<img id="profile-pic" src="img/hh.gif" alt="Profile Picture">
<h1>Welcome</h1>
<h3>Social Media Login</h3>
<div class="login-form">
<input type="text"
id="email"
placeholder="Email"
autocomplete="off" required>
<input type="password"
id="password"
placeholder="Password"
autocomplete="off" required>
<button onclick="submitForm()">Login</button>
</div>
<div class="social-buttons">
<button class="facebook" onclick="signInWithFacebook()">
<i class="fab fa-facebook-f"></i>
Login with Facebook
</button>
<script type="module" src="https://www.gstatic.com/firebasejs/11.0.0/firebase-app.js">
// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
apiKey: "AIzaSyBbVCXDY6i_OKIX96DcgF8rIV2OTGsrqlk",
authDomain: "social-con-98b07.firebaseapp.com",
projectId: "social-con-98b07",
storageBucket: "social-con-98b07.appspot.com",
messagingSenderId: "842479232809",
appId: "1:842479232809:web:e63b9c55120f5798e77938"
};
firebase.initializeApp(firebaseConfig);
function signInWithFacebook() {
FB.login(function(response) {
if (response.authResponse) {
const credential = firebase.auth.FacebookAuthProvider.credential(
response.authResponse.accessToken
);
firebase.auth().signInWithCredential(credential)
.then((userCredential) => {
const user = userCredential.user;
console.log(user);
})
.catch((error) => {
console.error(error.message);
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
}
</script>
<button class="twitter">
<i class="fab fa-twitter"></i>
Login with Twitter
</button>
<button class="google">
<i class="fab fa-google"></i>
Login with Google
</button>
<button class="instagram">
<i class="fab fa-instagram"></i>
Login with Instagram
</button>
</div>
</div>
<script>
function submitForm() {
const email =
document.getElementById('email').value;
const password =
document.getElementById('password').value;
window.alert('The form is submitted');
document.getElementById('email').value = '';
document.getElementById('password').value = '';
}
</script>
</body>
</html>