Skip to content

Commit 56a5eba

Browse files
fix: get started button is not functional
1 parent 7292830 commit 56a5eba

File tree

3 files changed

+114
-77
lines changed

3 files changed

+114
-77
lines changed

app/api/endpoints/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def get_config_id(catalog) -> str | None:
9696

9797

9898
async def _manifest_handler(response: Response, token: str):
99-
response.headers["Cache-Control"] = "public, max-age=86400"
99+
response.headers["Cache-Control"] = "no-cache"
100100

101101
if not token:
102102
raise HTTPException(status_code=401, detail="Missing token. Please reconfigure the addon.")

app/static/index.html

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474

7575
/* Announcement link styling to ensure visibility */
7676
#announcement-content a {
77-
color: #60a5fa; /* blue-400 */
77+
color: #60a5fa;
78+
/* blue-400 */
7879
text-decoration: underline;
7980
}
8081

@@ -89,13 +90,20 @@
8990

9091
<!-- Mobile Header -->
9192
<div class="md:hidden p-4 bg-slate-900 border-b border-slate-800 flex items-center gap-3">
93+
<button id="mobileNavToggle" aria-label="Open navigation" class="p-2 rounded-md hover:bg-slate-800/50">
94+
<svg class="w-6 h-6 text-slate-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
95+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
96+
</svg>
97+
</button>
9298
<img src="/app/static/logo.png" alt="Watchly" class="w-8 h-8 rounded-lg">
9399
<h1 class="font-bold text-lg text-white">Watchly</h1>
94100

95101
</div>
102+
<!-- Mobile Nav Backdrop -->
103+
<div id="mobileNavBackdrop" class="fixed inset-0 bg-black/50 z-30 hidden md:hidden"></div>
96104
<!-- Sidebar Navigation -->
97-
<aside
98-
class="w-full md:w-72 bg-slate-900/50 backdrop-blur-xl border-b md:border-b-0 md:border-r border-slate-800 flex flex-col flex-shrink-0 relative z-20">
105+
<aside id="mainSidebar"
106+
class="fixed inset-y-0 left-0 z-40 w-72 transform -translate-x-full transition-transform duration-300 ease-out bg-slate-900/50 backdrop-blur-xl border-b md:border-b-0 md:border-r border-slate-800 flex flex-col flex-shrink-0 md:relative md:translate-x-0 md:flex">
99107
<div class="p-6 md:p-8 flex-col items-start gap-4 hidden md:flex">
100108
<div class="flex items-center gap-3">
101109
<img src="/app/static/logo.png" alt="Watchly" class="w-10 h-10 rounded-xl shadow-lg shadow-blue-500/10">
@@ -106,7 +114,7 @@ <h1 class="font-bold text-2xl text-transparent bg-clip-text bg-gradient-to-r fro
106114

107115

108116
<nav
109-
class="flex-grow px-4 md:px-6 py-4 space-y-1 overflow-x-auto md:overflow-visible flex md:block whitespace-nowrap md:whitespace-normal gap-2 md:gap-0">
117+
class="flex-grow px-4 md:px-6 py-4 space-y-1 md:overflow-visible flex flex-col md:block whitespace-normal gap-2">
110118

