Posts

Popify (js library)

javascript popup library Popify (js library) detailed blog
Popify (js library)
INSTALLATION
Copy and paste the following in the head tag of your web code:
<script src="https://raw.githack.com/BartikaKumar/Popify/main/script.js"></script>
USAGE
Use the alertify() function to pop-up an alert and the toastify() function to use a toast.
alertify({
    title:'Simple Alert',
    text:'This is a simple alert.',
})
ALERTIFY
The alertify() function accepts an object as the argument. You can use the following keys in the object to set-up the custom alert box:
Name Type
titlestring
textstring
htmlhtml markup code
confirmButtonTextstring
cancelButtonboolean
denyButtonboolean
cancelButtonTextstring
denyButtonTextstring
confirmButtonColora color
cancelButtonColora color
denyButtonColora color
onConfirmedfunction
onCanceledfunction
onDeniedfunction
footerstring
inputboolean
inputSetAttributesObject (keys= attributes, values= values)
removeBackdropBlurboolean
alertWidthcss width value
animationInstring ("scale-up" / "scale-down" / "fade-up" / "fade-down" / "fade-left" / "fade-right")
animationOutstring ("scale-up" / "scale-down" / "fade-up" / "fade-down" / "fade-left" / "fade-right")
darkModeboolean
alertBoxColora color
alertBoxTextColora color
alertPersistOnConfirmedboolean
alertPersistOnCanceledboolean
alertPersistOnDeniedboolean
autoTimerCloseint (milliseconds)
onAutoTimerClosefunction
The onConfirmed, onCanceled, onDenied, and onAutoTimerClose functions accept an argument which contain the value of the input (if it is there).
alertify({
    title:'Sample Alert',
    html:'<b>Lorem ipsum dolor sit amet</b>, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
    cancelButton:true,
    denyButton:true,
    confirmButtonText:'Yes',
    denyButtonColor:'#bb86fc',
    onConfirmed:function(a){
        console.log(a)
    },
    footer:'This is so simple',
    input:true,
    inputSetAttributes:{
        type:'number',
    },
    animationIn:'fade-left',
    animationOut:'fade-left',
    darkMode:true,
    alertPersistOnCanceled:true,
})
TOASTIFY
Use the alertify() function to pop-up an alert and the toastify() function to use a toast.
NameType
toastBoxColora color
toastBoxTextColora color
toastBoxShadowcss shadow syntax
toastBoxTextAlignstring
toastWidthcss width
animationInstring ("scale-up" / "scale-down" / "fade-up" / "fade-down" / "fade-left" / "fade-right")
animationOutstring ("scale-up" / "scale-down" / "fade-up" / "fade-down" / "fade-left" / "fade-right")
textstring
htmlhtml markup code
positionstring ("top right" / "top left" / "bottom right" / "bottom left")
toastCloseTimerint (milliseconds)
toastify({
    text:'This is me!',
    toastBoxColor:'tomato',
    toastBoxTextColor:'white',
    toastBoxShadow:'none',
    toastBoxTextAlign:'center',
    toastWidth:'90vw',
    animationOut:'scale-up',
    position:'top left',
    toastCloseTimer:'1000',
})

Post a Comment

© Coding Hindi. All rights reserved. Premium By Raushan Design