]> git.ardis.lu - css-loaders/commitdiff
Add "grow on hover" card
authorArdis Lu <ardisglu@gmail.com>
Wed, 13 Dec 2023 05:24:22 +0000 (21:24 -0800)
committerArdis Lu <ardisglu@gmail.com>
Wed, 13 Dec 2023 05:24:22 +0000 (21:24 -0800)
index.html

index 462d4d454120fc7924efc784b979f22e504eee6e..f5ddad4a4cd59536c2c3c8f64545655a42dc6004 100644 (file)
       transition: max-height 1700ms;
     }
 
+    .card.hover-grow {
+      margin-block: 8px;
+      border: 1px solid hsl(0deg 0% 70%);
+      border-radius: 12px;
+      will-change: transform;
+      transition: scale 400ms;
+    }
+
+    .card.hover-grow:hover,
+    .card.hover-grow:focus-within {
+      scale: 105%;
+      transition: scale 200ms;
+    }
+
     /* Button hovers */
 
     button {
           <p>This card's detail will rise from the bottom when the card is hovered or focused.</p>
         </div>
       </div>
+
+      <div class="card hover-grow">
+        <h2>Grow on hover</h2>
+        <p>This card will grow larger when the card is hovered or focused.</p>
+      </div>
     </section>
 
     <section>
This page took 0.033924 seconds and 4 git commands to generate.