Skip to content

Commit

Permalink
B"H
Browse files Browse the repository at this point in the history
fi alls
  • Loading branch information
ymerkos authored Dec 5, 2024
1 parent 0f851eb commit f259e1d
Show file tree
Hide file tree
Showing 17 changed files with 1,771 additions and 20 deletions.
89 changes: 89 additions & 0 deletions index.html
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>
18 changes: 18 additions & 0 deletions index123.html
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>
49 changes: 49 additions & 0 deletions main.js
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!');
}
});
}

40 changes: 20 additions & 20 deletions manifest.json
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"
}
]
}
Loading

0 comments on commit f259e1d

Please sign in to comment.