Make a prank to your designer friend.
This is the script that plays witht text kerning and brings the headache to the reader.
- Add the
piss-off-text.js
(or the minified one) to the page. - Run
pissOffText();
and enjoy. - Extra params can be passed into the function as the object, for instance,
pissOffText({text: 'article > p'});
. Params are:
- text — means the CSS selector for elements containing text to modify.
This allows to patch the particular part of the page, not the entire one.
Defaults to"p"
. - level — one of
"letters"
(default) or"words"
. Means how deep the distortion will work. - distortion — is the object that contains one or both of
"v"
and"h"
properties. It describes the distortion amplitude: 0 leaves the chunks untouched, 100 does the Harlem shake.
Defauls to{v: 0, h: 10}
.
Roman Melnyk email.rom.melnyk@gmail.com