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

bloodspatter-js

v1.0.0

Published

Blood effects library for web applications - realistic blood cells, drips, reveals, and animations

Readme

🩸 BloodSpatter.js

A realistic blood effects library for web applications. Create dynamic blood cells, drips, reveals, and atmospheric effects.

Features

  • Blood Cells - Realistic flowing downward blood cells (4 variations)
  • Blood Reveal - Typing animation with blood scanning effect
  • Blood Smear - Hover effects that reveal blood trails
  • Blood Drips - Page load triggered dripping effects
  • Chat Blood - Flowing blood backgrounds for messages
  • Moving Spatter - Continuous downward blood spatter patterns
  • Server Integration - Trigger effects on server responses

Installation

npm install bloodspatter-js

Quick Start

HTML

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="node_modules/bloodspatter-js/dist/bloodspatter.css">
</head>
<body>
    <div id="my-container">Content here</div>
    
    <script src="node_modules/bloodspatter-js/dist/bloodspatter.js"></script>
    <script>
        // Add blood cells
        BloodSpatter.addBloodCells(document.getElementById('my-container'), 5);
    </script>
</body>
</html>

ES6 Modules

import BloodSpatter from 'bloodspatter-js';
import 'bloodspatter-js/dist/bloodspatter.css';

// Add blood effects
BloodSpatter.addBloodCells(document.getElementById('container'), 3);
BloodSpatter.triggerBloodReveal(element, 'New evidence discovered...');

CDN

<link rel="stylesheet" href="https://unpkg.com/bloodspatter-js/dist/bloodspatter.css">
<script src="https://unpkg.com/bloodspatter-js/dist/bloodspatter.js"></script>

API Reference

BloodSpatter.addBloodCells(container, count)

Creates realistic blood cells that flow downward with gravity.

// Add 5 blood cells to container
BloodSpatter.addBloodCells(document.getElementById('chat-message'), 5);

Parameters:

  • container (Element) - DOM element to add blood cells to
  • count (Number) - Number of blood cells to create (default: 3)

BloodSpatter.triggerBloodReveal(container, text)

Creates a typing animation with blood scanning effect.

// Reveal text with blood effect
BloodSpatter.triggerBloodReveal(messageEl, 'Blood analysis complete...');

Parameters:

  • container (Element) - DOM element containing text
  • text (String) - Text to reveal (optional, uses existing text if not provided)

BloodSpatter.addBloodDrips(container, count)

Adds blood drip effects to a container.

// Add 8 blood drips
BloodSpatter.addBloodDrips(document.body, 8);

Parameters:

  • container (Element) - DOM element to add drips to
  • count (Number) - Number of drips to create (default: 5)

BloodSpatter.addChatBloodBG(messageElement)

Adds flowing blood background to chat messages.

// Add blood background to message
BloodSpatter.addChatBloodBG(document.querySelector('.chat-message'));

Parameters:

  • messageElement (Element) - Message element to add blood background to

BloodSpatter.clearBloodCells(container)

Removes all blood cells from a container.

// Clear all blood cells
BloodSpatter.clearBloodCells(document.getElementById('container'));

Parameters:

  • container (Element) - DOM element to clear blood cells from

BloodSpatter.resetBloodReveal(container)

Resets blood reveal effect to original state.

// Reset reveal effect
BloodSpatter.resetBloodReveal(document.getElementById('message'));

CSS Classes

The library includes these CSS classes for styling:

Blood Cells

  • .blood-cell - Base blood cell style
  • .blood-cell-1 to .blood-cell-4 - Different blood cell variations
  • .blood-cell-animated - Animation class for downward movement

Blood Effects

  • .blood-smear-hover - Hover effect for blood smears
  • .blood-reveal - Container for blood reveal effect
  • .blood-reveal-text - Text element for reveal animation
  • .chat-blood-background - Blood background for chat messages
  • .blood-spatter-moving - Continuous moving blood spatter

Server Integration

Chat Application Example

// When server responds with message
fetch('/api/chat', {
    method: 'POST',
    body: JSON.stringify({message: userInput})
})
.then(response => response.json())
.then(data => {
    // Add message to chat
    const messageEl = addChatMessage(data.response);
    
    // Trigger blood effects based on content
    if (data.response.includes('blood') || data.response.includes('evidence')) {
        BloodSpatter.triggerBloodReveal(messageEl, data.response);
        BloodSpatter.addBloodCells(messageEl, 3);
    }
    
    if (data.response.includes('crime scene')) {
        BloodSpatter.addChatBloodBG(messageEl);
    }
});

Page Load Effects

// Add ambient blood effects on page load
window.addEventListener('load', () => {
    BloodSpatter.addBloodDrips(document.body, 5);
    
    // Add blood cells to existing messages
    document.querySelectorAll('.message').forEach(msg => {
        if (Math.random() < 0.3) { // 30% chance
            BloodSpatter.addBloodCells(msg, 2);
        }
    });
});

Browser Support

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

Bundle Size

  • Minified: ~8kb
  • Gzipped: ~3kb

Development

# Install dependencies
npm install

# Build package
npm run build

# Watch for changes
npm run dev

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Changelog

v1.0.0

  • Initial release
  • Blood cells with 4 variations
  • Blood reveal typing animation
  • Blood smear hover effects
  • Blood drip effects
  • Chat blood backgrounds
  • Moving blood spatter patterns