Enhance ContactForm and CookieBanner components for improved accessibility and user feedback
- Added CSRF token handling in the ContactForm for enhanced security. - Introduced a feedback div for displaying form submission results instead of alerts. - Updated the CookieBanner to include ARIA roles and improved focus management for better accessibility. - Refactored manual review email handling to escape HTML special characters, enhancing security.
This commit is contained in:
@@ -9,9 +9,14 @@ const t = getTranslation(lang);
|
||||
id="cookie-banner"
|
||||
class="fixed bottom-0 left-0 right-0 z-50 p-4 content-backdrop shadow-lg transform transition-transform duration-300 translate-y-full"
|
||||
style="display: none;"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="cookie-banner-title"
|
||||
tabindex="-1"
|
||||
>
|
||||
<div class="container mx-auto max-w-6xl flex flex-col sm:flex-row items-center justify-between gap-4">
|
||||
<div class="text-sm text-gray-800 dark:text-gray-200 font-medium">
|
||||
<h2 id="cookie-banner-title" class="sr-only">Cookie Consent</h2>
|
||||
<p>
|
||||
{t.cookies.message}
|
||||
<a href={`/${lang}/privacy#cookie-usage`} class="text-blue-600 dark:text-blue-400 hover:underline"
|
||||
@@ -83,6 +88,7 @@ const t = getTranslation(lang);
|
||||
// Show the banner with a slight delay for better UX
|
||||
setTimeout(() => {
|
||||
cookieBanner.classList.remove('translate-y-full');
|
||||
cookieBanner.focus();
|
||||
}, 500);
|
||||
|
||||
// Handle accept button click
|
||||
|
Reference in New Issue
Block a user