- download text-transform.js from repository
- include this file to your project
- make sure your HTML-syntax looks like this
<p id="to_replace" tt-text="JavaScript to encode and decode text" tt-chars="0011 "></p>- initialize text-transform with
new Text_Transform('#to_replace');- text-transform gets triggered either if element is in view or after DOM was loaded
Take a look at the example above.
- use
tt-textin your html element and specify the text you want to encode. - use
tt-charsin your html element to specify the characters your text will be transformed to in random order. - if no
tt-charsis set, default will be used:@!§$%&\/()=?+*#-_<>{}[]
- define your html element
<p id="to_replace"></p>- set your JavaScript options
new Text_Transform('#to_replace', {
text: "Option 2 with extra options",
chars: "0011 ",
loop: true,
encode_delay: 10000,
decode_delay: 4000
});| Option | Description |
|---|---|
| text | Text that will be decoded |
| chars | Characters your text will be transformed to in random order |
| loop | Run text transform in loop |
| encode_delay | if loop is true time to wait until text-transform will be executed again |
| decode_delay | time to wait until encoded text will be decoded again |