Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Mar 22, 2024
1 parent 4a81005 commit d7230d1
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 138 deletions.
107 changes: 5 additions & 102 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<link href="select2.css" rel="stylesheet" />

</head>
<body class="bg-gray-200" onload="selectMainMenu(); loadQuery(); loadStatus();">
<body class="bg-gray-200" onload="loadQuery(); loadStatus();">

<main>
<header class="bg-white dark:bg-gray-900 h-screen">
Expand Down Expand Up @@ -232,40 +232,6 @@

<!-- Mobile Menu open: "block", Menu closed: "hidden" -->
<div id="menu" x-cloak :class="[isOpen ? 'translate-x-0 opacity-100 ' : 'opacity-0 -translate-x-full']" class="absolute inset-x-0 z-20 w-full bg-white px-6 py-4 shadow-md transition-all duration-300 ease-in-out dark:bg-gray-900">
<div id="menu-user" style="display: none" class="flex flex-col space-y-4 md:mt-0 md:flex-row md:space-y-0 text-right items-end md:text-center md:justify-center md:space-x-8">
<button class="text-gray-600 dark:text-gray-400 block hover:text-blue-500 focus:outline-none flex space-x-1"
onclick="window.location.assign('pub.html')">
<span>Publishing</span>
<svg class="mr-1" width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 17a1 1 0 1 1 2 0v1.077c0 .76-.082 1.185-.319 1.627a2.363 2.363 0 0 1-.977.977c-.442.237-.867.319-1.627.319H5.923c-.76 0-1.185-.082-1.627-.319a2.363 2.363 0 0 1-.978-.977C3.082 19.262 3 18.838 3 18.077L2.999 6.5A2.5 2.5 0 0 1 5.502 4l1.5.005a1 1 0 1 1-.005 2L5.499 6a.5.5 0 0 0-.5.5v11.577c0 .459.023.57.083.684.038.07.087.12.157.157.113.06.225.082.684.082h11.154c.459 0 .57-.022.684-.082a.363.363 0 0 0 .157-.157c.06-.113.082-.225.082-.684V17zm4-4a1 1 0 1 1-2 0 9 9 0 0 0-9-9 1 1 0 1 1 0-2c6.075 0 11 4.925 11 11zm-4 0a1 1 0 1 1-2 0 5 5 0 0 0-5-5 1 1 0 1 1 0-2 7 7 0 0 1 7 7zm-4 0a1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 1 1 0-2 3 3 0 0 1 3 3z" fill="currentColor"/>
</svg>
</button>
<button class="text-gray-600 dark:text-gray-400 block hover:text-blue-500 focus:outline-none flex"
onclick="window.location.assign('sub.html')">
<span>Subscriptions</span>
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 20.5H10C9.80189 20.4974 9.61263 20.4176 9.47253 20.2775C9.33244 20.1374 9.25259 19.9481 9.25 19.75V12L3.9 4.69C3.81544 4.58007 3.76395 4.44832 3.75155 4.31018C3.73915 4.17204 3.76636 4.03323 3.83 3.91C3.89375 3.78712 3.98984 3.68399 4.10792 3.61173C4.226 3.53947 4.36157 3.50084 4.5 3.5H19.5C19.6384 3.50084 19.774 3.53947 19.8921 3.61173C20.0101 3.68399 20.1062 3.78712 20.17 3.91C20.2336 4.03323 20.2608 4.17204 20.2484 4.31018C20.236 4.44832 20.1846 4.58007 20.1 4.69L14.75 12V19.75C14.7474 19.9481 14.6676 20.1374 14.5275 20.2775C14.3874 20.4176 14.1981 20.4974 14 20.5ZM10.75 19H13.25V11.75C13.2492 11.5907 13.302 11.4357 13.4 11.31L18 5H6L10.62 11.31C10.718 11.4357 10.7708 11.5907 10.77 11.75L10.75 19Z" fill="currentColor"/>
</svg>
</button>
<button class="text-gray-600 dark:text-gray-400 block hover:text-blue-500 focus:outline-none flex space-x-1"
onclick="logout()">
<span>Exit</span>
<svg width="24px"
height="24px"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
style="transform: scale(-1,1)">
<path d="M6 12H18M6 12L11 7M6 12L11 17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#about">About</a>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#use_cases">Use Cases</a>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#solutions">Solutions</a>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#pricing">Pricing</a>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#status">Status</a>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#resources">Resources</a>
</div>
<div id="menu-default" class="flex flex-col space-y-4 lg:mt-0 lg:flex-row lg:space-y-0 text-right md:text-center md:justify-center">
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#about">About</a>
<a class="text-gray-700 hover:text-blue-500 dark:text-gray-200 dark:hover:text-blue-500 lg:mx-6" href="#use_cases">Use Cases</a>
Expand All @@ -276,80 +242,17 @@
</div>
</div>

<div id="login"
style="display: none"
class="absolute inset-x-0 z-20 w-full bg-white px-2 py-3 shadow-md transition-all duration-300 ease-in-out dark:bg-gray-900 flex flex-col items-center justify-center">

<div class="items-center justify-center flex flex-col sm:flex-row space-y-1 sm:space-y-0 sm:space-x-2">
<p class="col-span-2 text-center text-gray-600 dark:text-gray-400">Sign In to continue</p>

<!-- Telegram -->
<div class="justify-center">
<script async
src="https://telegram.org/js/telegram-widget.js?22"
data-telegram-login="AwakariBot"
data-size="medium"
data-onauth="handleAuthTelegram(user)"
data-request-access="write"
data-radius="4"
data-userpic="false">
</script>
</div>

<!-- Google -->
<!-- <div class="justify-center">-->
<!-- <div id="g_id_onload"-->
<!-- data-client_id="131943559095-6uojftc7uoscij6b4j2jm0ifo4cd6obc"-->
<!-- data-context="signin"-->
<!-- data-ux_mode="popup"-->
<!-- data-callback="handleAuthGoogle"-->
<!-- data-auto_prompt="false">-->
<!-- </div>-->
<!-- <div class="g_id_signin"-->
<!-- data-type="standard"-->
<!-- data-shape="rectangular"-->
<!-- data-theme="outline"-->
<!-- data-text="signin_with"-->
<!-- data-size="medium"-->
<!-- data-logo_alignment="left">-->
<!-- </div>-->
<!-- </div>-->
</div>

<div class="flex">
<span class="text-center mt-1 text-sm text-neutral-500 flex flex-col sm:flex-row">
<span class="whitespace-nowrap">By signing in, you agree to the</span>
<span class="whitespace-nowrap flex">
&nbsp;<a href="tos.html" class="text-gray-600 dark:text-slate-400 hover:text-slate-500">Terms of Service</a>
&nbsp;and
&nbsp;<a href="privacy.html" class="text-gray-600 dark:text-slate-400 hover:text-slate-500">Privacy Policy</a>.
</span>
</span>
<svg xmlns="http://www.w3.org/2000/svg"
onclick="document.getElementById('login').style.display = 'none'"
class="ml-2 h-6 w-6 place-self-end sm:place-self-center text-gray-800 dark:text-gray-200 justify-start align-top place-self-start mb-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</div>
</div>

<div id="events-menu"
style="display: none"
class="absolute inset-x-0 z-20 w-full bg-white px-1 py-1 shadow-md transition-all duration-300 ease-in-out dark:bg-gray-900 items-center justify-center flex flex-col space-y-1">

<div class="grid space-x-2">
<span class="col-span-2 text-center text-gray-600 dark:text-gray-400">
<p id="streaming-results">Results will appear below for the next 1 hour.</p>
<p>For the full-featured functionality:</p>
<p>Use <a href="https://t.me/AwakariBot" target="_blank" class="text-blue-500">@AwakariBot</a> as reader.</p>
<p>
Go to
<a href="https://awakari.com/sub.html" class="text-blue-500">Subscriptions</a>
to manage queries.</p>
<a href="login.html" class="text-blue-500">Sign In</a>
for full functionality.
</p>
<div class="flex">
<div class="grow w-full"></div>
<svg xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -425,7 +328,7 @@ <h1 class="m-1 text-4xl font-semibold text-cyan-700 dark:text-cyan-400 md:pt-16"
Donate
</button>
<button type="button" class="text-blue-500 border border-blue-500 h-8 hover:bg-blue-200 dark:hover:bg-blue-900 static w-24 rounded-md m-2"
onclick="window.location.assign('login.html')">
onclick="localStorage.getItem(keyUserName) ? window.location.assign('pub.html') : window.location.assign('login.html')">
Start
</button>
</div>
Expand Down
19 changes: 11 additions & 8 deletions web/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
</nav>

