From 4aef4fa50283deb532b7f66e15b4d73cbf9fdf74 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Mon, 24 Oct 2022 23:16:00 -0700 Subject: [PATCH] Add hover detail card --- index.html | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 06f7c83..3fa245e 100644 --- a/index.html +++ b/index.html @@ -138,7 +138,7 @@ padding: 16px; } - .card-content { + .card-content.rainbow-border { display: flex; flex-direction: column; align-items: center; @@ -197,6 +197,42 @@ background: white; border-radius: 8px; } + + .card.hover-detail { + block-size: 148px; + background: hsl(0deg 0% 98%); + border: 1px solid hsl(0deg 0% 70%); + border-radius: 12px; + position: relative; + transition: filter 800ms; + } + + .card.hover-detail:hover, + .card.hover-detail:focus-within { + filter: brightness(93%); + transition: filter 400ms; + } + + .card-content.hover-detail { + block-size: 100%; + display: flex; + flex-direction: column; + justify-content: flex-end; + overflow: hidden; + } + + .card-content.hover-detail p { + margin: 0; + max-height: 0; + overflow: hidden; + transition: max-height 2000ms; + } + + .card.hover-detail:hover p, + .card.hover-detail:focus-within p { + max-height: 100%; + transition: max-height 1700ms; + } css-loaders @@ -292,6 +328,13 @@

This card's border will fill with a rainbow when the card is hovered or focused.

+ +
+
+

Hover detail card

+

This card's detail will rise from the bottom when the card is hovered or focused.

+
+
-- 2.47.3