Skip to content

Commit c119b10

Browse files
committed
fix: make download model modal responsive and scale on small screens
1 parent 09a8fe3 commit c119b10

1 file changed

Lines changed: 32 additions & 29 deletions

File tree

src/components/Common/DownloadModelModal.tsx

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const DownloadModelModal: React.FC<Props> = ({
6767
}
6868
return (
6969
<motion.div
70-
className="fixed inset-0 z-50 flex items-center justify-center px-4 md:px-0"
70+
className="fixed inset-0 z-50 flex items-center justify-center p-4 md:p-0"
7171
initial={{ opacity: 0 }}
7272
animate={{ opacity: 1 }}
7373
exit={{ opacity: 0 }}
@@ -85,14 +85,14 @@ export const DownloadModelModal: React.FC<Props> = ({
8585
}}
8686
/>
8787
<motion.div
88-
className="relative z-10 w-full md:max-w-[min(750px,50vw)]"
88+
className="relative z-10 flex w-full flex-col md:max-w-[min(750px,50vw)]"
8989
initial={{ y: 10, opacity: 0 }}
9090
animate={{ y: 0, opacity: 1 }}
9191
exit={{ y: 10, opacity: 0 }}
9292
transition={{ duration: 0.2 }}
9393
>
94-
<div className="group relative flex w-full flex-col gap-5 overflow-hidden rounded-lg border border-glass-border bg-glass p-5 text-left backdrop-blur-md transition-all duration-300 md:p-8">
95-
<div className="flex items-center gap-3">
94+
<div className="group relative flex max-h-[90vh] w-full flex-col overflow-hidden rounded-lg border border-glass-border bg-glass p-5 text-left backdrop-blur-md transition-all duration-300 md:p-8">
95+
<div className="mb-5 flex flex-shrink-0 items-center gap-3">
9696
<span className="material-symbols-outlined material-symbols-filled text-3xl text-primary">
9797
auto_awesome
9898
</span>
@@ -101,31 +101,34 @@ export const DownloadModelModal: React.FC<Props> = ({
101101
</h1>
102102
</div>
103103

104-
<div className="flex flex-col gap-3 text-sm md:text-base">
105-
<p className="text-primary/80">
106-
Our newest model, Maia 2, provides richer and more in-depth
107-
analysis, allowing for:
108-
</p>
109-
<ul className="flex list-inside flex-col gap-1.5 pl-2 text-white/80">
110-
<li>
111-
✨ Detailed move evaluations tailored to different rating levels
112-
</li>
113-
<li>
114-
🧠 Insights into how players of various strengths approach the
115-
game
116-
</li>
117-
<li>
118-
⚡ Faster, local analysis without needing to send data to a
119-
server
120-
</li>
121-
</ul>
122-
<p className="text-white/80">
123-
Maia 2 runs entirely on your device and requires a one-time 90mb
124-
download.
125-
</p>
104+
<div className="flex-1 overflow-y-auto pr-1">
105+
<div className="flex flex-col gap-3 text-sm md:text-base">
106+
<p className="text-primary/80">
107+
Our newest model, Maia 2, provides richer and more in-depth
108+
analysis, allowing for:
109+
</p>
110+
<ul className="flex list-inside flex-col gap-1.5 pl-2 text-white/80">
111+
<li>
112+
✨ Detailed move evaluations tailored to different rating
113+
levels
114+
</li>
115+
<li>
116+
🧠 Insights into how players of various strengths approach the
117+
game
118+
</li>
119+
<li>
120+
⚡ Faster, local analysis without needing to send data to a
121+
server
122+
</li>
123+
</ul>
124+
<p className="text-white/80">
125+
Maia 2 runs entirely on your device and requires a one-time 90mb
126+
download.
127+
</p>
128+
</div>
126129
</div>
127130

128-
<div className="mt-4 flex w-full flex-col items-end justify-end gap-2 md:mt-6 md:flex-row">
131+
<div className="mt-6 flex flex-shrink-0 w-full flex-col items-end justify-end gap-2 md:flex-row">
129132
{progress ? (
130133
<div className="relative order-2 flex h-8 w-full items-center overflow-hidden rounded-md border border-glass-border bg-glass px-3 md:order-1 md:h-10 md:flex-1">
131134
<p className="z-10 text-xs text-white/90 md:text-sm">
@@ -141,7 +144,7 @@ export const DownloadModelModal: React.FC<Props> = ({
141144
<div className="order-1 flex flex-row gap-2 md:order-2">
142145
<Link
143146
href="/"
144-
className="group flex h-8 cursor-pointer select-none items-center gap-2 rounded border border-glass-border bg-glass px-3 text-sm text-white/90 transition-all duration-200 hover:bg-glass-strong md:h-10 md:px-4"
147+
className="group flex cursor-pointer select-none items-center gap-2 rounded border border-glass-border bg-glass px-3 py-1.5 text-sm text-white/90 transition-all duration-200 hover:bg-glass-strong md:px-4"
145148
>
146149
<span className="material-symbols-outlined text-base text-secondary group-hover:text-primary md:text-lg">
147150
home
@@ -152,7 +155,7 @@ export const DownloadModelModal: React.FC<Props> = ({
152155
<div
153156
tabIndex={0}
154157
role="button"
155-
className={`flex h-8 select-none items-center gap-2 rounded px-3 text-sm text-white transition-all duration-200 md:h-10 md:px-4 ${
158+
className={`flex select-none items-center gap-2 rounded px-3 py-1.5 text-sm text-white transition-all duration-200 md:px-4 ${
156159
isDownloading || progress >= 100
157160
? 'cursor-not-allowed border border-human-4/30 bg-human-4/50'
158161
: 'cursor-pointer border border-glass-border bg-human-4 hover:bg-human-3'

0 commit comments

Comments
 (0)