Skip to content

Commit d6a81b2

Browse files
committed
Refine loaders and hide scrollbars
1 parent 964da28 commit d6a81b2

3 files changed

Lines changed: 35 additions & 15 deletions

File tree

src/components/PageLoader.jsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ export default function PageLoader({ show, label = 'Loading' }) {
55
<AnimatePresence>
66
{show && (
77
<motion.div
8-
className="fixed inset-0 z-50 flex items-center justify-center backdrop-blur-md"
8+
className="fixed inset-0 z-[60] flex items-center justify-center bg-slate-950/90"
99
initial={{ opacity: 0 }}
1010
animate={{ opacity: 1 }}
1111
exit={{ opacity: 0 }}
12-
transition={{ duration: 0.3 }}
12+
transition={{ duration: 0.25 }}
1313
>
1414
<motion.div
15-
className="relative w-full max-w-sm rounded-3xl border border-white/10 bg-slate-950/80 p-8 text-center text-white shadow-2xl"
16-
initial={{ scale: 0.92 }}
17-
animate={{ scale: 1 }}
18-
exit={{ scale: 0.9, opacity: 0 }}
19-
transition={{ duration: 0.3, ease: [0.4, 0, 0.2, 1] }}
15+
className="flex w-full max-w-xs flex-col items-center gap-4 rounded-3xl border border-white/10 bg-slate-950/70 px-8 py-10 text-center text-white shadow-2xl"
16+
initial={{ scale: 0.9, opacity: 0 }}
17+
animate={{ scale: 1, opacity: 1 }}
18+
exit={{ scale: 0.92, opacity: 0 }}
19+
transition={{ duration: 0.25, ease: [0.4, 0, 0.2, 1] }}
2020
>
21-
<p className="text-sm uppercase tracking-[0.4em] text-sky-300">{label}</p>
22-
<h2 className="mt-4 text-xl font-semibold">Preparing content…</h2>
23-
<p className="mt-2 text-xs text-slate-300">Hang tight for a second.</p>
24-
<div className="mt-6 h-2 w-full overflow-hidden rounded-full bg-white/10">
21+
<div className="flex items-center gap-2 text-xs uppercase tracking-[0.5em] text-slate-300">
22+
<span className="h-1.5 w-1.5 animate-pulse rounded-full bg-sky-300" />
23+
{label}
24+
</div>
25+
<p className="text-sm text-slate-300">Preparing content…</p>
26+
<div className="relative h-1.5 w-full overflow-hidden rounded-full bg-white/10">
2527
<motion.span
26-
className="block h-full rounded-full bg-gradient-to-r from-sky-400 via-indigo-400 to-purple-400"
28+
className="absolute inset-y-0 w-1/3 rounded-full bg-white/60"
2729
initial={{ x: '-100%' }}
28-
animate={{ x: ['-100%', '0%', '0%', '100%'] }}
29-
transition={{ duration: 1.8, repeat: Infinity, ease: 'easeInOut' }}
30+
animate={{ x: ['-100%', '130%'] }}
31+
transition={{ duration: 1.4, repeat: Infinity, ease: 'easeInOut' }}
3032
/>
3133
</div>
3234
</motion.div>

src/pages/Apps.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ export default function Apps() {
3838
const [verificationMessage, setVerificationMessage] = useState('');
3939
const [showSubmissionForm, setShowSubmissionForm] = useState(false);
4040
const [catalogReady, setCatalogReady] = useState(false);
41+
const [catalogLoading, setCatalogLoading] = useState(true);
4142

4243
useEffect(() => {
4344
setCatalogReady(false);
45+
setCatalogLoading(true);
4446
const appsRef = collection(firestore, 'apps');
4547
const approvedQuery = query(appsRef, where('status', '==', 'approved'), orderBy('createdAt', 'desc'));
4648
const unsubApproved = onSnapshot(approvedQuery, (snapshot) => {
4749
setApprovedApps(snapshot.docs.map((docSnap) => ({ id: docSnap.id, ...docSnap.data() })));
48-
setCatalogReady(true);
50+
setCatalogLoading(false);
4951
});
5052

5153
let unsubPending = () => {};
@@ -356,6 +358,12 @@ export default function Apps() {
356358
);
357359
};
358360

361+
useEffect(() => {
362+
if (catalogLoading) return;
363+
const timeout = setTimeout(() => setCatalogReady(true), 350);
364+
return () => clearTimeout(timeout);
365+
}, [catalogLoading]);
366+
359367
return (
360368
<>
361369
<PageLoader show={!catalogReady} label="Loading catalog" />

src/styles/global.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ body {
4545
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
4646
background-color: #020617;
4747
min-height: 100vh;
48+
overflow-y: auto;
4849
scrollbar-width: none; /* Firefox */
4950
-ms-overflow-style: none; /* IE/Edge */
5051
}
@@ -53,3 +54,12 @@ body::-webkit-scrollbar {
5354
width: 0;
5455
height: 0;
5556
}
57+
58+
html {
59+
overflow-y: scroll;
60+
scrollbar-width: none;
61+
}
62+
63+
html::-webkit-scrollbar {
64+
display: none;
65+
}

0 commit comments

Comments
 (0)