
CSS demos
Published:
Author: MongoRolls
1 min read
Signature animation
The result:
Steps:
- Generate a nice handwritten image with Signature.
- Use a free online service to convert PNG to SVG.
- Write the code.
SVG attributes:
- stroke-dasharray defines the lengths of dashes and gaps; they alternate.
- stroke-dashoffset defines where the dash pattern starts.
For the animation, set dashArray to the length of the drawn stroke, then use dashOffset to control the blank space at the beginning. Change dashOffset in keyframes to reset it and create the drawing effect.
Tip: remember to get the length of the longest path.
Typewriter effect
Hello, world!
Steps:
- Use animation steps.
- Use
chand a monospace font.
3D card
NO. 001 / COSMOS星际漫游HOLOGRAPHIC EDITION
Steps:
transform-style: preserve-3d;perspectivemix-blend-mode: color-dodge;- Use JavaScript to track the mouse.
transform: rotateX, rotateY
Link: Pokemon
Loading animation
Steps:
- Create an image mask with
mask-image. - Reveal the image in steps with
mask-size,mask-position, andsteps().
