Growl personalizado como biblioteca de notificaciones-simpleNotify

Tiempo de ejecución: 30 minutos. Empezar

Autor: drewdulz
Views Total: 1,373
Sitio oficial: Ir a la web
Actualizado: June 22, 2017
Licencia: MIT

Vista prévia

Growl personalizado como biblioteca de notificaciones-simpleNotify

Descripción

simpleNotify es una biblioteca JavaScript sencilla, ligera y libre de dependencia para crear mensajes de notificación de estilo Growl con facilidad. Actualmente viene en 4 tipos diferentes de notificaciones: bueno, ADVERTENCIA, peligro y atención.

Funcionamiento

Descargue e incluya los archivos de simpleNotify en la página HTML.

<link href="inc/simpleNotifyStyle.css" rel="stylesheet">
<script src="inc/simpleNotify.js"></script>

Crear una notificación de gruñido básico que se desestimará automáticamente después de 7 segundos.

simpleNotify.notify('Hey! This is a Good Notification.', 'good')
// or
 simpleNotify.notify('Hey! This is a Good Notification.')

Cambie el tipo de notificación predeterminado.

// warning
simpleNotify.notify('Hey! This is a Warning Notification.', 'warning')

// danger
simpleNotify.notify('Hey! This is a Danger Notification.', 'danger')

// attention
simpleNotify.notify('Hey! This is an Attention Notification.', 'attention')

Reemplace las variables predeterminadas en JavaScript.

NOTIFICATION_CLASS_NAME : "simple-notification",
CONTAINER_CLASS_NAME : "simple-notification-container",
CONTAINER_ID_NAME : "notificationContainer",
MARGIN_BETWEEEN_NOTIFICATIONS : 5, //px
NOTIFICATION_WIDTH: 300, //px
NOTIFICATION_TIME : 7000, //ms
notificationCount : 0,

Te puede interesar: