@@ -16,6 +16,7 @@ import { Switch } from '@/components/ui/switch';
1616import { BoundlessButton } from '@/components/buttons/BoundlessButton' ;
1717import { slideInFromBottomLeft } from '@/lib/motion' ;
1818import { CookiePreferences } from '@/hooks/use-cookie-consent' ;
19+ import Image from 'next/image' ;
1920
2021const COOKIE_CONSENT_KEY = 'cookie-consent' ;
2122const COOKIE_PREFERENCES_KEY = 'cookie-preferences' ;
@@ -154,71 +155,85 @@ const CookieConsent: React.FC = () => {
154155 animate = 'visible'
155156 exit = 'hidden'
156157 variants = { slideInFromBottomLeft }
157- className = 'fixed right-4 bottom-4 left-4 z-50 mx-auto w-full max-w-md sm:right-auto sm:left-4 sm:max-w-lg'
158+ className = 'fixed right-0 bottom-0 left-0 z-50 mx-auto w-full max-w-md px-3 pb-3 sm:right-auto sm:bottom-4 sm: left-4 sm:max-w-lg sm:px-0 sm:pb-0 '
158159 role = 'dialog'
159160 aria-labelledby = 'cookie-consent-title'
160161 aria-describedby = 'cookie-consent-description'
161162 >
162- < div className = 'rounded-2xl border border-zinc-800 bg-zinc-900 p-4 shadow-2xl sm:p-6' >
163- < div className = 'mb-4 flex items-start gap-3' >
164- < div className = 'flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-800' >
165- < Cookie className = 'h-5 w-5 text-white' />
166- </ div >
167- < div className = 'flex-1' >
168- < h3
169- id = 'cookie-consent-title'
170- className = 'mb-2 text-lg font-semibold text-white'
171- >
172- We use cookies to enhance your experience
173- </ h3 >
174- < p
175- id = 'cookie-consent-description'
176- className = 'mb-4 text-sm text-zinc-400'
177- >
178- We use cookies to analyze site usage and personalize
179- content. By continuing, you agree to our use of cookies.
180- </ p >
181- </ div >
163+ < div className = 'relative overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-900 p-4 shadow-2xl sm:rounded-2xl sm:p-6' >
164+ { /* Background Wave Image */ }
165+ < div className = 'absolute right-0 bottom-0 h-full w-full overflow-hidden rounded-2xl opacity-5' >
166+ < Image
167+ src = '/wave.svg'
168+ alt = ''
169+ fill
170+ className = 'object-cover object-bottom-right'
171+ priority = { false }
172+ />
182173 </ div >
183174
184- < div className = 'flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between' >
185- < div className = 'flex flex-wrap items-center gap-2' >
186- < Link
187- href = '/privacy'
188- className = 'text-primary focus:ring-primary rounded text-sm hover:underline focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none'
189- >
190- Learn More
191- </ Link >
175+ { /* Content Layer */ }
176+ < div className = 'relative z-10' >
177+ < div className = 'mb-4 flex items-start gap-3' >
178+ < div className = 'flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-800 sm:h-10 sm:w-10' >
179+ < Cookie className = 'h-5 w-5 text-white' />
180+ </ div >
181+ < div className = 'min-w-0 flex-1' >
182+ < h3
183+ id = 'cookie-consent-title'
184+ className = 'mb-2 text-base leading-tight font-semibold text-white sm:text-lg'
185+ >
186+ We use cookies to enhance your experience
187+ </ h3 >
188+ < p
189+ id = 'cookie-consent-description'
190+ className = 'mb-4 text-xs leading-relaxed text-zinc-400 sm:text-sm'
191+ >
192+ We use cookies to analyze site usage and personalize
193+ content. By continuing, you agree to our use of cookies.
194+ </ p >
195+ </ div >
192196 </ div >
193197
194- < div className = 'flex flex-col gap-2 sm:flex-row' >
195- < BoundlessButton
196- variant = 'outline'
197- size = 'sm'
198- onClick = { handleReject }
199- className = 'border-zinc-800 bg-zinc-900/50 text-white hover:bg-zinc-800 hover:text-white'
200- aria-label = 'Reject all cookies'
201- >
202- Reject
203- </ BoundlessButton >
204- < BoundlessButton
205- variant = 'outline'
206- size = 'sm'
207- onClick = { ( ) => setShowCustomize ( true ) }
208- className = 'border-zinc-800 bg-zinc-900/50 text-white hover:bg-zinc-800 hover:text-white'
209- aria-label = 'Customize cookie preferences'
210- >
211- Customize
212- </ BoundlessButton >
213- < BoundlessButton
214- variant = 'default'
215- size = 'sm'
216- onClick = { handleAcceptAll }
217- className = 'bg-primary text-primary-foreground'
218- aria-label = 'Accept all cookies'
219- >
220- Accept All
221- </ BoundlessButton >
198+ < div className = 'flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between' >
199+ < div className = 'flex flex-wrap items-center gap-2' >
200+ < Link
201+ href = '/privacy'
202+ className = 'text-primary focus:ring-primary rounded text-xs hover:underline focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none sm:text-sm'
203+ >
204+ Learn More
205+ </ Link >
206+ </ div >
207+
208+ < div className = 'flex w-full flex-col gap-2 sm:w-auto sm:flex-row' >
209+ < BoundlessButton
210+ variant = 'outline'
211+ size = 'sm'
212+ onClick = { handleReject }
213+ className = 'w-full border-zinc-800 bg-zinc-900/50 text-white hover:bg-zinc-800 hover:text-white sm:w-auto'
214+ aria-label = 'Reject all cookies'
215+ >
216+ Reject
217+ </ BoundlessButton >
218+ < BoundlessButton
219+ variant = 'outline'
220+ size = 'sm'
221+ onClick = { ( ) => setShowCustomize ( true ) }
222+ className = 'w-full border-zinc-800 bg-zinc-900/50 text-white hover:bg-zinc-800 hover:text-white sm:w-auto'
223+ aria-label = 'Customize cookie preferences'
224+ >
225+ Customize
226+ </ BoundlessButton >
227+ < BoundlessButton
228+ variant = 'default'
229+ size = 'sm'
230+ onClick = { handleAcceptAll }
231+ className = 'bg-primary text-primary-foreground w-full sm:w-auto'
232+ aria-label = 'Accept all cookies'
233+ >
234+ Accept All
235+ </ BoundlessButton >
236+ </ div >
222237 </ div >
223238 </ div >
224239 </ div >
@@ -227,30 +242,30 @@ const CookieConsent: React.FC = () => {
227242 </ AnimatePresence >
228243
229244 < Dialog open = { showCustomize } onOpenChange = { setShowCustomize } >
230- < DialogContent className = 'max-w-2xl border-zinc-800 bg-zinc-900 text-white' >
245+ < DialogContent className = 'max-w-2xl border-zinc-800 bg-zinc-900 text-white sm:max-w-2xl ' >
231246 < DialogHeader >
232- < DialogTitle className = 'text-xl text-white' >
247+ < DialogTitle className = 'text-lg text-white sm:text-xl ' >
233248 Cookie Preferences
234249 </ DialogTitle >
235- < DialogDescription className = 'text-zinc-400' >
250+ < DialogDescription className = 'text-xs text- zinc-400 sm:text-sm ' >
236251 Manage your cookie preferences. You can enable or disable
237252 different types of cookies below.
238253 </ DialogDescription >
239254 </ DialogHeader >
240255
241- < div className = 'space-y-6 py-4' >
256+ < div className = 'space-y-4 py-4 sm:space-y-6 ' >
242257 { /* Essential Cookies */ }
243- < div className = 'flex items-start justify-between gap-4 rounded-lg border border-zinc-800 bg-zinc-900/50 p-4' >
244- < div className = 'flex-1' >
245- < div className = 'mb-1 flex items-center gap-2' >
246- < h4 className = 'font-semibold text-white' >
258+ < div className = 'flex flex-col gap-3 rounded-lg border border-zinc-800 bg-zinc-900/50 p-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4 sm: p-4' >
259+ < div className = 'min-w-0 flex-1' >
260+ < div className = 'mb-1 flex flex-wrap items-center gap-2' >
261+ < h4 className = 'text-sm font-semibold text-white sm:text-base ' >
247262 Essential Cookies
248263 </ h4 >
249264 < span className = 'rounded bg-zinc-800 px-2 py-0.5 text-xs text-zinc-400' >
250265 Always Active
251266 </ span >
252267 </ div >
253- < p className = 'text-sm text-zinc-400' >
268+ < p className = 'text-xs leading-relaxed text-zinc-400 sm:text-sm ' >
254269 These cookies are necessary for the website to function and
255270 cannot be switched off. They are usually only set in response
256271 to actions made by you.
@@ -259,18 +274,18 @@ const CookieConsent: React.FC = () => {
259274 < Switch
260275 checked = { true }
261276 disabled
262- className = 'mt-1'
277+ className = 'shrink-0 sm: mt-1'
263278 aria-label = 'Essential cookies (always enabled)'
264279 />
265280 </ div >
266281
267282 { /* Analytics Cookies */ }
268- < div className = 'flex items-start justify-between gap-4 rounded-lg border border-zinc-800 bg-zinc-900/50 p-4' >
269- < div className = 'flex-1' >
270- < h4 className = 'mb-1 font-semibold text-white' >
283+ < div className = 'flex flex-col gap-3 rounded-lg border border-zinc-800 bg-zinc-900/50 p-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4 sm: p-4' >
284+ < div className = 'min-w-0 flex-1' >
285+ < h4 className = 'mb-1 text-sm font-semibold text-white sm:text-base ' >
271286 Analytics Cookies
272287 </ h4 >
273- < p className = 'text-sm text-zinc-400' >
288+ < p className = 'text-xs leading-relaxed text-zinc-400 sm:text-sm ' >
274289 These cookies help us understand how visitors interact with
275290 our website by collecting and reporting information
276291 anonymously.
@@ -284,18 +299,18 @@ const CookieConsent: React.FC = () => {
284299 analytics : checked ,
285300 } ) )
286301 }
287- className = 'mt-1'
302+ className = 'shrink-0 sm: mt-1'
288303 aria-label = 'Enable analytics cookies'
289304 />
290305 </ div >
291306
292307 { /* Marketing Cookies */ }
293- < div className = 'flex items-start justify-between gap-4 rounded-lg border border-zinc-800 bg-zinc-900/50 p-4' >
294- < div className = 'flex-1' >
295- < h4 className = 'mb-1 font-semibold text-white' >
308+ < div className = 'flex flex-col gap-3 rounded-lg border border-zinc-800 bg-zinc-900/50 p-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4 sm: p-4' >
309+ < div className = 'min-w-0 flex-1' >
310+ < h4 className = 'mb-1 text-sm font-semibold text-white sm:text-base ' >
296311 Marketing Cookies
297312 </ h4 >
298- < p className = 'text-sm text-zinc-400' >
313+ < p className = 'text-xs leading-relaxed text-zinc-400 sm:text-sm ' >
299314 These cookies may be set through our site by our advertising
300315 partners to build a profile of your interests.
301316 </ p >
@@ -308,7 +323,7 @@ const CookieConsent: React.FC = () => {
308323 marketing : checked ,
309324 } ) )
310325 }
311- className = 'mt-1'
326+ className = 'shrink-0 sm: mt-1'
312327 aria-label = 'Enable marketing cookies'
313328 />
314329 </ div >
@@ -318,14 +333,14 @@ const CookieConsent: React.FC = () => {
318333 < BoundlessButton
319334 variant = 'outline'
320335 onClick = { handleCustomizeAcceptAll }
321- className = 'border-zinc-800 bg-zinc-900/50 text-white hover:bg-zinc-800 hover:text-white'
336+ className = 'w-full border-zinc-800 bg-zinc-900/50 text-white hover:bg-zinc-800 hover:text-white sm:w-auto '
322337 >
323338 Accept All
324339 </ BoundlessButton >
325340 < BoundlessButton
326341 variant = 'default'
327342 onClick = { handleSaveCustomPreferences }
328- className = 'bg-primary text-primary-foreground'
343+ className = 'bg-primary text-primary-foreground w-full sm:w-auto '
329344 >
330345 Save Preferences
331346 </ BoundlessButton >
0 commit comments