Twikito /
onscroll-effect
A tiny JavaScript library to enable CSS animations when user scrolls.
44/100 healthLoading repository data…
camwiegert / repository
A tiny javascript library for obfuscating and revealing text in DOM elements. :astonished:
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A tiny javascript library for obfuscating and revealing text in DOM elements.
// Select elements and start.
const b = baffle('.someSelector').start();
// Do something else.
someAsyncFunction(result => {
// Change the text and reveal over 1500ms.
b.text(text => result.text).reveal(1500);
});
Download the latest release or install with npm.
npm install --save baffle
If 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.
// CommonJS
const baffle = require('baffle');
// ES6
import baffle from 'baffle';
To initialize baffle, all you need to do is call it with some elements. You can pass a NodeList, Node, or CSS selector.
// With a selector.
const b = baffle('.baffle');
// With a NodeList
const b = baffle(document.querySelectorAll('.baffle'));
// With a Node
const b = baffle(document.querySelector('.baffle'));
Once 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().
// Start obfuscating...
b.start();
// Or stop obfuscating...
b.stop();
// Obfuscate once...
b.once();
// You can set options after initializing...
b.set({...options});
// Or change the text at any time...
b.text(text => 'Hi Mom!');
// Eventually, you'll want to reveal your text...
b.reveal(1000);
// And they're all chainable...
b.start()
.set({ speed: 100 })
.text(text => 'Hi dad!')
.reveal(1000);
You can set options on baffle during initialization or anytime afterward with baffle.set().
// During initialize
baffle('.baffle', {
characters: '+#-•=~*',
speed: 75
});
// Any time with set()
b.set({
characters: '¯\_(ツ)_/¯',
speed: 25
});
options.charactersThe characters baffle uses to obfuscate your text. It can be a string or an array of characters.
Default:
'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz~!@#$%^&*()-+=[]{}|;:,./<>?'
options.excludeThese are the characters that baffle ignores in your text when obfuscating it. You can pass in an array of characters.
Default:
[' ']
options.speedThis is the frequency (in milliseconds) at which baffle updates your text when running.
Default:
50
An instance of baffle has six methods, all of which are chainable.
baffle.once()Obfuscates each element once, using
options.characters.
baffle.start()Starts obfuscating your elements, updating every
options.speedmilliseconds.
baffle.stop()Stops obfuscating your elements. This won't reveal your text. It will only stop updating it. To reveal it, use
reveal().
baffle.reveal([duration], [delay])Reveals your text over
durationmilliseconds (default:0), with the option to delay bydelaymilliseconds.
baffle.set([options])Updates instance options using the passed
optionsobject. You can set any number of keys, even while running.
baffle.text(fn)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 fromfnwill be used as the new text.
Selected from shared topics, language and repository description—not editorial ratings.
Twikito /
A tiny JavaScript library to enable CSS animations when user scrolls.
44/100 healthBaseMax /
Most Ripple tools just run an animation from a fix point, This tiny library provide a ripple effect which will run from any point the end-user do the action. (CSS + Pure JS)
48/100 healthrishiosaur /
🕔 A ridiculously tiny asynchronous effect library for React.
46/100 healthcesarlevel /
tinyTypewriter.js is just a small (1kb) piece of vanilla javascript that generates a typewriter effect.
39/100 healthlocalnetwork /
Medium is a tiny, pure JavaScript library for Progressive Image Loading with a blur effect to reduce the page load time; as seen on Medium and the lazyload functionality.
27/100 healthyezert /
SeleneJS is an experimental, compiler-first frontend UI framework that pairs a tiny JavaScript runtime with an optional Rust/WASM template compiler. It provides fine‑grained reactivity (signal, effect, computed), a minimal VNode API (h) and reactiveRender for dependency-tracked rendering.
35/100 health