From fa0214e24921c17ef2a34efabaf9ce491772532d Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:28:14 +0000 Subject: [PATCH] Park_detail updates, making the map smaller, merging "Quick Facts" into the header. --- docs/2024-02-14/changes.md | 22 +++++ static/css/tailwind.css | 56 +++++++++++ templates/parks/park_detail.html | 161 ++++++++++++++++--------------- 3 files changed, 161 insertions(+), 78 deletions(-) diff --git a/docs/2024-02-14/changes.md b/docs/2024-02-14/changes.md index af979e9b..71713069 100644 --- a/docs/2024-02-14/changes.md +++ b/docs/2024-02-14/changes.md @@ -22,6 +22,28 @@ - Added proper CORS and CSRF configurations for development - Improved authentication backend configuration +## Park Detail Page Layout Updates +- Moved Quick Facts section from right column into header section for better information visibility +- Relocated map from left column to right column to improve content flow +- Added ride counts (Total Rides and Roller Coasters) to the header status badges +- Made the Location map card dynamically square, matching height to width +- Adjusted grid layout to maintain responsive design +- Added resize handling to ensure map stays square when browser window is resized + +### Technical Details +- Modified templates/parks/park_detail.html +- Restructured grid layout classes +- Added JavaScript to maintain square aspect ratio for map +- Added window resize event handler for map container +- Reorganized content sections for better user experience + +### Rationale +- Quick Facts are now more immediately visible to users in the header +- Map placement in right column provides better content hierarchy +- Square map provides better visual balance and consistency +- Ride counts in header give immediate overview of park size +- Changes improve overall page readability and information accessibility + ## How to Run Development Environment 1. Ensure PostgreSQL is running and database is created 2. Set up your ***REMOVED*** file with necessary environment variables diff --git a/static/css/tailwind.css b/static/css/tailwind.css index ce7c6e4e..5cb989cd 100644 --- a/static/css/tailwind.css +++ b/static/css/tailwind.css @@ -2547,6 +2547,10 @@ select { cursor: pointer; } +.resize { + resize: both; +} + .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } @@ -2856,6 +2860,11 @@ select { background-color: rgb(202 138 4 / var(--tw-bg-opacity)); } +.bg-purple-100 { + --tw-bg-opacity: 1; + background-color: rgb(243 232 255 / var(--tw-bg-opacity)); +} + .bg-opacity-50 { --tw-bg-opacity: 0.5; } @@ -3156,6 +3165,11 @@ select { color: rgb(133 77 14 / var(--tw-text-opacity)); } +.text-purple-800 { + --tw-text-opacity: 1; + color: rgb(107 33 168 / var(--tw-text-opacity)); +} + .opacity-0 { opacity: 0; } @@ -3555,6 +3569,11 @@ select { background-color: rgb(113 63 18 / var(--tw-bg-opacity)); } +.dark\:bg-purple-700:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(126 34 206 / var(--tw-bg-opacity)); +} + .dark\:from-gray-950:is(.dark *) { --tw-gradient-from: #030712 var(--tw-gradient-from-position); --tw-gradient-to: rgb(3 7 18 / 0) var(--tw-gradient-to-position); @@ -3670,6 +3689,11 @@ select { color: rgb(254 252 232 / var(--tw-text-opacity)); } +.dark\:text-purple-50:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(250 245 255 / var(--tw-text-opacity)); +} + .dark\:ring-1:is(.dark *) { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); @@ -3806,6 +3830,18 @@ select { grid-column: span 2 / span 2; } + .lg\:mb-0 { + margin-bottom: 0px; + } + + .lg\:mr-6 { + margin-right: 1.5rem; + } + + .lg\:mt-0 { + margin-top: 0px; + } + .lg\:flex { display: flex; } @@ -3814,6 +3850,14 @@ select { display: none; } + .lg\:w-1\/3 { + width: 33.333333%; + } + + .lg\:flex-1 { + flex: 1 1 0%; + } + .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } @@ -3822,6 +3866,18 @@ select { grid-template-columns: repeat(4, minmax(0, 1fr)); } + .lg\:flex-row { + flex-direction: row; + } + + .lg\:items-start { + align-items: flex-start; + } + + .lg\:justify-between { + justify-content: space-between; + } + .lg\:text-6xl { font-size: 3.75rem; line-height: 1; diff --git a/templates/parks/park_detail.html b/templates/parks/park_detail.html index 17405298..2799612e 100644 --- a/templates/parks/park_detail.html +++ b/templates/parks/park_detail.html @@ -5,10 +5,10 @@ {% block content %}
@@ -34,10 +34,56 @@ {{ park.average_rating|floatformat:1 }}/10 {% endif %} + {% if park.total_rides %} + + {{ park.total_rides }} Rides + + {% endif %} + {% if park.total_roller_coasters %} + + {{ park.total_roller_coasters }} Roller Coasters + + {% endif %}