Skip to content

grigoryan-m/customizable-alerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customizable alert messages

This project is day #13 of 31-javascript-projects!

Customizable alert and input windows!

Installation

Just download and link customizable-alerts.js and customizable-alerts.css files to your HTML.

Using

There are two functions for now: cAlert() and cInput().

Just use them in the code!

To close the cAlert, just click on it!

To close the cInput, just type in the value and click the button!

Params

cAlert(title, text, <i>opacity</i>, <i>borderRadius</i>, <i>backgroundColor</i>);

Italic params have default value: opacity = 0.8, borderRadius = 12, backgroundColor = lightblue.

cInput(title, placeholder, buttonText, <i>opacity</i>, <i>borderRadius</i>, <i>backgroundColor</i>, callback);

Italic params have default value: opacity = 0.8, borderRadius = 12, backgroundColor = lightblue.

Important!!!

cInput uses callback, so here is the example of using this function:

cInput("Enter a value:", "Placeholder", "Submit", undefined, undefined, undefined, (value) => {

  console.log(value);
  // value is the string that user typed in input field
  // Do whatever you want with your value here

});

Planning on adding CDN soon.

Also planning to add another alert functions, but don't know if i'll ever do this!

By the way, you can test this two functions on my github pages. Link

About

Day #13 of 31-javascript-projects!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors