An open API service indexing awesome lists of open source software.

https://github.com/pjaerr/vanilla-modal

A material design-esque modal that only uses HTML, CSS and JS.
https://github.com/pjaerr/vanilla-modal

Last synced: 11 months ago
JSON representation

A material design-esque modal that only uses HTML, CSS and JS.

Awesome Lists containing this project

README

          

# vanilla-modal
A material design-esque modal that uses no libraries, only HTML, CSS and JS. Other things on the modal such as buttons and text fields won't fit material design**.

Include ```modal.css``` at the top of your html file, and ```modal.js``` at the bottom of your html file.

``````
``````

First put the html code below somewhere in your body, anything outside of this div will be covered
by a black overlay and rendered unusable (apart from the modal) when the modal is toggled on.

```

```

Next, put this html code somewhere in your body, it will add the modal in a hidden state to your page.
The modal will be centered via "margin: 0 auto;" but this can be changed in the css.

```


```

To open or close the modal, call the function 'toggleModal()'.

Hopefully this is useful to someone, it doesn't depend on any libraries and so I thought I should share it as it is easy to add to a web page. If you wish to change the code and make it better, by all means create a pull request.

![Modal Without Content](https://user-images.githubusercontent.com/11336751/29475786-2e37be42-8459-11e7-942d-7d71c806d140.PNG "Modal Without Content")

![Modal With Content](https://user-images.githubusercontent.com/11336751/29475741-0205a96a-8459-11e7-85c2-b8a6fa0517d6.PNG "Modal With Content")