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 🙏

© 2026 – Pkg Stats / Ryan Hefner

string-scrambler-js-plus

v1.0.13

Published

Um pacote para animar strings com diferentes modos de embaralhamento.

Readme

String Scrambler JS Plus

License: MIT

Um pacote para animar strings com diferentes modos de embaralhamento, permitindo criar efeitos de texto dinâmico e envolvente em seus projetos web.

Índice

Instalação

Via NPM

Você pode instalar o String Scrambler JS Plus usando o NPM com o seguinte comando:

npm install string-scrambler-js-plus

Via CDN

Inclua o script UMD diretamente no seu HTML usando um dos serviços de CDN:

  • unpkg:

    <script src="https://unpkg.com/string-scrambler-js-plus@latest/dist/string-scrambler.umd.js"></script>
  • jsDelivr:

    <script src="https://cdn.jsdelivr.net/npm/string-scrambler-js-plus@latest/dist/string-scrambler.umd.js"></script>

Uso

Via NPM

Após instalar o pacote, você pode importá-lo em seu projeto JavaScript:

import { StringScrambler } from 'string-scrambler-js-plus';

// Selecionar elementos do DOM
const output = document.getElementById('output');

// Criar uma instância do StringScrambler
const scrambler = new StringScrambler();

// Configurar a animação
scrambler.configure({
  start: 'Hello',
  end: 'World!',
  mode: 'random', // Pode ser 'random', 'sequential' ou 'wave'
  onUpdate: (text) => {
    output.innerText = text;
  },
  onComplete: () => {
    console.log('Animação completa!');
  },
});

// Iniciar a animação
scrambler.init();

Via CDN

Se estiver usando o String Scrambler JS Plus via CDN, a classe estará disponível globalmente como StringScrambler.

<!DOCTYPE html>
<html lang="pt-br">
<head>
  <meta charset="UTF-8">
  <title>String Scrambler Demo</title>
</head>
<body>
  <div id="output">Hello </div>
  <button id="startButton">Iniciar Animação</button>

  <!-- Importação do pacote via CDN -->
  <script src="https://unpkg.com/string-scrambler-js-plus@latest/dist/string-scrambler.umd.js"></script>

  <script>
    // Selecionar elementos do DOM
    const output = document.getElementById('output');
    const startButton = document.getElementById('startButton');

    // Criar uma instância do StringScrambler
    const scrambler = new StringScrambler();

    // Configurar a animação
    scrambler.configure({
      start: 'Hello',
      end: 'World!',
      mode: 'random', // Pode ser 'random', 'sequential' ou 'wave'
      onUpdate: (text) => {
        output.innerText = text;
      },
      onComplete: () => {
        console.log('Animação completa!');
      },
    });

    // Função para iniciar a animação
    function startAnimation() {
      scrambler.init();
    }

    // Adicionar evento ao botão
    startButton.addEventListener('click', startAnimation);
  </script>
</body>
</html>

Modos Disponíveis

  • Random (random): As letras são embaralhadas aleatoriamente durante a animação.
  • Sequential (sequential): As letras são embaralhadas em ordem sequencial.
  • Wave (wave): As letras são embaralhadas seguindo um padrão de onda.

Exemplo

HTML

<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>String Scrambler - Exemplo Local</title>
    <style>
      body {
        font-family: Arial, sans-serif;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
        background-color: #f0f0f0;
      }
      .container {
        text-align: center;
        border: 2px solid #333;
        padding: 20px;
        background-color: white;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      }
      h1 {
        margin-bottom: 20px;
      }
      #output-container {
        display: flex;
        justify-content: space-between;
        margin-top: 20px;
      }
      .output {
        font-size: 2em;
        font-weight: bold;
        margin: 10px;
        width: 250px;
        min-height: 2.5rem; /* Garante espaço para a animação */
        border: 1px solid #ccc;
        padding: 10px;
        border-radius: 5px;
      }
      select,
      button {
        margin: 10px;
        padding: 10px;
        font-size: 1em;
        cursor: pointer;
      }
      button {
        border: none;
        border-radius: 5px;
        background-color: #007bff;
        color: white;
      }
      button:hover {
        background-color: #0056b3;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <h1>String Scrambler Demo</h1>

      <br />
      <button id="startButton">Iniciar Animação</button>

      <div id="output-container">
        <div id="output-random" class="output">Hello</div>
        <div id="output-sequential" class="output">Hello</div>
        <div id="output-wave" class="output">Hello</div>
      </div>
    </div>

    <script type="module">
      import { StringScrambler } from "./string-scrambler-js-plus.js"; // Importação do arquivo JS

      document.getElementById("startButton").addEventListener("click", () => {
        // Cria uma instância de StringScrambler para cada modo
        const randomScrambler = new StringScrambler({
          start: "Hello",
          end: "World",
          mode: "random",
          duration: 2000,
          transitionPause: 1500,
          loop: true,
          autoreverse: true,
          easingType: "ease-in-out",
          onUpdate: (text) =>
            (document.getElementById("output-random").textContent = text),
        });

        const sequentialScrambler = new StringScrambler({
          start: "Hello",
          end: "World",
          mode: "sequential",
          duration: 2000,
          transitionPause: 1500,
          loop: true,
          autoreverse: true,
          easingType: "ease-in-out",

          onUpdate: (text) =>
            (document.getElementById("output-sequential").textContent = text),
        });

        const waveScrambler = new StringScrambler({
          start: "Hello",
          end: "World",
          mode: "wave",
          duration: 2000,
          transitionPause: 1500,
          loop: true,
          autoreverse: true,
          easingType: "ease-in-out",

          onUpdate: (text) =>
            (document.getElementById("output-wave").textContent = text),
        });

        // Inicia as animações
        randomScrambler.init();
        sequentialScrambler.init();
        waveScrambler.init();
      });
    </script>
  </body>
</html>