111119
<!-- User Profile Section (Hidden by default, shown after login) -->
112120
<div id="user-profile" class="hidden mb-6 p-4 bg-slate-800/50 border border-slate-700/50 rounded-xl w-full">
@@ -194,13 +202,16 @@ <h1 class="font-bold text-2xl text-transparent bg-clip-text bg-gradient-to-r fro
194202
<div class="p-4 md:p-6 mt-auto space-y-4">
195203
<!-- Ko-fi Support Button -->
196204
<button type="button" id="kofiBtn"
197-
class="block w-full bg-gradient-to-r from-pink-600 to-rose-600 hover:from-pink-500 hover:to-rose-500 text-white font-medium py-3 px-4 rounded-xl transition-all shadow-lg shadow-pink-900/20 hover:shadow-xl hover:shadow-pink-900/30 group text-left">
198-
<div class="flex items-center justify-center gap-2">
199-
<svg class="w-5 h-5 group-hover:scale-110 transition-transform" viewBox="0 0 24 24" fill="currentColor">
200-
<path
201-
d="M23.881 8.948c-.773-4.085-4.859-4.593-4.859-4.593H.723c-.604 0-.679.798-.679.798s-.082 7.324-.022 11.822c.164 2.424 2.586 2.672 2.586 2.672s8.267-.023 11.966-.049c2.438-.426 2.683-2.566 2.658-3.734 4.352.24 7.422-2.831 6.649-6.916zm-11.062 3.511c-1.246 1.453-4.011 3.976-4.011 3.976s-.121.119-.31.023c-.076-.057-.108-.09-.108-.09-.443-.441-3.368-3.049-4.034-3.954-.709-.965-1.041-2.7-.091-3.71.951-1.01 3.005-1.086 4.363.407 0 0 1.565-1.782 3.468-.963 1.904.82 1.832 3.011.723 4.311zm6.173.478c-.928.116-1.682.028-1.682.028V7.284h1.77s1.971.551 1.971 2.638c0 1.913-.985 2.667-2.059 3.015z" />
205+
class="block w-full bg-gradient-to-r from-amber-700 to-amber-900 hover:from-amber-600 hover:to-amber-800 text-white font-medium py-3 px-4 rounded-xl transition-all shadow-lg shadow-amber-900/40 hover:shadow-xl group text-left"
206+
aria-label="Buy me Coffee">
207+
<div class="flex items-center justify-center gap-3">
208+
<!-- Coffee cup icon -->
209+
<svg class="w-5 h-5 group-hover:scale-110 transition-transform" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
210+
<path d="M3 7h14v3a5 5 0 01-5 5H8a5 5 0 01-5-5V7z" fill="#fff" opacity="0.9"/>
211+
<path d="M19 8.5a3 3 0 010 6" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
212+
<path d="M6 4v1M9 4v1M12 4v1" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
202213
</svg>
203-
<span>Support on Ko-fi</span>
214+
<span>Buy me Coffee</span>
204215
</div>
205216
</button>
206217

@@ -240,20 +251,21 @@ <h1 class="font-bold text-2xl text-transparent bg-clip-text bg-gradient-to-r fro
240251
Personalized Recommendation Engine for Stremio
241252
</p>
242253
<p class="text-sm text-slate-400 max-w-2xl mx-auto">
243-
Discover movies and series tailored to your unique taste, powered by your Stremio library and watch history.
254+
Discover movies and series tailored to your unique taste, powered by your Stremio library
255+
and watch history.
244256
</p>
245-
<!-- Announcement (fetched from API) -->
246-
<div id="announcement"
247-
class="hidden max-w-2xl mx-auto mt-6 p-3 rounded-xl bg-slate-800/50 border border-slate-700/50 text-sm text-slate-200 flex items-start gap-3"
248-
role="region" aria-live="polite">
249-
<div class="flex-shrink-0 text-blue-400 mt-0.5">
250-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
251-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
252-
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
253-
</svg>
254-
</div>
255-
<div id="announcement-content" class="flex-grow text-slate-200"></div>
256-
</div>
257+
<!-- Announcement (fetched from API) -->
258+
<div id="announcement"
259+
class="hidden max-w-2xl mx-auto mt-6 p-3 rounded-xl bg-slate-800/50 border border-slate-700/50 text-sm text-slate-200 flex items-start gap-3"
260+
role="region" aria-live="polite">
261+
<div class="flex-shrink-0 text-blue-400 mt-0.5">
262+
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
263+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
264+
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
265+
</svg>
266+
</div>
267+
<div id="announcement-content" class="flex-grow text-slate-200"></div>
268+
</div>
257269
</div>
258270

259271
<!-- Features Grid -->
@@ -272,7 +284,7 @@ <h3 class="text-base font-bold text-white mb-1">Smart Recommendations</h3>
272284
<p class="text-xs text-slate-400 leading-relaxed">
273285
AI-powered suggestions based on your watch history
274286
</p>
275-
</div>
287+
</div>
276288

277289
<!-- Feature 2 -->
278290
<div
@@ -305,7 +317,7 @@ <h3 class="text-base font-bold text-white mb-1">Genre Filtering</h3>
305317
<p class="text-xs text-slate-400 leading-relaxed">
306318
Exclude genres you don't like
307319
</p>
308-
</div>
320+
</div>
309321
<!-- Feature 4 -->
310322
<div
311323
class="group bg-gradient-to-br from-slate-900/50 to-slate-800/30 border border-slate-700/50 hover:border-green-500/50 rounded-xl p-4 transition-all hover:shadow-lg hover:shadow-green-900/10">
@@ -321,7 +333,7 @@ <h3 class="text-base font-bold text-white mb-1">Multi-Language</h3>
321333
<p class="text-xs text-slate-400 leading-relaxed">
322334
Recommendations in your preferred language
323335
</p>
324-
</div>
336+
</div>
325337

