{"id":13578360,"url":"https://github.com/camwiegert/baffle","last_synced_at":"2025-09-27T10:30:55.609Z","repository":{"id":47403257,"uuid":"63655543","full_name":"camwiegert/baffle","owner":"camwiegert","description":"A tiny javascript library for obfuscating and revealing text in DOM elements. :astonished:","archived":true,"fork":false,"pushed_at":"2017-08-28T06:48:41.000Z","size":564,"stargazers_count":1760,"open_issues_count":0,"forks_count":85,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-09-15T08:18:37.768Z","etag":null,"topics":["effect","javascript","library","text"],"latest_commit_sha":null,"homepage":"https://camwiegert.github.io/baffle","language":"JavaScript","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/camwiegert.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}},"created_at":"2016-07-19T03:07:17.000Z","updated_at":"2025-09-02T08:48:37.000Z","dependencies_parsed_at":"2022-09-02T19:51:57.321Z","dependency_job_id":null,"html_url":"https://github.com/camwiegert/baffle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/camwiegert/baffle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camwiegert%2Fbaffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camwiegert%2Fbaffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camwiegert%2Fbaffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camwiegert%2Fbaffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camwiegert","download_url":"https://codeload.github.com/camwiegert/baffle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camwiegert%2Fbaffle/sbom","scorecard":{"id":264068,"data":{"date":"2025-08-11","repo":{"name":"github.com/camwiegert/baffle","commit":"d505a960a36d4fdcf5d331b17807824ba5e34b43"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 2/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: stream error: stream ID 439; CANCEL; received from peer","details":null,"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T11:31:26.220Z","repository_id":47403257,"created_at":"2025-08-17T11:31:26.220Z","updated_at":"2025-08-17T11:31:26.220Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277218775,"owners_count":25781445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["effect","javascript","library","text"],"created_at":"2024-08-01T15:01:29.784Z","updated_at":"2025-09-27T10:30:55.313Z","avatar_url":"https://github.com/camwiegert.png","language":"JavaScript","readme":"# baffle.js\nA tiny javascript library **for obfuscating and revealing text** in DOM elements.\n\n[camwiegert.github.io/baffle](https://camwiegert.github.io/baffle)\n\n\u003e \u003cimg src=\"https://camwiegert.github.io/baffle/assets/images/baffle.js.png\" width=\"500\" alt=\"baffle.js\"\u003e\n\n\n- ~1.8kb gzipped :zap:\n- Dependency-free :tada:\n- IE9+ :heavy_check_mark:\n\n```javascript\n// Select elements and start.\nconst b = baffle('.someSelector').start();\n\n// Do something else.\nsomeAsyncFunction(result =\u003e {\n    // Change the text and reveal over 1500ms.\n    b.text(text =\u003e result.text).reveal(1500);\n});\n```\n\n---\n\n## Getting Started\n\n#### Step 0: Install\n\n[Download the latest release](https://raw.githubusercontent.com/camwiegert/baffle/master/dist/baffle.min.js) or install with npm.\n\n```sh\nnpm install --save baffle\n```\n\n#### Step 1: Reference\nIf you linked baffle directly in your HTML, you can use `window.baffle`. If you're using a module bundler, you'll need to import baffle.\n\n```javascript\n// CommonJS\nconst baffle = require('baffle');\n\n// ES6\nimport baffle from 'baffle';\n```\n\n#### Step 2: Initialize\nTo initialize baffle, all you need to do is call it with some elements. You can pass a NodeList, Node, or CSS selector.\n\n```javascript\n// With a selector.\nconst b = baffle('.baffle');\n\n// With a NodeList\nconst b = baffle(document.querySelectorAll('.baffle'));\n\n// With a Node\nconst b = baffle(document.querySelector('.baffle'));\n```\n\n#### Step 3: Use It\nOnce you have a baffle instance, you have access to all of the baffle methods. Usually, you'll want to `b.start()` and, eventually, `b.reveal()`.\n\n```javascript\n// Start obfuscating...\nb.start();\n\n// Or stop obfuscating...\nb.stop();\n\n// Obfuscate once...\nb.once();\n\n// You can set options after initializing...\nb.set({...options});\n\n// Or change the text at any time...\nb.text(text =\u003e 'Hi Mom!');\n\n// Eventually, you'll want to reveal your text...\nb.reveal(1000);\n\n// And they're all chainable...\nb.start()\n    .set({ speed: 100 })\n    .text(text =\u003e 'Hi dad!')\n    .reveal(1000);\n```\n\n## Options\nYou can set options on baffle during initialization or anytime afterward with `baffle.set()`.\n\n```javascript\n// During initialize\nbaffle('.baffle', {\n    characters: '+#-•=~*',\n    speed: 75\n});\n\n// Any time with set()\nb.set({\n    characters: '¯\\_(ツ)_/¯',\n    speed: 25\n});\n```\n\n### `options.characters`\n\u003e The characters baffle uses to obfuscate your text. It can be a string or an array of characters.\n\u003e\n\u003e **Default:** `'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz~!@#$%^\u0026*()-+=[]{}|;:,./\u003c\u003e?'`\n\n### `options.exclude`\n\u003e These are the characters that baffle ignores in your text when obfuscating it. You can pass in an array of characters.\n\u003e\n\u003e **Default:** `[' ']`\n\n### `options.speed`\n\u003e This is the frequency (in milliseconds) at which baffle updates your text when running.\n\u003e\n\u003e **Default:** `50`\n\n## Methods\nAn instance of baffle has six methods, all of which are chainable.\n\n### `baffle.once()`\n\u003e Obfuscates each element once, using `options.characters`.\n\n### `baffle.start()`\n\u003e Starts obfuscating your elements, updating every `options.speed` milliseconds.\n\n### `baffle.stop()`\n\u003e Stops obfuscating your elements. This won't reveal your text. It will only stop updating it. To reveal it, use `reveal()`.\n\n### `baffle.reveal([duration], [delay])`\n\u003e Reveals your text over `duration` milliseconds (default: `0`), with the option to delay by `delay` milliseconds.\n\n### `baffle.set([options])`\n\u003e Updates instance options using the passed `options` object. You can set any number of keys, even while running.\n\n### `baffle.text(fn)`\n\u003e Updates the text in each element of your instance using function `fn`, which receives the current text as it's only parameter. The value returned from `fn` will be used as the new text.\n\n---\n\n- **License** MIT\n- **Made by** [Cam Wiegert](http://camwiegert.com)\n- **Inspired by** [Oak](http://oak.is/)\n","funding_links":[],"categories":["JavaScript","31. 文本处理"],"sub_categories":["24.3 Web Sockets"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamwiegert%2Fbaffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamwiegert%2Fbaffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamwiegert%2Fbaffle/lists"}