EasyScript Documentation:

Installation

For adding the EasyScript CDN, put the following tag inside the body tag of your website, above your own script tag.

Also you can download the script and link it manualy

If you are using npm you can execute npm i easyscript

Date

Functions for making easy using date functions.

NOTE: This are static values, so if you want to make them dynamic, you can surroud them with a setInterval()

EasyScript.date.month()

Returns the name of the actual month in English.

EasyScript.date.day()

Returns the name of the actual day of the week in English.

EasyScript.date.year()

Returns the actual year.

EasyScript.date.date()

Returns the actual date. Example: Tuesday, the 21 of July, 2028.

EasyScript.date.hours()

Returns the actual hours.

EasyScript.date.minutes()

Returns the actual minutes.

EasyScript.date.time()

Returns the actual time hours + : + minutes. Example: 12:12.

Math

Simplifies math related things.

EasyScript.math.random()

Returns a random number between parameter 1 and parameter 2 passed. The number can not be a decimal.

EasyScript.math.decimalRandom()

Returns a random number between parameter 1 and parameter 2 passed. The number can be a decimal.

Command

Lots of commands for different things.

EasyScript.command.copyToClipboard()

Copies to clipboard the thing passed in the parameter 1. Parameter 1 is a boolean where you can select if you want to add an alert when text was copied

EasyScript.command.addProgressbar()

It adds a scroll progressbar like the one up on this page. The first parameter is the color of the scrollbar, the second parameter is the height of it.

EasyScript.command.selectFirstWord()

This command is for selecting the first word of an element and adding a class to it. The first parameter is the element to select the add the class to the first word. The second one is the name of the class to add to the first word.

EasyScript.command.selectLastWord()

This command is for selecting the last word of an element and adding a class to it. The first parameter is the element to select the add the class to the last word. The second one is the name of the class to add to the last word.

DOM

Commands for doing DOM more easy.

EasyScript.dom.hideElement()

Hide an element. The only parameter is the element to hide.

EasyScript.dom.showElement()

Show an element. The only parameter is the element to show.

EasyScript.dom.event()

Another way to declare AddEventListeners. First parameter is the element to add the addEventListener. Second parameter is the name of the event. Third parameter is the thing that happens when the event was executed.