diff --git a/README.md b/README.md index fd49b61..270866c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,115 @@ Modalizer.js == + +Lightweight extension over bootstrap's modals to improve of the control, animations and visualization of modal windows. + +![GitHub](https://img.shields.io/github/license/jlgarridol/modalizerjs?style=flat) +![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/jlgarridol/modalizerjs?style=flat) +![GitHub file size in bytes](https://img.shields.io/github/size/jlgarridol/modalizerjs/dist/js/modalizer.min.js?color=f7df1e&label=size&logo=javascript&style=flat) +![GitHub file size in bytes](https://img.shields.io/github/size/jlgarridol/modalizerjs/dist/css/modalizer.min.css?color=036fb8&label=size&logo=css3&logoColor=036fb8&style=flat) + +--- +Getting starting +-- +### Installation +Via npm +```bash +$ npm install modalizer.js +``` +or add it directly using a CDN: +```html + + +``` + +### Basic usage +#### Launch modal +Add class modalinit and modal's identifier in ```data-modal``` attribute to a ``````, `````` or any else HTML element. + +Add class ```modalizer``` to the modal div. + +**Example:** +```html + Click to open + + +``` + +#### Close a modal +Add class ```closemodal``` to a ``````, `````` or any else HTML element inside a modal ```div```. + +**Example:** +```html + +``` + +### Animate a modal + +Use a Animate.css animation for open and close animation. + +Add ```data-animate-in``` and ```data-animate-out``` with Animate.css animation (without ```animate__```), remove class ```fade``` and add class ```animate__animated``` in modal. + +**Example:** +```html + +``` + +### Optionable modals +A optionable modal is which have multiple submodals inside and the user can navigate it between their. + +To transform a modal into an optionable you need to add the ```modal-optionable``` class and assign a ```data-stack``` to it. +It is necessary create a instance of ```MOD_Stack``` with the same name in the *javascript*. + +**Example:** +```html + + +``` + +#### Create submodals + +The submodals are the ```modal-dialog``` with ```role="document"``` and have full compatibility with classes for ```modal-dialog``` in *Bootstrap* like ```centered``` or ```scrollable```. + +Any submodal, except the first, must have the style attribute ```display: none```. + +To navigate between submodals exists two classes: ```nextaction``` and ```beforeaction``` to apply to a ``````, ``` + + ... + + + +``` + +### Fullscreen modal +For a fullscreen modal it is necessary add the class ```fullscreen``` to the ```div```s with classes ```modal-dialog```, ```modal-content```, ```modal-header``` and ```modal-footer```. To make it only for mobile screens you have to add ```-sm``` to ```fullscreen```. + +### Blur background +For blur background on modal open it is neccesary include all HTML elements (except modals) inside a ```div``` with the identifier and class ```MOD_supreme-container``` \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index c9b5a9c..f055d63 100644 --- a/doc/index.html +++ b/doc/index.html @@ -128,7 +128,7 @@ ... </div>

Optionable modals

-

A optionable modal is that have multiple submodals inside and the user can navigate it between their.
To transform a modal into an optionable you need to add the modal-optionable class and assign a data-stack to it.
It is necessary create a instance of MOD_Stack with the same name in the javascript

+

A optionable modal is which have multiple submodals inside and the user can navigate it between their.
To transform a modal into an optionable you need to add the modal-optionable class and assign a data-stack to it.
It is necessary create a instance of MOD_Stack with the same name in the javascript

Example:

<div class="modal modalizer fade modal-optionable" data-stack="defaultStack" id="standart" tabindex= "-1" role="dialog">
     ...
@@ -161,8 +161,9 @@
     </div>
 </div>

Fullscreen modal

-

For a fullscreen modal it is necessary add the class fullscreento the divs with classes modal-dialog, modal-content, modal-header and modal-footer. To make it only for mobile screens you have to add -sm to fullscreen

- +

For a fullscreen modal it is necessary add the class fullscreen to the divs with classes modal-dialog, modal-content, modal-header and modal-footer. To make it only for mobile screens you have to add -sm to fullscreen

+

Blur background

+

For blur background on modal open it is neccesary include all HTML elements (except modals) inside a div with the identifier and class MOD_supreme-container