From 5bcd006503d59714e10e107036bc1ad2bc4ae89e Mon Sep 17 00:00:00 2001 From: Kobe Date: Thu, 22 May 2025 23:11:44 +0200 Subject: [PATCH] gsf --- static/css/tooltip.css | 88 +++++++++++++++++++++++++++++++ templates/home.html | 114 ++++++++++++++++++----------------------- templates/post.html | 14 ++--- 3 files changed, 144 insertions(+), 72 deletions(-) diff --git a/static/css/tooltip.css b/static/css/tooltip.css index f8624da..785845a 100644 --- a/static/css/tooltip.css +++ b/static/css/tooltip.css @@ -2,6 +2,42 @@ position: relative; display: inline-flex; align-items: center; + transition: background-color 0.2s ease; +} + +/* Climate tag hover */ +.tag-tooltip[data-type="climate"]:hover { + background-color: #b7d9b9 !important; +} + +/* Environment tag hover */ +.tag-tooltip[data-type="environment"]:hover { + background-color: #c7e0db !important; +} + +/* Light tag hover */ +.tag-tooltip[data-type="light"]:hover { + background-color: #d0d7cc !important; +} + +/* Toxicity tag hover */ +.tag-tooltip[data-type="toxicity"]:hover { + background-color: #ffe4cc !important; +} + +/* Size tag hover */ +.tag-tooltip[data-type="size"]:hover { + background-color: #d0e7e4 !important; +} + +/* Care difficulty tag hover */ +.tag-tooltip[data-type="care-difficulty"]:hover { + background-color: #e6d0ff !important; +} + +/* Growth rate tag hover */ +.tag-tooltip[data-type="growth-rate"]:hover { + background-color: #e6f0cc !important; } .tag-tooltip .tooltip-text { @@ -50,4 +86,56 @@ top: auto; bottom: 100%; border-color: transparent transparent #4e6b50 transparent; +} + +/* Tooltip background for each tag type */ +.tag-tooltip[data-type="climate"] .tooltip-text { + background-color: #d0e7d2; + color: #3e5637; +} +.tag-tooltip[data-type="environment"] .tooltip-text { + background-color: #e0f0eb; + color: #3e5637; +} +.tag-tooltip[data-type="light"] .tooltip-text { + background-color: #e6ebe0; + color: #3e5637; +} +.tag-tooltip[data-type="toxicity"] .tooltip-text { + background-color: #fff4e6; + color: #3e5637; +} +.tag-tooltip[data-type="size"] .tooltip-text { + background-color: #e6f7f5; + color: #3e5637; +} +.tag-tooltip[data-type="care-difficulty"] .tooltip-text { + background-color: #f3e6ff; + color: #3e5637; +} +.tag-tooltip[data-type="growth-rate"] .tooltip-text { + background-color: #f7fae6; + color: #3e5637; +} + +.tag-tooltip[data-type="climate"] .tooltip-text::after { + border-color: #d0e7d2 transparent transparent transparent; +} +.tag-tooltip[data-type="environment"] .tooltip-text::after { + border-color: #e0f0eb transparent transparent transparent; +} +.tag-tooltip[data-type="light"] .tooltip-text::after { + border-color: #e6ebe0 transparent transparent transparent; +} +.tag-tooltip[data-type="toxicity"] .tooltip-text::after { + border-color: #fff4e6 transparent transparent transparent; +} +.tag-tooltip[data-type="size"] .tooltip-text::after { + border-color: #e6f7f5 transparent transparent transparent; +} +.tag-tooltip[data-type="care-difficulty"] .tooltip-text::after { + border-color: #f3e6ff transparent transparent transparent; +} +.tag-tooltip[data-type="growth-rate"] .tooltip-text::after { + border-color: #f7fae6 transparent transparent transparent; } \ No newline at end of file diff --git a/templates/home.html b/templates/home.html index 72327bc..8136d0f 100644 --- a/templates/home.html +++ b/templates/home.html @@ -104,71 +104,55 @@

{{ plant.name }}

- {% if plant.climate %} - - {% if plant.climate_icon %} - Climate icon - {% endif %} - {{ plant.climate }} - {{ plant.climate_description }} - - {% endif %} - {% if plant.environment %} - - {% if plant.environment_icon %} - Environment icon - {% endif %} - {{ plant.environment }} - {{ plant.environment_description }} - - {% endif %} - {% if plant.light %} - - {% if plant.light_icon %} - Light icon - {% endif %} - {{ plant.light }} - {{ plant.light_description }} - - {% endif %} - {% if plant.toxicity %} - - {% if plant.toxicity_icon %} - Toxicity icon - {% endif %} - {{ plant.toxicity }} - {{ plant.toxicity_description }} - - {% endif %} -
-
- {% if plant.size %} - - {% if plant.size_icon %} - Size icon - {% endif %} - {{ plant.size }} - {{ plant.size_description }} - - {% endif %} - {% if plant.care_difficulty %} - - {% if plant.care_difficulty_icon %} - Care difficulty icon - {% endif %} - {{ plant.care_difficulty }} - {{ plant.care_difficulty_description }} - - {% endif %} - {% if plant.growth_rate %} - - {% if plant.growth_rate_icon %} - Growth rate icon - {% endif %} - {{ plant.growth_rate }} - {{ plant.growth_rate_description }} - - {% endif %} + + {% if plant.climate_icon %} + Climate icon + {% endif %} + {{ plant.climate if plant.climate else 'None' }} + {{ plant.climate_description if plant.climate_description else 'No description' }} + + + {% if plant.environment_icon %} + Environment icon + {% endif %} + {{ plant.environment if plant.environment else 'None' }} + {{ plant.environment_description if plant.environment_description else 'No description' }} + + + {% if plant.light_icon %} + Light icon + {% endif %} + {{ plant.light if plant.light else 'None' }} + {{ plant.light_description if plant.light_description else 'No description' }} + + + {% if plant.toxicity_icon %} + Toxicity icon + {% endif %} + {{ plant.toxicity if plant.toxicity else 'None' }} + {{ plant.toxicity_description if plant.toxicity_description else 'No description' }} + + + {% if plant.size_icon %} + Size icon + {% endif %} + {{ plant.size if plant.size else 'None' }} + {{ plant.size_description if plant.size_description else 'No description' }} + + + {% if plant.care_difficulty_icon %} + Care difficulty icon + {% endif %} + {{ plant.care_difficulty if plant.care_difficulty else 'None' }} + {{ plant.care_difficulty_description if plant.care_difficulty_description else 'No description' }} + + + {% if plant.growth_rate_icon %} + Growth rate icon + {% endif %} + {{ plant.growth_rate if plant.growth_rate else 'None' }} + {{ plant.growth_rate_description if plant.growth_rate_description else 'No description' }} +

{{ plant.description[:120] }}{% if plant.description and plant.description|length > 120 %}...{% endif %}

Added on
diff --git a/templates/post.html b/templates/post.html index c0b930b..35a900d 100644 --- a/templates/post.html +++ b/templates/post.html @@ -16,49 +16,49 @@

{{ plant.name }}

{% if plant.climate %} - + {% if plant.climate.icon %}Climate icon{% endif %} {{ plant.climate.name }} {{ plant.climate.description }} {% endif %} {% if plant.environment %} - + {% if plant.environment.icon %}Environment icon{% endif %} {{ plant.environment.name }} {{ plant.environment.description }} {% endif %} {% if plant.light %} - + {% if plant.light.icon %}Light icon{% endif %} {{ plant.light.name }} {{ plant.light.description }} {% endif %} {% if plant.toxicity %} - + {% if plant.toxicity.icon %}Toxicity icon{% endif %} {{ plant.toxicity.name }} {{ plant.toxicity.description }} {% endif %} {% if plant.size %} - + {% if plant.size.icon %}Size icon{% endif %} {{ plant.size.name }} {{ plant.size.description }} {% endif %} {% if plant.care_difficulty %} - + {% if plant.care_difficulty.icon %}Care icon{% endif %} {{ plant.care_difficulty.name }} {{ plant.care_difficulty.description }} {% endif %} {% if plant.growth_rate %} - + {% if plant.growth_rate.icon %}Growth icon{% endif %} {{ plant.growth_rate.name }} {{ plant.growth_rate.description }}