npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

suryajs-animfx

v1.0.0

Published

SuryaJS - A powerful JavaScript animation library with 20+ image, text, and advanced 3D effects

Readme

AnimFX.js 🎨

A powerful, lightweight JavaScript animation library that provides stunning visual effects for images and text with zero dependencies.

npm version License: MIT

✨ Features

  • 5 Image Effects: Fade, slide, zoom, flip, and glitch animations
  • 5 Text Effects: Typewriter, fade up, letter spacing, color wave, and split reveal
  • Zero Dependencies: Pure JavaScript with no external libraries
  • Easy Integration: Simple API with data attributes or JavaScript calls
  • Responsive: Works on all devices and screen sizes
  • Performance Optimized: Uses CSS transforms and modern web APIs
  • Accessibility: Respects prefers-reduced-motion settings

🚀 Quick Start

Installation

npm install animfx-js

CDN Usage

<script src="https://unpkg.com/animfx-js@latest/dist/animfx.min.js"></script>

Basic Usage

<!DOCTYPE html>
<html>
<head>
    <script src="https://unpkg.com/animfx-js@latest/dist/animfx.min.js"></script>
</head>
<body>
    <!-- Auto-trigger effects with data attributes -->
    <img src="image.jpg" data-image-effect="1" alt="Animated Image">
    <h1 data-text-effect="1">Animated Text</h1>
    
    <!-- Or trigger programmatically -->
    <script>
        // Image effects
        animFX.imageEffect(1); // Fade in scale
        animFX.imageEffect(2); // Slide in rotate
        
        // Text effects  
        animFX.textEffect(1); // Typewriter
        animFX.textEffect(2); // Fade in up
    </script>
</body>
</html>

📖 API Reference

Image Effects

| Effect Number | Name | Description | |---------------|------|-------------| | 1 | Fade In Scale | Fades in with scaling animation | | 2 | Slide In Rotate | Slides from left with rotation | | 3 | Zoom Blur | Zooms in while removing blur | | 4 | Flip Reveal | 3D flip animation reveal | | 5 | Glitch Effect | Digital glitch animation |

Usage Examples

// Apply to all images
animFX.imageEffect(1);

// Apply to specific element
const img = document.querySelector('#myImage');
animFX.imageEffect(2, img);

// Using data attributes
<img src="photo.jpg" data-image-effect="3">

Text Effects

| Effect Number | Name | Description | |---------------|------|-------------| | 1 | Typewriter | Types text character by character | | 2 | Fade In Up | Fades in while moving up | | 3 | Letter Spacing | Animates letter spacing | | 4 | Color Wave | Waves of color through text | | 5 | Split Reveal | Reveals each character individually |

Usage Examples

// Apply to all text elements
animFX.textEffect(1);

// Apply to specific element
const heading = document.querySelector('h1');
animFX.textEffect(2, heading);

// Using data attributes
<h1 data-text-effect="4">Colorful Text</h1>

Advanced Usage

Hover Effects

// Add hover effects
animFX.addHoverEffect('.card img', 'image', 3);
animFX.addHoverEffect('.title', 'text', 4);

Scroll-Triggered Animations

// Trigger animations on scroll
animFX.addScrollEffect('.gallery img', 'image', 1, {
    threshold: 0.2,
    rootMargin: '50px'
});

animFX.addScrollEffect('.content h2', 'text', 5, {
    threshold: 0.1
});

🎯 Complete Examples

Example 1: Image Gallery

<!DOCTYPE html>
<html>
<head>
    <style>
        .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            padding: 20px;
        }
        .gallery img {
            width: 100%;
            border-radius: 8px;
        }
    </style>
    <script src="https://unpkg.com/animfx-js@latest/dist/animfx.min.js"></script>
</head>
<body>
    <div class="gallery">
        <img src="image1.jpg" data-image-effect="1" alt="Image 1">
        <img src="image2.jpg" data-image-effect="2" alt="Image 2">
        <img src="image3.jpg" data-image-effect="3" alt="Image 3">
        <img src="image4.jpg" data-image-effect="4" alt="Image 4">
    </div>
</body>
</html>

Example 2: Text Animations

<!DOCTYPE html>
<html>
<head>
    <script src="https://unpkg.com/animfx-js@latest/dist/animfx.min.js"></script>
</head>
<body>
    <h1 data-text-effect="1">Welcome to AnimFX</h1>
    <h2 data-text-effect="2">Beautiful Animations</h2>
    <p data-text-effect="3">Made Simple</p>
    
    <script>
        // Add scroll-triggered animations
        animFX.addScrollEffect('h1, h2, p', 'text', 1);
    </script>
</body>
</html>

Example 3: Mixed Effects with JavaScript

<!DOCTYPE html>
<html>
<head>
    <script src="https://unpkg.com/animfx-js@latest/dist/animfx.min.js"></script>
</head>
<body>
    <div class="hero">
        <img id="heroImage" src="hero.jpg" alt="Hero Image">
        <h1 id="heroTitle">Amazing Website</h1>
    </div>
    
    <script>
        // Custom timing and effects
        setTimeout(() => {
            animFX.imageEffect(1, document.getElementById('heroImage'));
        }, 500);
        
        setTimeout(() => {
            animFX.textEffect(1, document.getElementById('heroTitle'));
        }, 1000);
    </script>
</body>
</html>

🛠️ Module Usage (ES6/CommonJS)

ES6 Modules

import AnimFX from 'animfx-js';

const fx = new AnimFX();
fx.imageEffect(1);
fx.textEffect(2);

CommonJS

const AnimFX = require('animfx-js');

const fx = new AnimFX();
fx.imageEffect(1);
fx.textEffect(2);

React Integration

import React, { useEffect, useRef } from 'react';
import AnimFX from 'animfx-js';

function AnimatedComponent() {
    const imageRef = useRef(null);
    const textRef = useRef(null);
    
    useEffect(() => {
        const fx = new AnimFX();
        
        if (imageRef.current) {
            fx.imageEffect(1, imageRef.current);
        }
        
        if (textRef.current) {
            fx.textEffect(2, textRef.current);
        }
    }, []);
    
    return (
        <div>
            <img ref={imageRef} src="image.jpg" alt="Animated" />
            <h1 ref={textRef}>Animated Text</h1>
        </div>
    );
}

🎨 Customization

Custom Options

// Custom duration and delays
const options = {
    duration: 2000,
    delay: 500,
    easing: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)'
};

// Apply with custom options (for direct effect methods)
animFX.imageEffects.fadeInScale(elements, options);
animFX.textEffects.typeWriter(elements, { speed: 100 });

🌐 Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

If you have any questions or need help, please open an issue.


Made with ❤️ by [Your Name]