326338
<!-- Feature 5 -->
327339
<div
@@ -338,7 +350,7 @@ <h3 class="text-base font-bold text-white mb-1">RPDB Integration</h3>
338350
<p class="text-xs text-slate-400 leading-relaxed">
339351
Enhanced posters with ratings
340352
</p>
341-
</div>
353+
</div>
342354

343355
<!-- Feature 6 -->
344356
<div
@@ -355,8 +367,8 @@ <h3 class="text-base font-bold text-white mb-1">Based on Your Loves</h3>
355367
<p class="text-xs text-slate-400 leading-relaxed">
356368
Recommendations from content you loved
357369
</p>
358-
</div>
359-
</div>
370+
</div>
371+
</div>
360372
<!-- CTA Section -->
361373
<div class="text-center space-y-6">
362374
<div class="max-w-2xl mx-auto">
@@ -383,11 +395,12 @@ <h3 class="text-base font-bold text-white mb-1">Based on Your Loves</h3>
383395
<span class="font-medium">View Source Code</span>
384396
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
385397
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
386-
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path>
398+
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14">
399+
</path>
387400
</svg>
388401
</a>
389402
</div>
390-
</div>
403+
</div>
391404
</section>
392405

393406
<!-- SECTION 1: LOGIN -->
@@ -540,7 +553,8 @@ <h2 class="text-3xl font-bold text-white mb-2">Save & Install</h2>
540553
</div>
541554
<div class="flex-grow">
542555
<h3 class="text-sm font-semibold text-red-400 mb-1">Danger Zone</h3>
543-
<p class="text-xs text-slate-400 mb-4">Permanently delete your settings and account data. This action
556+
<p class="text-xs text-slate-400 mb-4">Permanently delete your settings and account
557+
data. This action
544558
cannot be undone.</p>
545559
<button type="button" id="deleteAccountBtn"
546560
class="w-full bg-red-500/10 hover:bg-red-500/20 border border-red-500/30 hover:border-red-500/50 text-red-400 hover:text-red-300 font-medium py-3 px-4 rounded-lg transition-all flex items-center justify-center gap-2 group">
@@ -550,10 +564,10 @@ <h3 class="text-sm font-semibold text-red-400 mb-1">Danger Zone</h3>
550564
</path>
551565
</svg>
552566
<span>Delete Account</span>
553-
</button>
554-
</div>
555-
</div>
567+
</button>
556568
</div>
569+
</div>
570+
</div>
557571
</div>
558572

559573
<!-- Error Message -->
@@ -609,6 +623,8 @@ <h3 class="text-3xl font-bold text-white mb-2">You're all set!</h3>
609623
</div>
610624
</main>
611625

626+
<!-- BuyMeMoMo modal removed — button now redirects directly -->
627+
612628
<!-- Ko-fi Modal -->
613629
<div id="kofi-modal" class="fixed inset-0 z-50 hidden">
614630
<!-- Backdrop -->

app/static/script.js

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ document.addEventListener('DOMContentLoaded', () => {
6060
initializeWelcomeFlow();
6161

6262
initializeNavigation();
63+
// By default, ensure logged-out users see only Welcome/Login and not configure/install/catalogs
64+
lockNavigationForLoggedOut();
6365
initializeCatalogList();
6466
initializeLanguageSelect();
67+
initializeMobileNav();
6568
initializeGenreLists();
6669
initializeFormSubmission();
6770
initializeSuccessActions();
@@ -83,12 +86,19 @@ document.addEventListener('DOMContentLoaded', () => {
8386
// Welcome Flow Logic
8487
function initializeWelcomeFlow() {
8588
// Single "Get Started" button leads to Stremio login
86-
if (btnGetStarted) {
87-
btnGetStarted.addEventListener('click', () => {
88-
navItems.login.classList.remove('disabled');
89-
switchSection('login');
90-
});
91-
}
89+
if (!btnGetStarted) return;
90+
91+
// Support mobile taps reliably while avoiding double-fire (touch -> click)
92+
let touched = false;
93+
const handleGetStarted = (e) => {
94+
if (e.type === 'click' && touched) return;
95+
if (e.type === 'touchstart') touched = true;
96+
navItems.login.classList.remove('disabled');
97+
switchSection('login');
98+
};
99+
100+
btnGetStarted.addEventListener('click', handleGetStarted);
101+
btnGetStarted.addEventListener('touchstart', handleGetStarted, { passive: true });
92102
}
93103

94104

@@ -107,6 +117,46 @@ function unlockNavigation() {
107117
Object.values(navItems).forEach(el => el.classList.remove('disabled'));
108118
}
109119

120+
function lockNavigationForLoggedOut() {
121+
// Ensure welcome and login remain accessible; disable only config/catalogs/install
122+
if (navItems.welcome) navItems.welcome.classList.remove('disabled');
123+
if (navItems.login) navItems.login.classList.remove('disabled');
124+
if (navItems.config) navItems.config.classList.add('disabled');
125+
if (navItems.catalogs) navItems.catalogs.classList.add('disabled');
126+
if (navItems.install) navItems.install.classList.add('disabled');
127+
}
128+
129+
function initializeMobileNav() {
130+
const mobileToggle = document.getElementById('mobileNavToggle');
131+
const sidebar = document.getElementById('mainSidebar');
132+
const backdrop = document.getElementById('mobileNavBackdrop');
133+
if (!mobileToggle || !sidebar || !backdrop) return;
134+
135+
const openNav = () => {
136+
sidebar.classList.remove('-translate-x-full');
137+
sidebar.classList.add('translate-x-0');
138+
backdrop.classList.remove('hidden');
139+
document.body.classList.add('overflow-hidden');
140+
};
141+
const closeNav = () => {
142+
sidebar.classList.remove('translate-x-0');
143+
sidebar.classList.add('-translate-x-full');
144+
backdrop.classList.add('hidden');
145+
document.body.classList.remove('overflow-hidden');
146+
};
147+
148+
mobileToggle.addEventListener('click', (e) => { e.preventDefault(); openNav(); });
149+
backdrop.addEventListener('click', closeNav);
150+
151+
// Auto-close when a nav item is selected (mobile)
152+
Object.values(navItems).forEach(n => {
153+
if (!n) return;
154+
n.addEventListener('click', () => {
155+
if (!sidebar.classList.contains('hidden')) closeNav();
156+
});
157+
});
158+
}
159+
110160
function switchSection(sectionKey) {
111161
// Hide all sections
112162
Object.values(sections).forEach(el => {
@@ -137,8 +187,9 @@ function resetApp() {
137187
switchSection('welcome');
138188

139189
// Lock Navs
190+
// Keep the Welcome nav enabled so the main Get Started entry remains usable.
140191
Object.keys(navItems).forEach(key => {
141-
if (key !== 'login') navItems[key].classList.add('disabled'); // Login is always enabled technically, but we hide it via switchSection('welcome')
192+
if (key !== 'login' && key !== 'welcome') navItems[key].classList.add('disabled');
142193
});
143194
// Actually, we should probably disable 'login' too until they choose New/Existing User?
144195
// But our nav click logic handles that. If we are at 'welcome', the sidebar is visible but inactive.
@@ -872,43 +923,13 @@ function initializeFooter() {
872923
// Ko-fi Modal Logic
873924
function initializeKofi() {
874925
const kofiBtn = document.getElementById('kofiBtn');
875-
const modal = document.getElementById('kofi-modal');
876-
const closeBtn = document.getElementById('close-kofi');
877-
const backdrop = document.getElementById('kofi-backdrop');
878-
const iframe = document.getElementById('kofiframe');
879-
880-
// URL for the Ko-fi embed widget
881-
const KOFI_URL = "https://ko-fi.com/timilsinabimal/?hidefeed=true&widget=true&embed=true&preview=true";
882-
883-
function openModal() {
884-
if (!modal) return;
885-
modal.classList.remove('hidden');
886-
// Lazy load the iframe source if not set correctly
887-
if (iframe && (!iframe.src || !iframe.src.includes('ko-fi.com'))) {
888-
iframe.src = KOFI_URL;
889-
}
890-
}
891-
892-
function closeModal() {
893-
if (!modal) return;
894-
modal.classList.add('hidden');
895-
// We don't clear src to keep it loaded for next time, but you could if needed
896-
}
926+
const MEMOMO_URL = 'https://buymemomo.com/timilsinabimal';
897927

898928
if (kofiBtn) kofiBtn.addEventListener('click', (e) => {
899929
e.preventDefault();
900-
openModal();
901-
});
902-
903-
if (closeBtn) closeBtn.addEventListener('click', closeModal);
904-
905-
if (backdrop) backdrop.addEventListener('click', closeModal);
906-
907-
// Close on Escape key
908-
document.addEventListener('keydown', (e) => {
909-
if (e.key === 'Escape' && modal && !modal.classList.contains('hidden')) {
910-
closeModal();
911-
}
930+
// Open BuyMeMoMo in a new tab and remove window.opener for safety
931+
const win = window.open(MEMOMO_URL, '_blank');
932+
try { if (win) win.opener = null; } catch (err) { /* ignore */ }
912933
});
913934
}
914935

0 commit comments

Comments
 (0)