1.0.0 • Published 9 months ago

@danicastar/html-dialog v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

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>
1.0.0

9 months ago