Giter VIP home page Giter VIP logo

cute-alert's Introduction

Cute Alert

img

I created this JS library as an open-source project (for studying purposes) to provide beautiful alert box messages made with HTML, CSS and JS only. Feel free to contribute with a pull request or suggestions.

Installation Instructions

  • Clone this repository into your project's lib folder.
  • Import both "style.css" and "cute-alert.js" into your code just like described on the image below:

img

Docs

It's way too simple for you to import this lib into your code, all you have to do is call cuteAlert() and pass its arguments in object notation.

buttonText is an optional parameter, by default it's set as "OK".

type will define what kind of alert box will be shown.

img img img img

cuteAlert()returns a Promise, so you can use then to execute an action after the alert box frame is closed.

img

As for the question alert box, you can choose what you want to do after any of the buttons is pressed with then aswell.

confirmText and cancelText are both optional, by the default they are set as "Confirm" and "Cancel" respectively.

img

Close button as a circle

If you wish to have the close button styled as a circle, you need to pass closeStyle: "circle" as an argument in cuteAlert().

img

Toasts

It's even easier to use toasts, all you have to do is call cuteToast() and pass type, message and timer(in miliseconds) as its arguments.

img img img img

It also returns a Promise, so you can use then to execute an action after the toast is closed or reaches its end by a timer.

Alert Box Design

Dev

Contributors

cute-alert's People

Contributors

gustavosmanc avatar dutragames avatar lbert1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.