webdevpuneet.com

WOW.js Pricing Table: Yearly Toggle & Flip-In Reveal

WOW.js Pricing Table Reveal · Pricing · Plain HTML, CSS & JS · Live preview

CategoryPricing

About this UI Snippet

WOW.js Pricing Table Reveal — Yearly Toggle, Counting Prices and One Entrance per Element

Screenshot of the WOW.js Pricing Table Reveal snippet rendered live

Most WOW.js demos give every element the same entrance. This pricing table gives each block its own: the heading drops in with animate__fadeInDown, the billing switch zooms in, the Starter and Scale plans fade up, and the featured Growth plan flips in on its vertical axis. All four are driven by one new WOW({ offset: 40, live: true, animateClass: 'animate__animated' }).init() call, and the table is fully usable once the animation has played: a Monthly / Yearly switch, prices that count to their new value, plan selection and a live summary line.

One WOW.js call, four different entrances

WOW.js only watches the .wow class. It hides an element until it scrolls into view, then lets it play, and it never looks at which animate.css class is on it. Whatever animate__ name sits in the markup is the entrance that runs, so varying the animation per element costs nothing in the JavaScript. The delays (data-wow-delay) stagger the order: heading, switch, Starter, Growth, Scale. The idea is the same one explained in the scroll reveal cards snippet, applied to a layout where hierarchy matters.

The animateClass setting animate.css 4 needs

WOW.js was written for animate.css 3, where the class that starts an animation is animated. Version 4 renamed it to animate__animated. This snippet passes animateClass: 'animate__animated' and leaves that class out of the markup, so the cards carry only wow animate__fadeInUp. Without the setting, a v4 element that already has animate__animated in its HTML begins playing at page load, before WOW.js reveals it, and the entrance is half over by the time you scroll to it.

Why the featured plan keeps its size

The Growth card is slightly larger than its neighbours. A transform: scale(1.04) would be replaced by the transform inside the flipInY keyframes and would stay replaced afterwards, because animate.css holds the last frame. The snippet uses the standalone scale property instead, which composes with transform and survives the animation. The card also sets backface-visibility: hidden so its back face never flashes at 90°, and animate.css 4 already puts perspective(400px) inside the flipInY keyframes, so no extra perspective rule is needed.

Monthly and yearly with counting prices

Each card stores both prices in data-monthly and data-yearly. The switch is a two-button radio group (arrow keys move between the buttons) and the yearly option takes 20% off: $9, $29 and $79 become $7, $23 and $63 per month, with the yearly total shown under the price. Prices tween with requestAnimationFrame over 450ms with an ease-out curve and a cancel token, so flipping the switch quickly never leaves a number half-counted. If you would rather use a library for the counting, the CountUp.js pricing toggle does exactly that, and the annual savings badge is a good companion for the "-20%" label.

Selecting a plan and the live summary

Each button is a toggle with aria-pressed. Choosing a plan outlines its card, relabels the button to "Selected ✓", resets the other two and writes a summary into a role="status" region, which a screen reader announces. Switching the billing period rewrites the summary too, so it always matches the card.

Replaying the entrance

WOW.js reveals each element once. The "Replay the entrance" button calls wow.stop(), strips the inline styles and the animate__animated class WOW.js left behind, puts .wow back and starts a fresh instance. It is a quick way to show the whole sequence again, and a pattern for any reveal you want to re-run.

Reduced motion and missing scripts

With prefers-reduced-motion: reduce the script skips WOW.js, removes the .wow class so every element is visible at rest, switches prices instantly and stops the featured card's rotating ring. If the CDN scripts fail to load the same fallback runs, so the table never stays hidden.

What's included

Features

One entrance per element
Heading, switch, side plans and featured plan each use a different animate.css class from one WOW.js instance.
Monthly / Yearly switch
An accessible two-button radio group with arrow-key support and a -20% yearly option.
Counting prices
Prices tween to their new value with an ease-out curve and a cancel token, so quick toggling stays clean.
Featured plan ring
The Growth card is scaled up at rest and wrapped in a slowly rotating conic-gradient border.
Pointer spotlight
A green radial highlight follows the cursor across whichever card is hovered.
Plan selection with a live summary
aria-pressed buttons and a status line that updates with the plan and the billing period.
Replay the entrance
One button restarts the whole reveal sequence without reloading the preview.
Reduced-motion and no-CDN fallback
Everything shows at rest and prices switch instantly when motion is off or the scripts fail to load.

