Skip to content

Commit 3b59ce7

Browse files
authored
Frontend and backend part
1 parent dfbf79d commit 3b59ce7

35 files changed

+3073
-0
lines changed

404.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Page Not Found</title>
7+
8+
<style media="screen">
9+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
10+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px 16px; border-radius: 3px; }
11+
#message h3 { color: #888; font-weight: normal; font-size: 16px; margin: 16px 0 12px; }
12+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
13+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
14+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
15+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
16+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
17+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
18+
@media (max-width: 600px) {
19+
body, #message { margin-top: 0; background: white; box-shadow: none; }
20+
body { border-top: 16px solid #ffa100; }
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<div id="message">
26+
<h2>404</h2>
27+
<h1>Page Not Found</h1>
28+
<p>The specified file was not found on this website. Please check the URL for mistakes and try again.</p>
29+
<h3>Why am I seeing this?</h3>
30+
<p>This page was generated by the Firebase Command-Line Interface. To modify it, edit the <code>404.html</code> file in your project's configured <code>public</code> directory.</p>
31+
</div>
32+
</body>
33+
</html>

Extensions/firebase.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hosting": {
3+
"public": "public",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
],
9+
"rewrites": [
10+
{
11+
"source": "**",
12+
"destination": "public/index.html"
13+
}
14+
]
15+
}
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-site-verification: googledccac80cddb5cc9a.html

app.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Initialize Firebase
2+
const firebaseConfig = {
3+
apiKey: "AIzaSyBYM0tkjdUDSzz7UoJt92jQITLXk4DD8lE",
4+
authDomain: "stdperformance-bf994.firebaseapp.com",
5+
projectId: "stdperformance-bf994",
6+
storageBucket: "stdperformance-bf994.appspot.com",
7+
messagingSenderId: "990002419810",
8+
appId: "1:990002419810:web:e61ff22f2e52e7664fd93b",
9+
measurementId: "G-346DHF7S46"
10+
};
11+
12+
// Ensure Firebase isn't initialized more than once
13+
if (!firebase.apps.length) {
14+
firebase.initializeApp(firebaseConfig);
15+
} else {
16+
firebase.app(); // if already initialized, use that one
17+
}
18+
19+
const auth = firebase.auth();
20+
21+
const signInForm = document.querySelector('.sign-in-form');
22+
const signUpForm = document.querySelector('.sign-up-form');
23+
const container = document.querySelector('.container');
24+
25+
document.querySelector('#sign-up-btn').addEventListener('click', () => {
26+
container.classList.add('sign-up-mode');
27+
});
28+
29+
document.querySelector('#sign-in-btn').addEventListener('click', () => {
30+
container.classList.remove('sign-up-mode');
31+
});
32+
33+
signUpForm.addEventListener('submit', async (e) => {
34+
e.preventDefault();
35+
const email = signUpForm.querySelector('input[type=email]').value;
36+
const password = signUpForm.querySelector('input[type=password]').value;
37+
38+
try {
39+
const userCredential = await auth.createUserWithEmailAndPassword(email, password);
40+
console.log('User signed up:', userCredential.user);
41+
alert('You have successfully signed up!');
42+
signUpForm.reset();
43+
container.classList.remove('sign-up-mode');
44+
45+
} catch (error) {
46+
console.error('Error creating user:', error);
47+
alert('Error creating user: ' + error.message);
48+
}
49+
});
50+
51+
signInForm.addEventListener('submit', async (e) => {
52+
e.preventDefault();
53+
const email = signInForm.querySelector('input[type=email]').value;
54+
const password = signInForm.querySelector('input[type=password]').value;
55+
56+
try {
57+
const userCredential = await auth.signInWithEmailAndPassword(email, password);
58+
console.log('User signed in:', userCredential.user);
59+
alert('You have successfully signed in!');
60+
signInForm.reset();
61+
window.location.href = 'profile.html';
62+
} catch (error) {
63+
console.error('Error user Not found:', error);
64+
alert('Error User Not Found: ' + error.message);
65+
}
66+
});

assets/Image1.png

168 KB
Loading

assets/Image2.png

182 KB
Loading

assets/Login.png

57.9 KB
Loading

assets/Team.png

212 KB
Loading

assets/register.png

24.9 KB
Loading

0 commit comments

Comments
 (0)