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

mellow-modal

v1.0.4

Published

Hello everyone, Mellow Modal is a modal creation tool. On advanced systems, it makes more sense in terms of performance to recreate the bootstrap modals in the DOM instead of constantly adding them to the page. But it takes a lot of code to create a moda

Downloads

6

Readme

Mellow Modal

Hello everyone, Mellow Modal is a modal creation tool. On advanced systems, it makes more sense in terms of performance to recreate the bootstrap modals in the DOM instead of constantly adding them to the page. But it takes a lot of code to create a modal every time, and it's really cumbersome.

If you are using bootstrap modals in your project, the fastest and easiest way to create a modal is with Mellow Modal.

Install

Mellow Modal is very simple to install. You can easily install it with the help of NPM:

npm i mellow-modal
npm install

or you can add the library directly to your project.

<script src="/path/your/folder/mellow-modal.js"></script>

Usage

Mellow Modal is very easy to start. You can init with a single command

const modal = new MellowModal;
modal.fire();

this way, you can start a quick modal. By default a modal will be initialized.

You can add certain parameters in JSON format to design your modals.

Parameters

| Parameter | Type | Default | Detail | | ------------- | ------------- | ------------- | ------------- | | id | STRING | mellowModal | Lets you specify an id for the modal. | | size | STRING | modal-md | Allows you to change the dimensions of the modal. modal-sm, modal-md or modal-lg. | | backdrop | BOLEAN | false | prevents the modal from closing when clicking outside the modal or pressing the ESC key. | | showCloseButton | BOLEAN | true | In the upper right corner of the modal, it shows the close modal button. | | title | STRING | null | Adds a title for the modal. | | header | BOLEAN | true | Shows or hides the Modal Header. Default is true | | footer | BOLEAN | true | Shows or hides the Modal Footer. Default is true | | showConfirmButton | BOLEAN | true | Adds confirmation button to Modal Footer. Default is true | | confirmButtonType | STRING | success | Sets the style of the confirmation button. Check Bootstrap Colors for other styles. | | confirmButtonText | STRING | Confirm | Sets the text of the confirmation button. | | buttons | STRING | null | Adds different buttons to Modal Footer. | | content | STRING | null | Adds HTML format content to Modal Content. | | animation | STRING | fade | Lets you define a custom class for the modal's opening animation. | | allowFullscreen | BOLEAN | false | Starts the modal in full screen. Disables the size parameter. | | css | STRING | null | lets you add custom css for the overall modal. |

Parameter Examples

Lets you specify an id for the modal.

modal.fire({
  /* ... */
  id : "exampleModal",
  /* ... */
});

Allows you to change the dimensions of the modal. modal-sm, modal-md or modal-lg. Default is modal-md

modal.fire({
  /* ... */
  size : "modal-lg",
  /* ... */
});

prevents the modal from closing when clicking outside the modal or pressing the ESC key. Default is false

modal.fire({
  /* ... */
  backdrop : true,
  /* ... */
});

In the upper right corner of the modal, it shows the close modal button. Default is true

modal.fire({
  /* ... */
  showCloseButton : true,
  /* ... */
});

Adds a title for the modal.

modal.fire({
  /* ... */
  title : "Example Modal Title",
  /* ... */
});

Shows or hides the Modal Header. Default is true

modal.fire({
  /* ... */
  header : true,
  /* ... */
});

Shows or hides the Modal Footer. Default is true

modal.fire({
  /* ... */
  footer : true,
  /* ... */
});

Adds confirmation button to Modal Footer. Default is true

modal.fire({
  /* ... */
  showConfirmButton : true,
  /* ... */
});

Sets the style of the confirmation button. Check Bootstrap Colors for other styles. Default success

modal.fire({
  /* ... */
  confirmButtonType : "primary",
  /* ... */
});

Sets the text of the confirmation button. Default Confirm

modal.fire({
  /* ... */
  confirmButtonText : "Save",
  /* ... */
});

Adds different buttons to Modal Footer.

modal.fire({
  /* ... */
  buttons : "<button type="button" class="btn btn-primary">Primary</button>",
  /* ... */
});

Adds HTML format content to Modal Content.

modal.fire({
  /* ... */
  content : '<p>This is the content of the modal.</p>',
  /* ... */
});

Lets you define a custom class for the modal's opening animation. Default Fade

modal.fire({
  /* ... */
  animation : 'custom-animation-class',
  /* ... */
});

Starts the modal in full screen. Disables the size parameter. Default false

modal.fire({
  /* ... */
  allowFullscreen : true,
  /* ... */
});

lets you add custom css for the overall modal.

modal.fire({
  /* ... */
  css : 'background:red',
  /* ... */
});

Licence

The Laravel framework is open-sourced software licensed under the MIT license.