Husky Dog Animation CSS
This component is a visually appealing animated button that uses 3D geometric elements. On hover, the button scales up and geometric shapes (cone, torus, icosahedron, and sphere) appear and move around the button, creating a dynamic "magic motion" effect. The button also has a blurred gradient shadow that appears on hover, enhancing the 3D illusion.
Explanation: Place the following HTML inside your plain HTML page:
a class=button span class=button__text play /span img src=img/cone.png alt="" class=button__cone / img src=img/torus.png alt="" class=button__torus / img src=img/icosahedron.png alt="" class=button__icosahedron / img src=img/sphere.png alt="" class=button__sphere /
CSS Code
Explanation
CSS Breakdown
Root Variables:
--first-color: main button color
--body-color: page background
--body-font: Montserrat Alternates
--normal-font-size: default font size
Button Base Styles:
Positioned relative for layering images.
Rounded with 3rem border-radius.
Smooth transition for scaling and hover effects.
Hover Shadow (button::after):
A blurred linear gradient appears underneath the button.
Controlled opacity transitions to appear on hover.
Geometric Elements (button img):
Positioned absolutely in the center of the button.
Initially invisible (opacity 0).
Each element has a unique transform (position, rotation, blur).
Hover Animation for Images:
On hover, images become visible and move to new positions.
Each shape scales slightly for extra depth.
Button Scale:
Entire button enlarges smoothly to 1.3 times its original size on hover.
Magic Animated Motion Button Images
Here are the images used in the button:
