🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@vianetz/animated-headlines-vanilla

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vianetz/animated-headlines-vanilla

Simple animated, accessible headlines using plain JavaScript.

Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
4
-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

Animated Headlines with Vanilla JavaScript

Animated headlines with interchangeable words that replace one another through CSS transitions.
See demo.

Installation

npm

npm install @vianetz/animated-headlines-vanilla

bower

bower install @vianetz/animated-headlines-vanilla

Default Usage

Include the css in your head.

<link rel="stylesheet" src="dist/animated-headline.css">

Use the following markup.

<section class="animated-headline">
    <h1>
        My favorite food is
        <span class="ah-words-wrapper">
            <b class="is-visible">pizza</b>
            <b>sushi</b>
            <b>steak</b>
        </span>
    </h1>
</section>

Finally, initialize the plugin.

<script src="dist/animated-headline.js"></script>
<script>
    document.addEventListener('DOMContentLoaded', () => AnimatedHeadline('.ah-words-wrapper'));
</script>

Advanced Usage

The plugin provides multiple options to customize the animation type and delay.

<script>
    document.addEventListener('DOMContentLoaded', () =>
        AnimatedHeadline('.ah-words-wrapper', {
            animationType: 'type',
            animationDelay: 1500,
        })
    );
</script>

Options

It is recommended to use the default delay options. Because of this, I won't list them below. See app.ts for a complete list of options.

NameTypeDefaultDescription
animation-typestringrotate-1Type of animation used.
Options:
  • rotate-1
  • rotate-2
  • rotate-3
  • type
  • loading-bar
  • slide
  • clip
  • zoom
  • scale
  • push

License

Animated Headlines is open-sourced software licensed under the MIT license.

Keywords

animated headlines

FAQs

Package last updated on 08 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts