0.1.0 • Published 8 years ago

flexie.js v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

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

PropertyTypeValuesDefaultRequired
rootstring--+
typestring"info", "warning", "confirm", "error""info"-

Animation

PropertyTypeValuesDefault
typestring"scale", "fade", "translateTop", "translateBottom", "translateLeft", "translateRight""scale"
timingFunctionstring"linear", "bounce", "easeOutBounce", "circ", "easeOutCirc""easeOutBounce"
durationintfrom 0 to Infinity =)1000 (ms)

Buttons

PropertyTypeValuesDefault
actionstring"confirm", "decline", "cancel"-
textstring
0.1.0

8 years ago