-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
144 lines (127 loc) · 5.23 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
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
139
140
141
142
143
144
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Login</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Mooli&display=swap" rel="stylesheet">
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
body{ font-family: "Mooli", sans-serif;
overflow: hidden !important;
}
input{ color: rgb(230, 230, 230);
/* border: 3px solid rgb(45, 45, 45);;; */
background-color: rgba(45, 45, 45, 0.516);;
padding: 15px;
border: none;
outline: none;
margin: 5px 0px;box-shadow: rgba(11, 23, 27, 0.12) 1px 5px 8px 1px, rgba(13, 13, 13, 0.32) 1px 1px 4px 2px;
border-radius: 2px;
}
input::placeholder{
color: rgb(193, 193, 193);
font-weight: 100;
}
input:focus{
color: white;
background-color: rgba(63, 63, 63, 0.516);;
}
#d1{ font-family: "Mooli", sans-serif;
padding:15px 10px;
transition: 0.6s ease-in-out;
border-radius: 10px;
box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
height: 50vh;
color: rgb(191, 191, 191);
background-color: rgba(76, 76, 77, 0.429);
/* height: 100vh; */
}
button{ font-family: "Mooli", sans-serif;
/* cursor:progress !important; */
/* padding: 10px; */
color: white;
border-radius: 6px;
border: none;
background-color: rgb(48, 48, 48);
/* margin: 10px 0px; */
}
#main{
font-family: "Mooli", sans-serif;
background-color: rgb(44, 44, 44);
height: 100vh;
}
h2{ font-family: "Mooli", sans-serif;
color: rgb(208, 208, 208);
}
h4{ font-family: "Mulish", sans-serif;
color: rgb(238, 94, 96);
}
h1{
transition: 0.6s ease-in-out;
color: lightgrey;
}
title{
background-color: red;
}
i{
font-size: 20px;
/* margin: 0px 5px; */
padding: 15px;
text-align: center;
}
</style>
</head>
<body>
<div class=" col-12 d-flex justify-content-center align-items-center flex-column" id="main">
<div class="animate__animated animate__fadeInRightBig d-flex flex-column col-10 col-lg-4 justify-content-around align-items-center mx-3" id="d1">
<h1 class="animate__animated animate__fadeInLeftBig">Login</h1>
<div class="col-lg-10 col-12 d-flex flex-column justify-content-center">
<input type="email" class="col-12" name="email" placeholder="Email" id="email">
<input type="password" name="password" class="col-12" placeholder="Password" id="pass">
</div>
<div class="d-flex col-4 justify-content-around">
<button id="login-btn" class="col-5" title="Sign-In"><i class="fas fa-sign-in" title="Sign-In"></i></button>
<button id="create" class="col-5" title="Create Account"><i class="fa fa-user-plus" title="Create Account" aria-hidden="true"></i></button>
</div>
<h4 id="if"></h4>
</div>
</div>
<script type="module">
import { app, auth } from "./module.mjs";
import { signInWithEmailAndPassword } from "https://www.gstatic.com/firebasejs/10.12.5/firebase-auth.js";
// Ensure Firebase is correctly initialized
// console.log("Firebase app and auth initialized:", app, auth);
document.getElementById("create").addEventListener("click", () => {
location.href = "create.html";
// document.getElementById("main").style.backgroundColor="black";
});
document.getElementById("login-btn").addEventListener("click", () => {
var email = document.getElementById("email").value;
var password = document.getElementById("pass").value;
signInWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
const user = userCredential.user;
console.log(email, password);
alert("Login successful");
location.href = "dashboard.html";
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
alert("Login failed: " + errorMessage);
console.error(`Error Code: ${errorCode}, Error Message: ${errorMessage}`);
});
});
</script>
<!-- <script src="app.js" type="mo"></script> -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>