{"id":29616687,"url":"https://github.com/tizee/text-scrambler.js","last_synced_at":"2026-02-05T20:09:08.756Z","repository":{"id":299907311,"uuid":"968650170","full_name":"tizee/text-scrambler.js","owner":"tizee","description":"text scrambler animation js library insipred by https://musicforprogramming.net/","archived":false,"fork":false,"pushed_at":"2025-06-19T11:53:28.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-21T01:06:03.263Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tizee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-18T13:23:40.000Z","updated_at":"2025-06-19T11:53:32.000Z","dependencies_parsed_at":"2025-06-18T23:24:23.264Z","dependency_job_id":"49086d52-016b-47f2-94f6-8ca0379a3a51","html_url":"https://github.com/tizee/text-scrambler.js","commit_stats":null,"previous_names":["tizee/text-scrambler.js"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tizee/text-scrambler.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizee%2Ftext-scrambler.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizee%2Ftext-scrambler.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizee%2Ftext-scrambler.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizee%2Ftext-scrambler.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tizee","download_url":"https://codeload.github.com/tizee/text-scrambler.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tizee%2Ftext-scrambler.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29132752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T19:36:52.185Z","status":"ssl_error","status_checked_at":"2026-02-05T19:35:40.941Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-21T01:02:06.500Z","updated_at":"2026-02-05T20:09:08.742Z","avatar_url":"https://github.com/tizee.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-scrambler.js\n\n[![CI](https://github.com/tizee/text-scrambler.js/actions/workflows/ci.yml/badge.svg)](https://github.com/tizee/text-scrambler.js/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/text-scrambler.js)](https://www.npmjs.com/package/text-scrambler.js)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/text-scrambler.js.svg)](https://bundlephobia.com/package/text-scrambler.js)\n![last commit](https://img.shields.io/github/last-commit/tizee/text-scrambler.js/main)\n\nA lightweight, performant JavaScript library for creating text scramble animations. Smoothly reveal or dissolve text with customizable scramble effects.\n\n## Features\n\n- 🚀 **Performant**: Uses `requestAnimationFrame` and optimized DOM operations\n- 🎨 **Customizable**: Control animation duration, symbols, direction, and more\n- 📦 **Lightweight**: Minimal dependencies and small bundle size\n- 🔄 **Bidirectional**: Support for both reveal and dissolve animations\n- 🌐 **Universal**: Works in all modern browsers\n- 📱 **Responsive**: Handles dynamic content and resizing\n\n## Installation\n\n```bash\n# Using npm\nnpm install text-scrambler.js\n\n# Using pnpm\npnpm add text-scrambler.js\n\n# Using yarn\nyarn add text-scrambler.js\n```\n\n## Quick Start\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eText Scrambler Demo\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1 id=\"title\"\u003eHello World!\u003c/h1\u003e\n\n    \u003cscript type=\"module\"\u003e\n      import TextScrambler from 'text-scrambler.js'\n\n      const element = document.getElementById('title')\n      const scrambler = new TextScrambler(element, {\n        duration: 2000,\n        scrambleSymbols: '@#$%\u0026*',\n      })\n\n      scrambler.start()\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Usage\n\n### Basic Usage\n\n```javascript\nimport TextScrambler from 'text-scrambler.js'\n\nconst element = document.querySelector('.my-text')\nconst scrambler = new TextScrambler(element)\nscrambler.start()\n```\n\n### With Configuration\n\n```javascript\nconst scrambler = new TextScrambler(element, {\n  duration: 1500, // Animation duration in milliseconds\n  delay: 500, // Initial delay before animation starts\n  reverse: false, // false: reveal text, true: dissolve text\n  scrambleSymbols: '#$@!*\u0026', // Characters used for scrambling\n  randomThreshold: 0.85, // Probability of showing original vs scramble chars\n  absolute: false, // Set element position to absolute\n  pointerEvents: true, // Enable/disable pointer events during animation\n})\n\nscrambler.start()\n```\n\n### API Methods\n\n```javascript\n// Start the animation\nscrambler.start()\n\n// Stop the animation\nscrambler.stop()\n\n// Reset to initial state\nscrambler.initialize()\n```\n\n## Configuration Options\n\n| Option            | Type      | Default                           | Description                                             |\n| ----------------- | --------- | --------------------------------- | ------------------------------------------------------- |\n| `duration`        | `number`  | `1000`                            | Animation duration in milliseconds                      |\n| `delay`           | `number`  | `0`                               | Initial delay before animation starts                   |\n| `reverse`         | `boolean` | `false`                           | Animation direction (false: reveal, true: dissolve)     |\n| `scrambleSymbols` | `string`  | `\"—~±§\\|[].+$^@*()•x%!?#\"`        | Characters used for scrambling effect                   |\n| `randomThreshold` | `number`  | `0.8` (forward) / `0.1` (reverse) | Probability threshold for showing original character    |\n| `autoInitialize`  | `boolean` | `true`                            | Automatically set initial state based on animation mode |\n| `absolute`        | `boolean` | `false`                           | Set element CSS position to absolute                    |\n| `pointerEvents`   | `boolean` | `true`                            | Enable pointer events on the element                    |\n\n### Auto-Initialize Feature\n\nBy default, `autoInitialize: true` automatically sets the correct initial state:\n\n- **Forward mode** (reveal): Text starts hidden (spaces), ready to be revealed\n- **Reverse mode** (dissolve): Text starts visible, ready to dissolve\n\n```javascript\n// No need to manually hide text - autoInitialize handles it!\nconst scrambler = new TextScrambler(element, {\n  duration: 2000,\n  autoInitialize: true, // default\n})\nscrambler.start() // Text will smoothly reveal from hidden state\n```\n\nTo disable auto-initialization and manage initial state manually:\n\n```javascript\nconst scrambler = new TextScrambler(element, {\n  autoInitialize: false, // You handle initial state\n})\n```\n\n## Examples\n\n### Reveal Animation (Default)\n\n```javascript\nconst scrambler = new TextScrambler(element, {\n  duration: 2000,\n  scrambleSymbols: '01',\n})\nscrambler.start()\n```\n\n### Dissolve Animation\n\n```javascript\nconst scrambler = new TextScrambler(element, {\n  duration: 1500,\n  reverse: true,\n  scrambleSymbols: 'x',\n})\nscrambler.start()\n```\n\n### Matrix-style Effect\n\n```javascript\nconst scrambler = new TextScrambler(element, {\n  duration: 3000,\n  scrambleSymbols: '01',\n  randomThreshold: 0.9,\n})\nscrambler.start()\n```\n\n## Browser Support\n\n- Chrome 61+\n- Firefox 55+\n- Safari 10.1+\n- Edge 79+\n\n## Performance\n\nThe library is optimized for performance:\n\n- Uses `TreeWalker` for efficient DOM text node collection\n- Batches DOM updates to minimize reflows\n- Leverages `requestAnimationFrame` for smooth animations\n- Minimal memory footprint with efficient string operations\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Acknowledgments\n\nInspired by the beautiful text effects on [Music for Programming](https://musicforprogramming.net/).\n\n## License\n\nMIT © [tizee](https://github.com/tizee)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftizee%2Ftext-scrambler.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftizee%2Ftext-scrambler.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftizee%2Ftext-scrambler.js/lists"}