<div class="m-1 flex-1 flex flex-col space-y-2">
<div class="items-center justify-center flex flex-col sm:flex-row space-y-1 sm:space-y-0 sm:space-x-2">
<p class="col-span-2 text-center text-gray-600 dark:text-gray-400">Sign In to continue</p>

<div class="items-center justify-center flex flex-col space-y-2">

<p>Sign In is required for:</p>
<p>Persistent Subscriptions and Publishing</p>

<!-- Telegram -->
<div class="justify-center">
Expand Down Expand Up @@ -63,6 +66,12 @@
<!-- data-logo_alignment="left">-->
<!-- </div>-->
<!-- </div>-->

<div class="justify-center flex">
<a href="pub.html" class="col-span-2 text-center text-blue-500">Skip</a>
<span>&nbsp;to continue in limited mode</span>
</div>

</div>

<div class="flex justify-center">
Expand All @@ -75,12 +84,6 @@
</span>
</span>
</div>
<div class="flex justify-center pt-2">
<a href="pub.html"
class="col-span-2 text-center text-gray-600 dark:text-gray-400">
Skip
</a>
</div>
</div>

</body>
Expand Down
15 changes: 0 additions & 15 deletions web/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,3 @@ function logout() {
window.location.assign("index.html");
}
}

function selectMainMenu() {
//
const userId = localStorage.getItem(keyUserId);
switch (userId) {
case null:
document.getElementById("menu-default").style.display = "flex";
document.getElementById("menu-user").style.display = "none";
break
default:
// already logged in
document.getElementById("menu-default").style.display = "none";
document.getElementById("menu-user").style.display = "flex";
}
}
13 changes: 10 additions & 3 deletions web/pub.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@
<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-2">
<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">
<span id="exit" class="flex" onclick="logout()">
<span id="exit"
class="flex"
style="display: none"
onclick="logout()">
<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>
Expand All @@ -49,7 +52,11 @@
<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">
<span id="login" onclick="window.location.assign('login.html')">Sign In</span>
<span id="login"
style="display:none;"
onclick="window.location.assign('login.html')">
Sign In
</span>
</div>
</div>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion web/pub.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function load() {
const userId = localStorage.getItem(keyUserId);
if (userId) {
headers["X-Awakari-User-Id"] = userId;
document.getElementById("exit").style.display = "block";
document.getElementById("exit").style.display = "flex";
} else {
document.getElementById("login").style.display = "block";
}
Expand Down
2 changes: 1 addition & 1 deletion web/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ async function startEventsLoading(subId, deadline) {

const templateEvent = (txt, time, src, link, id) => `
<div class="p-1 shadow-xs border dark:border-gray-600 h-12 w-86 sm:w-[624px] flex align-middle">
<a href="${link}" target="_blank" class="w-80 sm:w-[586px]">
<a href="${link}" target="_blank" class="w-78 sm:w-[586px]">
<p class="text-gray-700 dark:text-gray-300 hover:text-blue-500 truncate">
${txt}
</p>
Expand Down
34 changes: 26 additions & 8 deletions web/sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,32 @@

</head>
<body class="bg-white dark:bg-gray-900" onload="load()">
<nav class="text-xl flex p-1 sm:p-4 text-slate-700 dark:text-slate-200">
<button onclick="window.location.assign('index.html')" class="mr-1">
<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>Subscriptions</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 space-x-1">
<div class="w-16 justify-self-start text-left hover:text-neutral-500">
<span id="exit"
style="display:none;"
class="flex"
onclick="logout()">
<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="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">
<span id="login"
style="display: none"
onclick="window.location.assign('login.html')">
Sign In
</span>
</div>
</div>
</nav>
</header>
<main class="py-2 mx-2 text-slate-700 dark:text-gray-300">
<div class="flex flex-col sm:flex-row items-center justify-center">
<div class="flex w-80 sm:w-48 sm:ml-2">
Expand Down
3 changes: 3 additions & 0 deletions web/sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function load() {
const userId = localStorage.getItem(keyUserId);
if (userId) {
headers["X-Awakari-User-Id"] = userId;
document.getElementById("exit").style.display = "flex";
} else {
document.getElementById("login").style.display = "block";
}

document.getElementById("wait").style.display = "block";
Expand Down

0 comments on commit d7230d1

Please sign in to comment.