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

woody-alert-me

v3.0.8

Published

Alert Box: Easily integrate customizable alert boxes into web applications for simplified user interaction with basic alerts and confirmation dialogs.

Downloads

136

Readme

Woody's alertMe

woody-alert-me is a lightweight library for creating customizable alert boxes with animations.

Installation

You can install woody-alert-me via cdn link: for css:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sayrgyiwoody/alertMe-npm-package@085d27b/src/woody-alert-me.css"></link>

for js:

<script src="https://cdn.jsdelivr.net/gh/sayrgyiwoody/alertMe-npm-package@085d27b/src/woody-alert-me.js"></script>

Or You can install woody-alert-me via npm:

npm i woody-alert-me

Usage

First, link the CSS and JavaScript provided with Woody's AlertMe library:

<link rel="stylesheet" href="./path/to/woody-alert-me.css">
<script src="./path/to/woody-alert-me.js"></script>

Examples

Example 1 : Basic Alert with the desired message

alertMe('Alert', 'This is a basic alert.');

Example 2 : Customized alerts by passing an options object to the alertMe function

alertMe({
    title: 'Customized Alert',
    text: "This alert box has customized button text and without close button ",
    icon: 'info',
    showCancelButton: true,
    showCloseButton:false,
    confirmButtonColor : "#222222",
    cancelButtonColor : "#eeeeee",
    confirmButtonText : "Click Me",
    cancelButtonText : "nah",
    });

Example 3 : Confirm or Cancel Alert, allowing users to take actions based on their choices:

alertMe({
            title: "Loading",
            text: "Select accept or cancel. ",
            icon: "loading",
            showCancelButton: true,
            confirmButtonText:'Accept',
            onConfirm: function () {
            alertMe({
                title: "Confirmed!",
                text: "Your action has been confirmed.",
                icon: "success",
            });
            },
            onCancel: function () {
                alertMe({
                title: "Canceled!",
                text: "Action is canceled.",
                icon: "error",
            });
            }
        });


Example 4 : Custom text color and bg color

alertMe({
    title: "Custom Alert",
    text: "This is a custom alert box with specified text color and background color.",
    color: '#ffffff', // Text color
    bgColor: '#222222', // Background color
})

Example 5 :Using Image inside alert box

alertMe({
    title: "Custom Alert with Image",
    text: "This is a custom alert box with an image.",
    imageUrl: "./path/to/image.png", // Image URL
    //imageWidth: 300, // Adjust image width if necessary
    //imageHeight: 200, // Adjust image height if necessary
    imageAlt: "New Image", // Alt text for the image
})

Example 6 : Using HTML content in alert box

alertMe({
    title: "HTML Content",
    html: `
        <p class="text-center">This is a custom alert box with <b>HTML</b> content. and <b>Icon</b> inside button</p>
        <input type="email" class="form-control mb-3" id="exampleFormControlInput1" placeholder="[email protected]">
    `,
    confirmButtonText : `<i class="fa-regular fa-thumbs-up"></i> OK`,
    cancelButtonText : `<i class="fa-regular fa-thumbs-down"></i> Cancel`,
    showCancelButton : true,
})

Available Icons

The following icons are available for use:

  • Success
  • Error
  • Info
  • Loading
  • Question

| success | error | info | loading | question | |---------|---------|---------|---------|---------| | Image 1 | Image 2 | Image 3 | Image 4 | Image 5 |


Woody's AlertMe library simplifies adding alerts to web projects. Whether basic or complex, AlertMe has you covered.