A lightweight JavaScript library that renders text in a brilliant style by displaying strings of random characters before the actual text.

Overview

cryptoWriter.js

Downloads

A lightweight javascript library which creates brilliant text animation by rendering strings of random characters before the actual text.

1.Usage

Load cryptoWriter.js and configure. index.html

<div id="container">
  <div id="myElement">Some Text</div>
</div>

<script src="cryptoWriter.js"></script>

app.js

new cryptoWriter(document.querySelector("#myElement"));

That's it! You are now running cryptoWriter.js!

The library uses ".innerText" property so be sure to select the element which immediately contains the text and not its parent container.

2.Options

Defaults

new cryptoWriter({
  randomRounds:5,
  completionTime:"auto",
  onVisible:true,
  delayTime:0.05,
  untilDelay:"random",
  enabledSets:["letters","lettersCaps","numbers"],
  allAtOnce:false
});

2.1 randomRounds

  • Type:Number
  • Determines the number of random strings of characters displayed before the actual text.

2.2 completionTime

  • Type:Number/String
  • Time taken for rendering to complete in seconds.
  • Its default value is set to "auto", which calculates completion time at 5 characters/second.
  • If you want to set the speed in terms of chars/second, simply put the value as follows replacing "6" with your desired number.
 new cryptoWriter({
   completionTime:"6chars"  
 });

2.3 delayTime

  • Type:Number
  • Time delayed in rendering in seconds.

2.4 onVisible

  • Type:Boolean
  • Set true if you want the rendering to start once the element is in viewport

2.5 untilDelay

  • Type:String
  • Determines what to do until rendering begins.
Value What it does
random Displays a random string until rendering begins.
same Displays the actual text until rendering begins.
empty Displays nothing until rendering begins.
To display text of your choice simply put that text instead of the above values

2.6 enabledSets

  • Type:Array
  • Choose the source of random characters.

To disable all sets leave the array empty. To enable all sets, set the value to 'all'.

Inbuilt Sets

Name Characters
letters abcdefghijklmnopqrstuvwxyz
lettersCaps ABCDEFGHIJKLMNOPQRSTUVWXYZ
numbers 0123456789
specialChars !@#$%^&*(`)-=[]|\;',./~_+{}:"<>?

2.7 customSet

  • Type:Array

  • Create and use a custom set of characters by using this option.

  • Example:

    new cryptoWriter(document.querySelector("#myElement"),{
    customSet:["$","@","%","5","9","3","a","j"],
    enabledSets:[]
    });
  • You can also use customSet along with enabledSets.

Using emojis as custom set

var emojis = "πŸ˜€πŸ˜ƒπŸ˜„πŸ˜πŸ˜†πŸ˜…πŸ˜‚πŸ€£πŸ₯²πŸ˜ŠπŸ˜‡πŸ™‚πŸ™ƒπŸ˜‰πŸ˜Œ";
emojis = Array.from(emojis);
new cryptoWriter(document.querySelector("#myElement"),{
customSet:emojis,
enabledSets:[]
});

2.8 allAtOnce

  • Type:Boolean
  • Controls if text appears one character at a time or all together.
  • Set this to true if you want all the text to appear at once.

3. Using with jQuery

var myElement = $("#myElement").get(0);
new cryptoWriter(myElement);

4. cryptoWriter.js Generator

If you want to play around with the options or want to generate cryptoWriter code for yourself, head over to the Generator.


Enjoy :)

You might also like...

A Cloudflare Workers service that fetches and renders Notion pages as HTML, Markdown, or JSON.

notion-fetch A Cloudflare Workers service that fetches and renders Notion pages as HTML, Markdown, or JSON. Powered by Durable Objects and R2. Usage P

Jan 6, 2023

This repo renders contribution data.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Sep 17, 2022

Instagram clone based on Demon slayer characters βš”οΈ

Instagram clone based on Demon slayer characters βš”οΈ

Instagram clone based on Demon slayer characters πŸ’‘ - About this project You must sign in with google to be able to like and comment on the demon slay

Nov 8, 2022

