From 6a72d0e9f8fb1a6a84022330a757c7db453e4a9d Mon Sep 17 00:00:00 2001 From: ehab-hassan Date: Sun, 15 Jun 2025 11:05:48 +0300 Subject: [PATCH] add hover text --- content/home/index.md | 5 +++ templates/shortcodes/image_card.html | 54 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/content/home/index.md b/content/home/index.md index 941a9c9a0..80925f807 100644 --- a/content/home/index.md +++ b/content/home/index.md @@ -179,6 +179,7 @@ plore all the products that are driving this transformation. image_src="/images/3node.png", image_alt="3node", title="3Node", + tooltip="The backbone of storage and infrastructure, providing compute and data resources.", card_link="Dashboard" ) }} @@ -186,6 +187,7 @@ plore all the products that are driving this transformation. image_src="/images/mycelium.png", image_alt="mycelium", title="MYCELIUM", + tooltip="End-to-end encrypted overlay network, always looking for the shortest possible path between participants ", card_link="Dashboard" ) }} @@ -193,6 +195,7 @@ plore all the products that are driving this transformation. image_src="/images/aibox.png", image_alt="aibox", title="AIBOX", + tooltip="A self-hosted AI compute solution powered by ThreeFold. ", card_link="Dashboard" ) }} @@ -200,6 +203,7 @@ plore all the products that are driving this transformation. image_src="/images/3phone.png", image_alt="3phone", title="3PHONE", + tooltip="OwnPhone is the first secure device in the 3Phone family designed to work seamlessly with the ThreeFold Grid.", card_link="Dashboard" ) }} @@ -207,6 +211,7 @@ plore all the products that are driving this transformation. image_src="/images/3router.png", image_alt="ThreeFold Cloud", title="3ROUTER", + tooltip="Smart routers ensure shortest-path connections between nodes and phones with end-to-end encryption.", card_link="Dashboard" ) }} diff --git a/templates/shortcodes/image_card.html b/templates/shortcodes/image_card.html index 059500f18..76b5a3b24 100644 --- a/templates/shortcodes/image_card.html +++ b/templates/shortcodes/image_card.html @@ -2,15 +2,21 @@ {% set image_alt = image_alt | default(value="") %} {% set title = title | default(value="") %} {% set card_link = card_link | default(value="") %} +{% set tooltip = tooltip | default(value="") %} + {% if tooltip %} +
+ {{ tooltip }} + {% endif %}
{{ image_alt }}
+
{{ title }}
@@ -44,4 +50,52 @@ opacity: 1; } } + + /* Tooltip container */ + +.tooltip { + position: relative; + display: inline-block; + width: 100%; +} + +/* Tooltip text */ +.tooltip .tooltiptext { + font-size: 12px; + visibility: hidden; + background-color: rgb(26 26 26 / 70%); + color: #fff; + text-align: center; + padding: 5px 10px; + border-radius: 4px; + + /* Position the tooltip text - see examples below! */ + position: absolute; + z-index: 1; + bottom: 0px; + top: 0px; + left: 0px; + right: 0px; + + display: flex; + align-items: center; + justify-content: center; +} + +/* Show the tooltip text when you mouse over the tooltip container */ +.tooltip:hover .tooltiptext { + visibility: visible; +} + +@media (max-width: 480px) { + .tooltip .tooltiptext { + position: absolute; + z-index: 1; + bottom: -7px !important; + right: 0px !important; + top: 0px !important; + left: 0px !important; + } + } +