npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fmti-modal-window

v1.0.5

Published

Dynamic modal window for Web Browser(Javascript)

Downloads

5

Readme

Overlay Modal Window / Popup

A simple javascript modal / popup works out of the box. When you don't like writing html, css and javascript again and again in your application. Compatible with all Javascript Frameworks.

Features

  • Flexible and configurable
  • Quick effects hide and show
  • Displays in center of the screen
  • Customizable using CSS
  • Dynamic content in popup

Demo Video Links

Simple Notification Modal Window
Modal Window with CTA's
Modal window with Enable/Disable button & Checkbox control

Installation

Ckick here for easy Installation

Install FMTI Modal Window using below command npm install fmti-modal-window --save

[ ] Step 1: Add div tag in your html file as below

<div id="apModal" style="display:none"></div>

[ ] Step 2: Import package

    import fmtiModalWindow from 'fmti-modal-window';

[ ] Step 3: Intialize Modal Window using

  //Below are the properties exist in modal window
  const modalwindow =  fmtiModalWindow.init({
    containerStyle:{},
    headerInfo:{
       showTitle: true,
       text: "The Purpose of our lives",
       style:{}
    },
    bodyContentInfo:{
       text: "Everyone thinks of changing the world, but no one thinks of changing himself",
       style:{},
       secondary:[{
          text: "Life is either a great adventure or nothing. `Helen Keller",
          style:{
             "text-align": "center",
             "color": "brown"
          }
       }],
       actions:[
          {
             type: "checkbox",
             id: "LittleStart",
             targetElId: "FMTI-MODAL-BTN-RIGHT", //Button Id enable/disable
             text: "Hey! Don't show me again",
             style:{},
             onCheck: (btnId)=>{ // btnId latest change
                fmtiModalWindow.enableButton(btnId);
             },
             onUnCheck: (btnId)=>{ //  btnId latest change
                fmtiModalWindow.disableButton(btnId);
             }
          }
       ]
    },
    footerInfo:{
       btnLeft:{
          show: true,
          enable: true,
          text: "Cancel",
          style:{},
          onclick:"DESTROY"
       },
       btnRight:{
          show: true,
          text: "Delete",
          enable: false,
          style:{},
          onclick:()=>{}
       }
    }
 });

[ ] Step 4: Subscribe to Modal Window promise

  // `{success: true, job: "Done 🚶🏿‍♂️", controllerId: "apModal"}`
    modalwindow.then((data)=>{
            if(data.success){
               fmtiModalWindow.openModal(data.controllerId);
            }
            }).catch((err)=>{
                  console.log("err",err);
            });

Available Methods

| Function | Parameters | Description | |-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------| | destroyModal() | string:eg: fmtiModal.destroyModal("apModal") apModal is id given for modal window| It will close the modal popup and removes the element from dom.| | openModal() | string: fmtiModal.openModal(data.controllerId); controllerId is retrieved by init() promose. | This method display popup as an overlay on the window.| | disableButton() | string: fmtiModal.disableButton("FMTI-MODAL-BTN-RIGHT"); Button id provided to method disable the button. | This method disables the footer CTA button| | enableButton() | string: fmtiModal.enableButton("FMTI-MODAL-BTN-RIGHT"); Button id provided to method enable the button. | This method enables the CTA button|

Style Properties (Latest)

  • containerStyle : {} object can be passed as root element to style popup container
  • style:{} In each indvidual property eg: headerInfo, footerInfo, bodyContentInfo supports style object now

Secondary Text (Latest)

 bodyContentInfo:{
   text: "dummy text...",
   style:{},
   secondary:[{ 
      text: "Life is either a great adventure",
      style:{
         "text-align": "center",
         "color": "brown"
      }
   }]
},