This package will help parse OData strings (only the Microsoft Dataverse subset). It can be used as a validator, or you can build some javascript library which consumes the output of this library.

@albanian-xrm/dataverse-odata This package will help parse OData strings (only the Microsoft Dataverse subset). It can be used as a validator, or you

Oct 22, 2022

Actual, a local-first personal finance tool

This is the main project to run Actual, a local-first personal finance tool. It comes with the latest version of Actual, and a server to persist chang

Jan 3, 2023

Powercord plugin to make "divider" roles into actual dividers

Powercord plugin to make

Powecord Role Dividers Install in Replugged Turns "divider" roles into actual dividers. Before: After: A divider role I have is not being shown as a d

Dec 28, 2022

Awesome Books project : An online Book Library. Storing book information using local storage and displaying it as a list on HTML page

This is project is my based on building an online Book Library. Storing book information using local storage and displaying it as a list on html page

Nov 11, 2022

Change import URLs in JavaScript code using import maps. e.g. `import * from "before"` to `import * from "after"`

esm-import-transformer Can transform any ESM source code import URLs using an import maps object. This package works in ES modules or in CJS. // Befor

Jul 31, 2022

JavaScript API based capstone project using TVmaze API for displaying and interacting with items from the data base.

JavaScript API based capstone project using TVmaze API for displaying and interacting with items from the data base.

Yuriy Chamkoriyski & Bonke Gcobo Javascript capstone project API-based webapp from Module 2 at Microverse Wireframe requirements The Home Page low fid

May 30, 2022
Releases(v1.0)
Simple string diffing. Given two strings, striff will return an object noting which characters were added or removed, and at which indices

Simple string diffing. Given two strings, striff will return an object noting which characters were added or removed, and at which indices

Alex MacArthur 196 Jan 6, 2023
Transform URLs in strings to actual links.

Transform URLs in strings to actual links. It will find valid links in the given string and create <a> tags for it. Internally, it uses this Regex to

Prince Neil Cedrick Castro 7 Nov 4, 2022
A simple code that creates a string of random characters displayed in an html object, all saving in a json file.

I'm 17 Years Old Developer / Lead Developer. ?? I'm wroking on AdrenalinaRP, GrandRDM. ?? I’m currently learning JavaScript. ?? I’m looking to collabo

OFFVIXEN 2 Nov 17, 2022
Lightweight (< 2.3kB gzipped) and performant natural sorting of arrays and collections by differentiating between unicode characters, numbers, dates, etc.

fast-natural-order-by Lightweight (< 2.3kB gzipped) and performant natural sorting of arrays and collections by differentiating between unicode charac

Shelf 5 Nov 14, 2022
An easy-to-use library to make your life easier when working with random numbers or random choices in javascript.

vrandom An easy-to-use library to make your life easier when working with random numbers or random choices in javascript. Table of contents Installati

Valerio Cipolla 1 Aug 16, 2022
A lightweight (the actual ship is heavy though), performat & powerful sharder for Discord.JS. Indomitable uses cluster module to evenly spread her weight (load) across your cores

Indomitable A lightweight (the actual ship is heavy though), performat & powerful sharder for Discord.JS. Indomitable uses cluster module to evenly sp

Saya 17 Nov 29, 2022
Dynamic island style widget for displaying what you're recently played on Spotify.

Spotify Island Dynamic island style widget for displaying what you're recently played on Spotify. ?? Check the demo spotify-island.mov 1. Get Spotify

Nurçin 5 Nov 24, 2022
Kuldeep 2 Jun 21, 2022
Renders and SVG schema of SARS-CoV-2 clade as defined by Neststrain

ncov-clade-schema https://ncov-clades-schema.vercel.app/ Visualizes current tree of SARS-CoV-2 clades. Allows to generate an SVG image of this tree. C

Nextstrain 5 Nov 3, 2022
Holder renders image placeholders in browser using SVG

Holder Holder renders image placeholders in browser using SVG. Used by thousands of open source projects (including Bootstrap v3) and many other sites

Ivan Malopinsky 5.8k Jan 2, 2023