2.1.3 • Published 2 years ago

frontle-modal v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Frontle Modal

Modal UI in Frontle

화면-기록-2022-07-12-오후-3.40.17

Usage

// at css file
.modalPosition{
    position: absolute;
}
.contentsWidth{
    width: 80%;
}
.contentsHeight{
    height: 200px;
}

// at js file
import frontle_modal from "browser_modules/frontle-modal/module.js";
const Modal = frontle_modal.Modal;

let modal = new Modal('<button id="closeButton">close</button>');
modal.modalClass = 'modalPosition';
modal.modalContentsClass = 'contentsWidth contentsHeight';
modal.modalBackgroundClass = '';
modal.start = () => {
    console.log('modal start!');

    document.getElementById('closeButton').onclick = () => {
        modal.close();
    }
}
modal.open();

Install

Frontle

frontle install frontle-modal

Download files

https://github.com/Artifriends-inc/Frontle-Modal

API

new modal(html)

Create a modal object

let modal = new Modal('<button id="closeButton">close</button>');

.modalClass

.modalContentsClass

.modalBackgroundClass

Set the css class of a modal

modal.modalClass = 'modalPosition';
modal.modalContentsClass = 'contentsWidth contentsHeight';
modal.modalBackgroundClass = '';

.transitionSeconds

Set the modal animation time

modal.transitionSeconds = 0.3;

.backgroundClickExit

Set whether modal can be closed by clicking on modal background

modal.backgroundClickExit = true;

.awake

This lifecycle runs before modal rendering.

modal.awake = () => { console.log('before rendering') }

.start

This lifecycle runs after modal rendered

modal.start = () => { console.log('after rendering') }

.end

This lifecycle runs before modal termination

modal.end = () => { console.log('before termination') }

.sleep

This lifecycle runs after modal termination

modal.sleep = () => { console.log('after termination') }

.open()

Open modal

modal.open();

.close()

Close modal

modal.close();

People

The original author of frontle-modal is MushStory

License

MIT

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago