From 6391b3d81cbec9c3e2f19842fbef762c98f4dc5d Mon Sep 17 00:00:00 2001
From: pac7 <47831526-pac7@users.noreply.replit.com>
Date: Tue, 23 Sep 2025 22:25:16 +0000
Subject: [PATCH] Enhance website accessibility and improve user interface
elements
Introduce ARIA attributes, improve focus management, and refine UI element styling for better accessibility and user experience across the application.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: c446bc9e-66df-438c-a86c-f53e6da13649
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
---
.replit | 8 +--
static/css/tailwind.css | 36 ++++++++---
templates/cotton/enhanced_search.html | 57 +++++++++++++----
templates/cotton/filter_chips.html | 18 +++---
templates/cotton/park_card.html | 92 ++++++++++++++++-----------
templates/cotton/result_stats.html | 10 +--
templates/cotton/sort_controls.html | 14 ++--
templates/cotton/view_toggle.html | 6 +-
templates/parks/park_list.html | 55 +++++++++-------
9 files changed, 189 insertions(+), 107 deletions(-)
diff --git a/.replit b/.replit
index a0a35a63..7f53545a 100644
--- a/.replit
+++ b/.replit
@@ -54,14 +54,14 @@ outputType = "webview"
localPort = 5000
externalPort = 80
-[[ports]]
-localPort = 33323
-externalPort = 3002
-
[[ports]]
localPort = 41923
externalPort = 3000
+[[ports]]
+localPort = 44757
+externalPort = 3002
+
[[ports]]
localPort = 45245
externalPort = 3001
diff --git a/static/css/tailwind.css b/static/css/tailwind.css
index 0847611e..74a0f20b 100644
--- a/static/css/tailwind.css
+++ b/static/css/tailwind.css
@@ -809,9 +809,6 @@
.min-h-20 {
min-height: calc(var(--spacing) * 20);
}
- .min-h-\[24px\] {
- min-height: 24px;
- }
.min-h-\[44px\] {
min-height: 44px;
}
@@ -947,9 +944,6 @@
.min-w-16 {
min-width: calc(var(--spacing) * 16);
}
- .min-w-\[24px\] {
- min-width: 24px;
- }
.min-w-\[44px\] {
min-width: 44px;
}
@@ -3091,6 +3085,11 @@
left: calc(var(--spacing) * 4);
}
}
+ .focus\:left-32 {
+ &:focus {
+ left: calc(var(--spacing) * 32);
+ }
+ }
.focus\:z-50 {
&:focus {
z-index: 50;
@@ -3162,6 +3161,11 @@
--tw-ring-color: var(--color-blue-500);
}
}
+ .focus\:ring-gray-500 {
+ &:focus {
+ --tw-ring-color: var(--color-gray-500);
+ }
+ }
.focus\:ring-green-500 {
&:focus {
--tw-ring-color: var(--color-green-500);
@@ -3193,6 +3197,12 @@
--tw-ring-color: var(--color-yellow-500);
}
}
+ .focus\:ring-offset-1 {
+ &:focus {
+ --tw-ring-offset-width: 1px;
+ --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
+ }
+ }
.focus\:ring-offset-2 {
&:focus {
--tw-ring-offset-width: 2px;
@@ -3215,6 +3225,11 @@
outline-style: none;
}
}
+ .focus\:ring-inset {
+ &:focus {
+ --tw-ring-inset: inset;
+ }
+ }
.focus-visible\:ring-2 {
&:focus-visible {
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
@@ -3371,6 +3386,11 @@
min-height: calc(var(--spacing) * 0);
}
}
+ .sm\:min-h-\[32px\] {
+ @media (width >= 40rem) {
+ min-height: 32px;
+ }
+ }
.sm\:min-h-\[400px\] {
@media (width >= 40rem) {
min-height: 400px;
@@ -3406,9 +3426,9 @@
width: auto;
}
}
- .sm\:min-w-0 {
+ .sm\:min-w-\[32px\] {
@media (width >= 40rem) {
- min-width: calc(var(--spacing) * 0);
+ min-width: 32px;
}
}
.sm\:flex-1 {
diff --git a/templates/cotton/enhanced_search.html b/templates/cotton/enhanced_search.html
index 90440d13..40e502da 100644
--- a/templates/cotton/enhanced_search.html
+++ b/templates/cotton/enhanced_search.html
@@ -90,16 +90,17 @@ Features:
@click.away="open = false">
-
-
-
+
+
-
+
-
-
-
+
@@ -229,4 +245,19 @@ Features:
{% endif %}
+
+
+
+ Type to search parks. Use arrow keys to navigate suggestions, Enter to select, or Escape to close.
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/cotton/filter_chips.html b/templates/cotton/filter_chips.html
index 2cea939d..f8c342bc 100644
--- a/templates/cotton/filter_chips.html
+++ b/templates/cotton/filter_chips.html
@@ -28,10 +28,10 @@ Features:
/>
{% if filters %}
-
+
{% for filter_name, filter_value in filters.items %}
{% if filter_value and filter_name != 'page' and filter_name != 'view_mode' %}
-
+
{{ filter_name|title }}:
{% if filter_value == 'True' %}
@@ -44,15 +44,15 @@ Features:
-
+
@@ -63,15 +63,15 @@ Features:
{% if filters|length > 1 %}
-
+
Clear all
diff --git a/templates/cotton/park_card.html b/templates/cotton/park_card.html
index ff51d00f..c0e8244c 100644
--- a/templates/cotton/park_card.html
+++ b/templates/cotton/park_card.html
@@ -48,8 +48,8 @@ Features:
{% if park %}
{% if view_mode == 'list' %}
- {# Enhanced List View Item with CloudFlare Images #}
-
+ {# Enhanced List View Item with CloudFlare Images and Accessibility #}
+
{# Enhanced List View Image Section #}
@@ -92,7 +92,7 @@ Features:
{% endif %}
- {# List View Status Badge Overlay #}
+ {# List View Status Badge Overlay with Accessibility #}
- {{ park.get_status_display }}
- {{ park.get_status_display|truncatechars:3 }}
+ {% else %}text-gray-700 border-gray-200{% endif %}"
+ role="img"
+ aria-label="Park status: {{ park.get_status_display }}"
+ title="Park status: {{ park.get_status_display }}">
+ {{ park.get_status_display }}
+ {{ park.get_status_display|truncatechars:3 }}
@@ -113,9 +116,9 @@ Features:
{# Enhanced Main Content Section with Better Mobile Layout #}
- {# Enhanced Title with Better Mobile Typography #}
+ {# Enhanced Title with Better Mobile Typography and Accessibility #}
-
+
{# View Details Arrow for Mobile #}
@@ -147,9 +150,9 @@ Features:
{% endif %}
- {# Enhanced Description #}
+ {# Enhanced Description with Accessibility #}
{% if park.description %}
-
+
{{ park.description|truncatewords:30 }}
{% endif %}
@@ -160,21 +163,27 @@ Features:
{% if park.ride_count %}
-
-
+
+
-
{{ park.ride_count }}
-
rides
+
{{ park.ride_count }}
+
rides
{% endif %}
{% if park.coaster_count %}
-
-
+
+
-
{{ park.coaster_count }}
-
coasters
+
{{ park.coaster_count }}
+
coasters
{% endif %}
@@ -201,8 +210,8 @@ Features:
{% else %}
- {# Enhanced Grid View Item #}
-
+ {# Enhanced Grid View Item with Accessibility #}
+
{# Enhanced Park Image with CloudFlare Images Integration #}
{% if park.card_image.image or park.photos.first.image %}
@@ -258,7 +267,7 @@ Features:
{% endif %}
- {# Enhanced Status Badge Overlay with Better Mobile Touch Targets #}
+ {# Enhanced Status Badge Overlay with Better Mobile Touch Targets and Accessibility #}
- {{ park.get_status_display }}
+ {% else %}text-gray-700 border-gray-200{% endif %}"
+ role="img"
+ aria-label="Park status: {{ park.get_status_display }}"
+ title="Park status: {{ park.get_status_display }}">
+ {{ park.get_status_display }}
@@ -280,8 +292,8 @@ Features:
{# Enhanced Content Area with Better Mobile Optimization #}
- {# Enhanced Title with Better Mobile Typography #}
-
+ {# Enhanced Title with Better Mobile Typography and Accessibility #}
+
{% if park.slug %}
{% endif %}
-
+
{# Enhanced Operator Display with Better Mobile Layout #}
@@ -306,9 +318,9 @@ Features:
{% endif %}
- {# Enhanced Description with Better Mobile Readability #}
+ {# Enhanced Description with Better Mobile Readability and Accessibility #}
{% if park.description %}
-
+
{{ park.description|truncatewords:15 }}
{% endif %}
@@ -318,21 +330,27 @@ Features:
{% if park.ride_count %}
-
-
+
+
-
{{ park.ride_count }}
-
rides
+
{{ park.ride_count }}
+
rides
{% endif %}
{% if park.coaster_count %}
-
-
+
+
-
{{ park.coaster_count }}
-
coasters
+
{{ park.coaster_count }}
+
coasters
{% endif %}
diff --git a/templates/cotton/result_stats.html b/templates/cotton/result_stats.html
index 7e96f741..0022dfda 100644
--- a/templates/cotton/result_stats.html
+++ b/templates/cotton/result_stats.html
@@ -44,7 +44,7 @@ Features:
class=""
/>
-
+
@@ -74,11 +74,11 @@ Features:
{% if filter_count and filter_count > 0 %}
-
-
+
+
-
{{ filter_count }} filter{{ filter_count|pluralize }} active
+
{{ filter_count }} filter{{ filter_count|pluralize }} active
{% endif %}
@@ -103,7 +103,7 @@ Features:
{% if total_results == 0 and is_search %}
-
+
diff --git a/templates/cotton/sort_controls.html b/templates/cotton/sort_controls.html
index 24318cc6..b0d617de 100644
--- a/templates/cotton/sort_controls.html
+++ b/templates/cotton/sort_controls.html
@@ -39,11 +39,12 @@ Features:
type="button"
class="inline-flex items-center justify-center w-full px-3 sm:px-4 py-2.5 sm:py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-all duration-200 min-h-[44px] sm:min-h-0"
@click="open = !open"
- aria-expanded="true"
+ :aria-expanded="open"
aria-haspopup="true"
- aria-label="Sort options"
+ aria-label="Sort options menu"
+ id="sort-menu-button"
>
-
+
Sort by
@@ -72,7 +73,7 @@ Features:
: {{ current_sort }}
{% endif %}
{% endif %}
-
+
@@ -90,18 +91,19 @@ Features:
@click.away="open = false"
style="display: none;"
>
-
+
{% if options %}
{% for option in options %}
{% if current_sort == option.value %}
diff --git a/templates/cotton/view_toggle.html b/templates/cotton/view_toggle.html
index ea0a0e9f..ba09ea6f 100644
--- a/templates/cotton/view_toggle.html
+++ b/templates/cotton/view_toggle.html
@@ -30,7 +30,7 @@ Features:
class=""
/>
-
+
-
+
Grid
@@ -59,7 +59,7 @@ Features:
aria-pressed="{% if current_view == 'list' %}true{% else %}false{% endif %}"
title="List view"
>
-
+
List
diff --git a/templates/parks/park_list.html b/templates/parks/park_list.html
index 24977c2e..afa71728 100644
--- a/templates/parks/park_list.html
+++ b/templates/parks/park_list.html
@@ -5,46 +5,57 @@
{% block title %}Parks{% endblock %}
{% block content %}
-{# Enhanced Mobile-First Container with Better Spacing #}
+{# Skip Navigation Links for Keyboard Users #}
+
+ Skip to main content
+
+
+ Skip to search
+
+
+{# Enhanced Mobile-First Container with Better Spacing and Landmarks #}
{# Enhanced Mobile-First Header Section #}
-