Give a simple modal at the middle of a page, okayable and dismissable with a click.
Demo: haroen.me/modal.
Link both style.css
and modal.js
in your html file. Then in a script you can make a new notice by doing
modal(modalText.value, function(){
// code to evaluate when pressed on okay
}, function(){
// code to evaluate when pressed on cancel
});
You need to install this via npm first like this:
npm install --save git+https://github.com/haroenv/modal.git
Just require modal as any other CommonJS module after installing it via npm:
var modal = require('modal');
In terms of CSS you have to decide whether you reference the CSS file, which is in the node_modules
folder or use a tool like parcelify to bundle the CSS.
Haroen Viaene in haroenv/maps-checker.
Modal is licensed under a Creative Commons Attribution 4.0 International License. No warranty whatsoever.