@danicastar/html-dialog
v1.0.0
Published
a package to test html dialogs
Downloads
5
Readme
html-dialog
This just a demo. so it looks ugly. but you can see code to learn html5 skills.
Usage
<div>
<h1>Hello</h1>
<button id="op">open</button>
</div>
<script type="module">
import { init,create } from './index.js'
let btn_open = document.getElementById('op')
btn_open.onclick=function(){
// init api
init({
// enable showModal
modal:true,
// add some styles for you
css:true,
// some styles config (if css true)
backdropColor: 'red',
bdColor: 'blue',
bgColor: 'green'
})
// create a dialog, can't open > 1 dialog one time
create({
closeText: 'undo',
title: 'Title',
// can be HTML
texts: '<b>hello dialog</b>'
},()=> {
console.log('callback')
})
}
</script>