Control animations directly with HTML attributes for precise effects.
Animate text unit by unit: letter-by-letter, word-by-word, or line-by-line.
Utilize any `cssanimation` class for robust and versatile text effects.
Units wait for the previous one to complete, creating smooth flows.
Get creative with animation order, including randomized and reverse sequences.
Safely handles whitespace and provides animation class fallbacks.
Experience the magic of GlyphFX in action!
Hello GlyphFX!
First line animates beautifully.
Second line follows with style.
Randomized text!
Flowing backwards
Step 1. Step 2. Step 3.
Want to generate animation code for your own text?
Try the Live Preview ToolGlyphFX leverages the robust animation classes from @hellouxpavel/cssanimation to deliver stunning text effects.
Make sure to include CSSAnimation in your project for GlyphFX to work its magic!
Explore CSSAnimationAchieve complex text animations with minimal code and no external dependencies (besides CSSAnimation).
Fine-tune animation delays, durations, and effects directly within your HTML attributes.
Works effortlessly with your existing projects, whether using NPM or plain HTML.
Combine various animation classes and delays to craft unique, eye-catching text effects.
Via NPM:
npm install glyphfx @hellouxpavel/cssanimation
For plain HTML (include
just before your closing </body> tag):
<script src="https://cdn.jsdelivr.net/npm/@hellouxpavel/cssanimation@latest/dist/cssanimation.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/glyphfx@latest/dist/glyphfx.min.js"></script>
In your JavaScript file (if using NPM):
import glyphfx from "glyphfx";
glyphfx.init();
// or with debug mode
glyphfx.init({ dev: true });
If using plain HTML, the
glyphfx.init() call will
automatically run after the script loads.
Every animated text block
needs the .cssanimation class
along with a gf__* attribute
to define how it animates.
gf__sequence,
gf__random, gf__reverse)<h1 class="cssanimation" gf__sequence="ca__fx-fadeIn">Letters Animate</h1>
<p class="cssanimation" gf__random="ca__fx-bounceInTop">Randomized entry!</p>
<h3 class="cssanimation" gf__reverse="ca__fx-moveFromTop">Backwards Flow</h3>
gf__word)<h2 class="cssanimation" gf__word="ca__fx-fadeIn">
Each word animates uniquely
</h2>
gf__line)<p class="cssanimation" gf__line="ca__fx-fadeIn">
First line<br />
Second line<br />
Third line
</p>
<p class="cssanimation" gf__line="ca__fx-fadeIn" gf__separator="dot">
Step 1. Step 2. Step 3.
</p>
<h2
class="cssanimation"
gf__word="ca__fx-fadeIn ca__fx-moveFromTop ca__fx-moveFromBottom ca__fx-moveFromRight"
gf__delay="0 200 400">
Each word animates uniquely
</h2>
gf__base-duration)<h3 class="cssanimation" gf__sequence="ca__fx-fadeIn" gf__base-duration="750">
Global base duration
</h3>
Required Class:
The .cssanimation
class is always necessary for baseline styling and
to activate text animations.
Repeating Values: You can provide fewer classes or delay values than units; the last value will simply repeat for the remaining units, making it easy to apply a pattern.
Skipped Elements: If you pass more classes or values than needed, the extra elements are skipped, and a warning might be logged to your console to help with debugging.
Safe Parsing: Delay and duration values are parsed safely; non-numeric strings will fall back to default behaviors to prevent errors.
Animation Duration
Precedence: Duration is determined in
this order: gf__base-duration >
CSS-detected duration > internal default.