Step by step

How to Use

  1. 1
    Add both CDN fileswow.min.js and animate.min.css (v4) power every entrance from one shared instance.
  2. 2
    Give each element its own entranceWrite class="wow animate__fadeInUp" or animate__flipInY. Only the animate__ name changes between elements.
  3. 3
    Tell WOW.js the v4 class namePass animateClass: 'animate__animated' so WOW.js adds it on reveal instead of at page load.
  4. 4
    Stagger with data-wow-delaySet 0.2s, 0.35s and 0.5s on the cards to reveal them left to right, with the featured plan in the middle.
  5. 5
    Store both prices on each carddata-monthly and data-yearly feed the switch; change the numbers or the discount to match your plans.
  6. 6
    Use scale, not transform, for resting sizeThe standalone scale property keeps the featured card larger after the flip finishes.
  7. 7
    Add the Replay button if you want itIt calls wow.stop(), clears the reveal state and starts a fresh instance.

Real-world uses

Common Use Cases

SaaS pricing pages
Show three plans with a monthly/yearly switch and let the recommended tier flip in first, so the eye lands on the plan you want people to pick.
Course and membership tiers
Reveal tiers as the visitor scrolls, with yearly pricing that shows the annual total under each monthly figure before they commit.
Agency retainer packages
Present Starter, Growth and Scale retainers with counting prices, so a visitor comparing options sees the difference between billing periods immediately.
Plan upgrade screens
Reuse the selected state and live summary inside an in-app upgrade dialog, where the chosen plan and its total must stay visible.
Learning how WOW.js and animate.css 4 fit together
Study a working example of animateClass, per-element delays, a replayable reveal and a reduced-motion fallback in about a hundred lines of JavaScript.

Got questions?

Frequently Asked Questions

No. WOW.js only tracks the .wow class and never inspects which animate__ class is also present, so each element plays its own entrance. Here the heading, the switch, the side plans and the featured plan each use a different one.

WOW.js adds a class named animated by default, which is the animate.css 3 name. Version 4 uses animate__animated, so passing animateClass makes WOW.js add the right one on reveal. The markup then needs only the animate__ entrance name.

animate.css keyframes set transform and hold their last frame, which would replace a transform: scale on the featured card. The standalone scale property is applied separately, so the card stays 4% larger before, during and after the flip.

It calls wow.stop(), removes the animate__animated class and inline styles WOW.js left behind, adds .wow back to every element and creates a fresh WOW instance. The elements hide and then reveal again in the same staggered order.

Edit data-monthly and data-yearly on each .wpr-card. The script reads them when the switch changes and works out the yearly total as twelve times the monthly figure, so no other code needs to change.

The script skips WOW.js and removes the .wow class, so every element is visible straight away, prices switch without counting and the card ring stops rotating. The same fallback runs if the WOW.js file fails to load.

Copy & paste

Source Code

<div class="wpr-stage">
  <div class="wpr-head wow animate__fadeInDown">
    <span class="wpr-tag">WOW.js · one entrance per element</span>
    <h2>Pick your plan</h2>
    <p>The heading drops in, the switch zooms, the side plans fade up and the featured plan flips. Four animate.css classes, one WOW.js call.</p>
  </div>

  <div class="wpr-billing wow animate__zoomIn" data-wow-delay="0.1s" role="radiogroup" aria-label="Billing period">
    <button type="button" class="wpr-bill is-on" role="radio" aria-checked="true" data-period="monthly">Monthly</button>
    <button type="button" class="wpr-bill" role="radio" aria-checked="false" tabindex="-1" data-period="yearly">Yearly <span class="wpr-save">-20%</span></button>
  </div>

  <div class="wpr-grid">
    <div class="wpr-card wow animate__fadeInUp" data-wow-delay="0.2s" data-plan="Starter" data-monthly="9" data-yearly="7">
      <div class="wpr-plan">Starter</div>
      <div class="wpr-price"><span class="wpr-cur">$</span><span class="wpr-num">9</span><span class="wpr-per">/mo</span></div>
      <div class="wpr-note">Billed monthly</div>
      <ul class="wpr-list">
        <li>1 project</li>
        <li>5GB storage</li>
        <li>Community support</li>
      </ul>
      <button type="button" class="wpr-btn" aria-pressed="false">Choose Starter</button>
    </div>

    <div class="wpr-card wpr-featured wow animate__flipInY" data-wow-delay="0.35s" data-plan="Growth" data-monthly="29" data-yearly="23">
      <div class="wpr-badge">Most popular</div>
      <div class="wpr-plan">Growth</div>
      <div class="wpr-price"><span class="wpr-cur">$</span><span class="wpr-num">29</span><span class="wpr-per">/mo</span></div>
      <div class="wpr-note">Billed monthly</div>
      <ul class="wpr-list">
        <li>Unlimited projects</li>
        <li>100GB storage</li>
        <li>Priority support</li>
        <li>Team seats</li>
      </ul>
      <button type="button" class="wpr-btn wpr-btn-primary" aria-pressed="false">Choose Growth</button>
    </div>

    <div class="wpr-card wow animate__fadeInUp" data-wow-delay="0.5s" data-plan="Scale" data-monthly="79" data-yearly="63">
      <div class="wpr-plan">Scale</div>
      <div class="wpr-price"><span class="wpr-cur">$</span><span class="wpr-num">79</span><span class="wpr-per">/mo</span></div>
      <div class="wpr-note">Billed monthly</div>
      <ul class="wpr-list">
        <li>Unlimited everything</li>
        <li>1TB storage</li>
        <li>Dedicated support</li>
      </ul>
      <button type="button" class="wpr-btn" aria-pressed="false">Choose Scale</button>
    </div>
  </div>

  <div class="wpr-foot">
    <p class="wpr-summary" role="status" aria-live="polite">Pick a plan to see your total.</p>
    <button type="button" class="wpr-replay">↻ Replay the entrance</button>
  </div>
