-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fi alls
- Loading branch information
Showing
17 changed files
with
1,771 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!--B"H--> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Sign In to Shlichus</title> | ||
<link rel="manifest" href="https://ymerkos.github.io/shlichusApp/manifest.json?as=2"> | ||
<meta name="theme-color" content="#000000"> | ||
<script src="./servicer.js"></script> | ||
<link rel="stylesheet" type="text/css" href="./style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="profile img-container"> | ||
<img src="./img/profile.png"> | ||
</div> | ||
|
||
<div id="errorMsg"> | ||
|
||
</div> | ||
<div class="input-holder"> | ||
<div class="label">Email</div> | ||
<input type="text" id="email" class="input-field" placeholder="Enter email here"> | ||
</div> | ||
|
||
|
||
<div class="input-holder"> | ||
<div class="label">Password</div> | ||
<input type="password" id="password" class="input-field" placeholder="Enter Password here"> | ||
</div> | ||
|
||
<!-- Button --> | ||
<div class="button btn" id="login">Login</div> | ||
|
||
|
||
<div class="logo img-container"><img src="./img/logo.png"></div> | ||
<div class="button btn" id="signup">Sign Up</div> | ||
</div> | ||
<script src="./signin.js"></script> | ||
<script> | ||
console.log('B\"H', "\n\n\n") | ||
var sign = document.getElementById("login"); | ||
var up = document.getElementById("signup"); | ||
if(up) { | ||
up.onclick = () => { | ||
location.href="signup.html"; | ||
} | ||
} | ||
if(sign) { | ||
sign.onclick = async () => { | ||
var log = await ( | ||
await fetch( | ||
location.origin, { | ||
method: "POST", | ||
body: new URLSearchParams({ | ||
action: "login", | ||
email: email.value, | ||
password: password.value | ||
}) | ||
} | ||
) | ||
).json(); | ||
|
||
console.log(sign); | ||
if(log?.success) | ||
location.href = "./settings.html"; | ||
else { | ||
errorMsg.innerText = "Could not log in. " + | ||
log?.error || ""; | ||
} | ||
} | ||
} | ||
(async () => { | ||
var sesh = await ( | ||
await fetch(location.origin, { | ||
method: "POST", | ||
body:new URLSearchParams({ | ||
action: "session" | ||
}) | ||
}) | ||
).json(); | ||
if(sesh.success) { | ||
location.href = "./settings.html" | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!--B"H--> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Shlichus App</title> | ||
<link rel="stylesheet" type="text/css" href="./style.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<!-- Button --> | ||
<div class="logo img-container"><img src="./img/logo.png"></div> | ||
|
||
|
||
<script src="./main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//B"H | ||
var base = "https://awtsmoos.42web.io/"; | ||
async function getSession() { | ||
return await ( | ||
await fetch( | ||
base, { | ||
method: "POST", | ||
body: new URLSearchParams({ | ||
action: "session" | ||
}) | ||
} | ||
) | ||
).json() | ||
} | ||
|
||
(async () => { | ||
var sesh = await getSession(); | ||
if(sesh.error == "Not logged in") { | ||
location.href = "./sign-in.html" | ||
} else if(sesh.success) { | ||
location.href = "./settings.html" | ||
} | ||
console.log( | ||
"B\"H", | ||
"\n\n", | ||
sesh | ||
|
||
) | ||
})(); | ||
|
||
if ('serviceWorker' in navigator) { | ||
navigator.serviceWorker.register('/app/sw.js') | ||
.then((registration) => { | ||
console.log('Service Worker registered:', registration); | ||
}) | ||
.catch((error) => { | ||
console.error('Service Worker registration failed:', error); | ||
}); | ||
} | ||
|
||
// Request Notification Permission | ||
if ('Notification' in window) { | ||
Notification.requestPermission().then((permission) => { | ||
if (permission === 'granted') { | ||
console.log('Notifications enabled!'); | ||
} | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{ | ||
"name": "Shlichos Tasks", | ||
"short_name": "Tasks for your Shlihus", | ||
"start_url": "https://awtsmoos.42web.io/app/", | ||
"display": "standalone", | ||
"background_color": "#ffffff", | ||
"theme_color": "#000000", | ||
"icons": [ | ||
{ | ||
"src": "https://awtsmoos.42web.io/app/icons/icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "https://awtsmoos.42web.io/app/icons/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} | ||
{ | ||
"name": "Shlichos Tasks", | ||
"short_name": "Tasks for your Shlihus", | ||
"start_url": "/app", | ||
"display": "standalone", | ||
"background_color": "#ffffff", | ||
"theme_color": "#000000", | ||
"icons": [ | ||
{ | ||
"src": "/app/icons/icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/app/icons/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
Oops, something went wrong.