Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Mar 24, 2024
1 parent 61ec89f commit 787e7e6
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 26 deletions.
4 changes: 2 additions & 2 deletions web/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function handleAuthGoogle(response) {
const tokenDecoded = jwt_decode(tokenEncoded);
localStorage.setItem(keyUserId, `${tokenDecoded.iss}/${tokenDecoded.sub}`);
localStorage.setItem(keyAuthToken, tokenEncoded);
window.location.assign("pub.html");
window.location.assign("sub.html");
}

function handleAuthTelegram(user) {
Expand All @@ -19,7 +19,7 @@ function handleAuthTelegram(user) {
localStorage.setItem(keyAuthProvider, "Telegram");
const token = Base64.encode(JSON.stringify(user));
localStorage.setItem(keyAuthToken, token);
window.location.assign("pub.html");
window.location.assign("sub.html");
}

function logout() {
Expand Down
51 changes: 37 additions & 14 deletions web/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,38 @@
<script src="auth.js"></script>

</head>
<body class="bg-white dark:bg-gray-900 text-slate-700 dark:text-gray-300">
<body class="bg-white dark:bg-gray-900 text-slate-700 dark:text-gray-300"
onload="localStorage.getItem(keyUserId) ? document.getElementById('login').style.display = 'none' : document.getElementById('login').style.display = 'block'">

<nav class="text-xl flex p-1 sm:p-4 text-slate-700 dark:text-slate-200">
<button onclick="history.back()">
<svg width="26px" height="26px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6 12H18M6 12L11 7M6 12L11 17" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
</button>
<span class="pl-1">Sign In</span>
</nav>
<header>
<nav class="text-xl flex p-1 sm:p-4 text-neutral-600 dark:text-neutral-400 justify-center">
<div class="text-center min-w-[352px] w-[352px] flex">
<div class="justify-self-start text-left hover:text-fuchsia-500">
<span id="exit"
class="flex"
onclick="localStorage.getItem(keyUserName) ? logout() : window.location.assign('index.html')">
<svg width="26px" height="26px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6 12H18M6 12L11 7M6 12L11 17" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"/>
</svg>
Exit
</span>
</div>
<div class="grow"></div>
<div class="hover:text-indigo-500 px-1">Subscribe</div>
<div class="grow"></div>
<div class="hover:text-cyan-500 px-1" onclick="window.location.assign('pub.html')">Publish</div>
<div class="grow"></div>
<div class="justify-self-end text-right border-b-2 border-green-500 text-green-500 mr-2">
<span id="login"
style="display: none"
onclick="window.location.assign('login.html')">
Sign In
</span>
</div>
</div>
</nav>
</header>

<div class="m-1 flex-1 flex flex-col">

Expand Down Expand Up @@ -67,7 +88,7 @@
<div class="justify-center flex p-1">
<p class="text-center text-sm text-neutral-700 dark:text-neutral-400">
Sign In is required for Persistent Subscriptions and Publishing.
<a href="pub.html" class="col-span-2 text-center text-blue-700 dark:text-slate-400">Skip</a>
<a href="sub.html" class="col-span-2 text-center text-blue-700 dark:text-slate-400">Skip</a>
to continue in the limited mode.
</p>
</div>
Expand All @@ -85,12 +106,14 @@
</span>
</div>

<p class="text-xl p-1 sm:text-center pt-4">
Install Application
<p class="text-lg p-1 text-center pt-4">
Try Mobile Application
</p>
<p class="p-1 text-center">Optional. See the installation steps below:</p>
<div class="flex justify-center">
<div class="grid grid-cols-1 sm:grid-cols-3 md:grid-cols-3 justify-center max-w-[800px] space-y-2 space-x-2">
<div class="border mt-2 ml-2"><img src="install-0.png" alt="find the install app option in the browser menu"/></div>
<div class="border mt-2 ml-2"><img src="install-0.png"
alt="find the install app option in the browser menu"/></div>
<div class="border"><img src="install-1.png" alt="click install"/></div>
<div class="border"><img src="install-2.png" alt="find the installed app icon on the desktop"/></div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions web/pub.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<body class="bg-white dark:bg-gray-900" onload="load()">
<header>
<nav class="text-xl flex p-1 sm:p-4 text-neutral-600 dark:text-neutral-400 justify-center">
<div class="text-center min-w-[352px] w-[352x] flex space-x-2">
<div class="w-16 justify-self-start text-left hover:text-neutral-500">
<div class="text-center min-w-[352px] max-w-[352x] flex">
<div class="w-16 justify-self-start text-left hover:text-fuchsia-500">
<span id="exit"
class="flex"
onclick="localStorage.getItem(keyUserName) ? logout() : window.location.assign('index.html')">
Expand All @@ -52,9 +52,12 @@
Exit
</span>
</div>
<div class="w-24 border-b-2 border-indigo-500 text-indigo-500">Publish</div>
<div class="w-24 hover:text-cyan-500" onclick="window.location.assign('sub.html')">Subscribe</div>
<div class="w-16 justify-self-end text-right hover:text-neutral-800 dark:hover:text-neutral-300">
<div class="grow"></div>
<div class="w-24 hover:text-indigo-500" onclick="window.location.assign('sub.html')">Subscribe</div>
<div class="grow"></div>
<div class="w-24 border-b-2 border-cyan-500 text-cyan-500">Publish</div>
<div class="grow"></div>
<div class="w-16 justify-self-end text-right hover:text-green-500 mr-2">
<span id="login"
style="display: none"
onclick="window.location.assign('login.html')">
Expand Down
13 changes: 8 additions & 5 deletions web/sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<body class="bg-white dark:bg-gray-900" onload="load()">
<header>
<nav class="text-xl flex p-1 sm:p-4 text-neutral-600 dark:text-neutral-400 justify-center">
<div class="text-center min-w-[352px] w-[352px] flex space-x-1">
<div class="w-16 justify-self-start text-left hover:text-neutral-500">
<div class="text-center min-w-[352px] max-w-[352px] flex">
<div class="w-16 justify-self-start text-left hover:text-fuchsia-500-500">
<span id="exit"
class="flex"
onclick="localStorage.getItem(keyUserName) ? logout() : window.location.assign('index.html')">
Expand All @@ -53,9 +53,12 @@
Exit
</span>
</div>
<div class="w-24 hover:text-indigo-500" onclick="window.location.assign('pub.html')">Publish</div>
<div class="w-24 border-b-2 border-cyan-500 text-cyan-500">Subscribe</div>
<div class="w-16 justify-self-end text-right hover:text-neutral-800 dark:hover:text-neutral-300">
<div class="grow"></div>
<div class="w-24 border-b-2 border-indigo-500 text-indigo-500">Subscribe</div>
<div class="grow"></div>
<div class="w-24 hover:text-cyan-500" onclick="window.location.assign('pub.html')">Publish</div>
<div class="grow"></div>
<div class="w-16 justify-self-end text-right hover:text-green-500 mr-2">
<span id="login"
style="display: none"
onclick="window.location.assign('login.html')">
Expand Down

0 comments on commit 787e7e6

Please sign in to comment.