0.1.0 • Published 8 years ago
flexie.js v0.1.0
FlexieJS v0.1.0
Lightweight native javascript modal window framework
Installation
Using npm
npm install flexiejs --save
Using tag
Download flexie.min.js and flexie.min.css from this repository and insert it in your HTML:
<!-- import flexie styles -->
<link rel="stylesheet" href="some-style-path/flexie.min.css">
<!-- import flexie -->
<script type="text/javascript" src="some-path/flexie.min.js"></script>
Usage
import flexie from "flexiejs"
flexie.Modal({
root: "#flexie-root"
type: "info",
animation: {
duration: 1500, // ms
timingFunction: "easeOutBounce",
type: "scale"
},
buttons = [{
action: "confirm",
text: "cancel"
}, {
action: "cancel",
text: "cancel"
}],
onConfirm: function() {
alert("confirmed!");
},
onDecline: function() {
alert("declined!");
},
onOpen: function() {
alert("opened!");
}
});
Options
Common
Property | Type | Values | Default | Required |
---|---|---|---|---|
root | string | - | - | + |
type | string | "info", "warning", "confirm", "error" | "info" | - |
Animation
Property | Type | Values | Default |
---|---|---|---|
type | string | "scale", "fade", "translateTop", "translateBottom", "translateLeft", "translateRight" | "scale" |
timingFunction | string | "linear", "bounce", "easeOutBounce", "circ", "easeOutCirc" | "easeOutBounce" |
duration | int | from 0 to Infinity =) | 1000 (ms) |
Buttons
Property | Type | Values | Default |
---|---|---|---|
action | string | "confirm", "decline", "cancel" | - |
text | string |
0.1.0
8 years ago