aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorIndrajith K L2017-12-19 14:21:29 +0530
committerIndrajith K L2017-12-19 14:21:29 +0530
commitc0eb82f55a40f64025800c0ad2b6a05290576337 (patch)
treecce2a386dea2508de10d6a6bb58f492329173434 /example
parentab0d224a293dfb2e6f2f70fd1f8180f6957c15be (diff)
downloadvanilla-yo-notification-c0eb82f55a40f64025800c0ad2b6a05290576337.tar.gz
vanilla-yo-notification-c0eb82f55a40f64025800c0ad2b6a05290576337.tar.bz2
vanilla-yo-notification-c0eb82f55a40f64025800c0ad2b6a05290576337.zip
Now supports
* type arguments, * positional parameters and * html as content * Documentation updates
Diffstat (limited to 'example')
-rw-r--r--example/64x64.pngbin0 -> 206 bytes
-rw-r--r--example/example.html17
-rw-r--r--example/example.js38
3 files changed, 55 insertions, 0 deletions
diff --git a/example/64x64.png b/example/64x64.png
new file mode 100644
index 0000000..d889069
--- /dev/null
+++ b/example/64x64.png
Binary files differ
diff --git a/example/example.html b/example/example.html
new file mode 100644
index 0000000..889c1c8
--- /dev/null
+++ b/example/example.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>Vanilla Yo Notification</title>
+</head>
+<body>
+ <button onclick="showNotificationSuccess()">Show Success Notification</button>
+ <button onclick="showNotificationWarning()">Show Warning Notification</button>
+ <button onclick="showNotificationError()">Show Error Notification</button>
+
+ <script src="../dist/vanilla-yo-notification.js"></script>
+ <script src="./example.js"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/example/example.js b/example/example.js
new file mode 100644
index 0000000..4500c70
--- /dev/null
+++ b/example/example.js
@@ -0,0 +1,38 @@
+(function(window){
+ var notif = new VanillaYoNotification({
+ position: ['bottom', 'left']
+ });
+ var counter = 0;
+ window.showNotificationSuccess = function(){
+
+ notif.show({
+ title: 'Notification Title',
+ content: `This is a content ${counter}`,
+ timeout: 6000
+ });
+
+ counter += 1;
+ }
+ window.showNotificationWarning = function(){
+
+ notif.show({
+ title: 'Notification Title',
+ content: '<b>This is a content</b>',
+ type: 'warning',
+ timeout: 1000
+ });
+ }
+ window.showNotificationError = function(){
+
+ notif.show({
+ title: 'Notification Title',
+ content: 'This is a content with image <img src="64x64.png"/>',
+ type: 'error',
+ timeout: 2000
+ });
+ }
+
+
+
+
+})(window); \ No newline at end of file