</div>

Extend with AI

Take This Snippet Further With AI

This snippet is a good prompt for asking an AI to explain how two animation libraries divide the work: paste it into an assistant like Claude and ask why WOW.js needs animateClass: 'animate__animated' with animate.css 4, what the cards would do at page load without it, and why the featured card uses the scale property instead of transform: scale(). Then ask how the Replay button resets the reveal (wow.stop(), clearing inline styles, re-adding .wow). To extend it: ask for a fourth Enterprise tier with a "Contact sales" button, a currency selector that reuses the counting tween, a version where the yearly discount is read from one data attribute, or a comparison table row set that reveals line by line using the same per-element approach.

Prompt to recreate it

Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:

text
Build an animated 3-tier pricing table with WOW.js (v1.1.2, from a CDN) and animate.css (v4.1.1, from a CDN) in plain HTML, CSS and JavaScript.

Requirements:
- A centred heading block, a Monthly / Yearly switch, and three cards (Starter $9, Growth $29, Scale $79 per month; yearly is 20% off: $7, $23, $63). Growth is the featured card: a "Most popular" badge, a tinted background, a slightly larger size at rest using the standalone CSS scale property (not transform: scale), and a slowly rotating conic-gradient border built with an @property angle and a mask.
- Every animated element carries class="wow animate__<name>" with its own entrance and no animate__animated in the markup: heading animate__fadeInDown, switch animate__zoomIn, side cards animate__fadeInUp, featured card animate__flipInY. Stagger them with data-wow-delay (0.1s, 0.2s, 0.35s, 0.5s).
- One WOW instance: new WOW({ offset: 40, live: true, animateClass: 'animate__animated' }).init(). Give the cards backface-visibility: hidden. Do not add a perspective rule: animate.css 4 flipInY already includes perspective(400px).
- The switch is a role="radiogroup" with two role="radio" buttons and arrow-key support. Each card stores data-monthly and data-yearly. Changing the period makes each price count to its new value with requestAnimationFrame (450ms, ease-out, cancel the previous frame), and each card's note changes between "Billed monthly" and "Billed $X a year".
- The "Choose" buttons are toggles with aria-pressed. Choosing a plan outlines its card, relabels the button "Selected ✓", resets the others, and writes "Plan selected: total" into a role="status" aria-live="polite" line that also updates when the billing period changes.
- A green radial spotlight follows the pointer inside each card (set --mx and --my on pointermove). Hovering lifts a card using the translate property.
- A "Replay the entrance" button calls wow.stop(), removes animate__animated, clears inline styles, re-adds the wow class to every animated element and starts a new WOW instance.
- Respect prefers-reduced-motion: skip WOW.js and remove the wow class so everything is visible, switch prices instantly and stop the rotating ring. Use the same fallback if window.WOW is undefined.
- Style it as a dark, premium pricing section with green accents. The grid collapses to one column under 760px, where the featured card returns to normal size.

Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.