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

lipsync

v2.0.2

Published

**lipSync.js** is a dynamic, CSS-powered web UI framework for simulating mouth movements based on phonemes or groups of letters. It uses the `@layer` feature in CSS to create visually appealing animations for lips, tongue, and teeth in real-time, enabling

Downloads

38

Readme

lipSync.js 🎤🖌️

lipSync.js is a dynamic, CSS-powered web UI framework for simulating mouth movements based on phonemes or groups of letters. It uses the @layer feature in CSS to create visually appealing animations for lips, tongue, and teeth in real-time, enabling lip-syncing effects for web applications.

LipSync

LipSync | Live Codepen

NPM Package Link


🌟 Features

  • Phoneme-Based Animation: Supports multiple letter groups to represent distinct mouth shapes for phonemes.
  • Layered Styling: Utilizes CSS @layer to organize and manage styles for the mouth, tongue, and teeth independently.
  • Smooth Transitions: Includes animated transitions for natural-looking mouth movements.
  • Customizable Appearance: Easily extend or modify the styles to fit your project.

🚀 Getting Started

Installation

Using Web Components

  1. Install using NPM:
npm i lipsync

Then import:

import("lipsync");

Alternatively, use Unpkg:

<script src="https://unpkg.com/[email protected]/src/lipSyncComponent.js"></script>

Without using Web components

  1. Clone the repository:

    git clone https://github.com/your-username/lipSync.js.git
  2. Include the lipSync.css and lipSync.js files in your project.

    <link rel="stylesheet" href="lipSync.css">
    <script src="lipSync.js" defer></script>

Usage

  1. Define an element / Web Component in your HTML to represent the mouth:

    <div class="mouth" data-letters="aei">
        <div class="tongue"></div>
        <div class="teeth upper-part"></div>
        <div class="teeth lower-part"></div>
    </div>

    OR

     <lip-sync data-letters="aei"></lip-sync>
  2. Add the data-letters attribute to define the phoneme type. Supported phoneme groups:

    const lipSyncTypes = [
      "aei", "bmp", "cdgknstxyz", "chjsh",
      "ee", "fv", "l", "o", "qw", "r", "th", "u"
    ];
  3. Update the data-letters attribute dynamically via JavaScript for real-time animation:

    const mouth = document.querySelector(".mouth");
    mouth.setAttribute("data-letters", "o"); // Change to another phoneme

📚 Examples

Basic Example

<div class="mouth" data-letters="bmp">
    <div class="tongue"></div>
    <div class="teeth upper-part"></div>
    <div class="teeth lower-part"></div>
</div>

Live Update with JavaScript

setInterval(() => {
  const phonemes = ["aei", "bmp", "cdgknstxyz", "chjsh", "ee"];
  const randomPhoneme = phonemes[Math.floor(Math.random() * phonemes.length)];
  document.querySelector(".mouth").setAttribute("data-letters", randomPhoneme);
}, 1000);

🎨 Customization

  • Modify lipSync.css to adjust mouth, tongue, or teeth styles.
  • Add new phoneme groups by extending the lipSyncTypes array and defining new data-letters styles.

[!TIP] To better understand the working, you can check out Medium Article on LipSync too!


🛠️ Future Scope

  • Web Speech API integration, setup examples using Web Speech api like speech synthesis, to showcase how to make it.
  • Facial Gestures, add animations to eyes like closing, partial close etc for extra facial expressions.
  • Playground, have a whole figma svg plugin and css playground where developers can pick across various faces, eyes and mouth, combine and use directly by copying code.

[!IMPORTANT] The utils folder provides a way of using the SpeechSynthesis interface of the Web Speech API to understand how use the lip sync features.


🛠️ Technologies

  • CSS @layer for layered styling.
  • JavaScript for dynamic phoneme updates.

🌟 Contributing

  1. Fork the repository.
  2. Create a new branch (feature/new-animation).
  3. Commit your changes (git commit -m 'Add a new animation for XYZ').
  4. Push the branch (git push origin feature/new-animation).
  5. Open a Pull Request.

📚 License

This project is licensed under the MIT License. See the LICENSE file for details.