@@ -7,10 +7,11 @@ export default function CookieConsent() {
77 const [ visible , setVisible ] = useState ( false )
88
99 useEffect ( ( ) => {
10+ // Check if consent was already given
1011 const consent = localStorage . getItem ( 'cookie-consent' )
1112 if ( ! consent ) {
12- // Delay showing for a better UX
13- const timer = setTimeout ( ( ) => setVisible ( true ) , 1500 )
13+ // Small delay to ensure smooth hydration and visibility
14+ const timer = setTimeout ( ( ) => setVisible ( true ) , 500 )
1415 return ( ) => clearTimeout ( timer )
1516 }
1617 } , [ ] )
@@ -29,10 +30,10 @@ export default function CookieConsent() {
2930
3031 return (
3132 < div
32- className = "fixed bottom-0 left-0 right-0 z-50 p-4 sm:p-6"
33- style = { { animation : 'fadeInUp 0.4s ease-out' } }
33+ className = "fixed bottom-0 left-0 right-0 z-[200] p-4 sm:p-6 transition-all duration-500 transform translate-y-0 "
34+ style = { { animation : 'fadeIn 0.5s ease-out' } }
3435 >
35- < div className = "max-w-4xl mx-auto bg-white border border-gray-200 rounded-2xl shadow-2xl p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center gap-4 sm:gap-6" >
36+ < div className = "max-w-4xl mx-auto bg-white border border-gray-200 rounded-2xl shadow-2xl p-6 sm:p-8 flex flex-col sm:flex-row items-start sm:items-center gap-4 sm:gap-6 ring-1 ring-black/5 " >
3637 < div className = "flex-1" >
3738 < p className = "text-sm text-gray-600 leading-relaxed" >
3839 < span className = "font-bold text-gray-900" > 🍪 Cookie Notice: </ span >
@@ -45,18 +46,16 @@ export default function CookieConsent() {
4546 for more information.
4647 </ p >
4748 </ div >
48- < div className = "flex gap-3 shrink-0" >
49+ < div className = "flex gap-3 shrink-0 w-full sm:w-auto " >
4950 < button
5051 onClick = { decline }
51- className = "px-5 py-2.5 text-sm font-semibold text-gray-600 bg-gray-100 rounded-xl hover:bg-gray-200 transition-colors"
52- id = "cookie-decline-btn"
52+ className = "flex-1 sm:flex-none px-6 py-3 text-sm font-bold text-gray-600 bg-gray-50 border border-gray-100 rounded-xl hover:bg-gray-100 transition-colors"
5353 >
5454 Decline
5555 </ button >
5656 < button
5757 onClick = { accept }
58- className = "px-5 py-2.5 text-sm font-semibold text-white bg-blue-600 rounded-xl hover:bg-blue-700 transition-colors shadow-sm"
59- id = "cookie-accept-btn"
58+ className = "flex-1 sm:flex-none px-6 py-3 text-sm font-bold text-white bg-blue-600 rounded-xl hover:bg-blue-700 transition-all shadow-lg shadow-blue-100 active:scale-95"
6059 >
6160 Accept All
6261 </ button >
0 commit comments