diff --git a/src/notify.js b/src/notify.js index abec189..c0f55b5 100644 --- a/src/notify.js +++ b/src/notify.js @@ -108,10 +108,28 @@ function createShowQueue(initialRecallDelay = 500, recallDelayIncrement = 500) { }; } +/** Helper functions */ +function success(text, timeout, color) { + return show(text, "success", timeout, color); +} +function warn(text, timeout, color) { + return show(text, "warning", timeout, color); +} +function error(text, timeout, color) { + return show(text, "error", timeout, color); +} +function info(text, timeout, color) { + return show(text, "info", timeout, color); +} + /* Export notification functions */ export let notify = { show, hide, + success, + warn, + error, + info, createShowQueue }; diff --git a/src/stylesheet.js b/src/stylesheet.js index 380a0c4..4c51d49 100644 --- a/src/stylesheet.js +++ b/src/stylesheet.js @@ -9,12 +9,9 @@ class Stylesheet { return { container: { position: 'fixed', - width: '50%', - margin: '0 auto', - right: '0px', - top: defaults.top, - left: '0px', - textAlign: 'center', + right: defaults.right || '0px', + top: defaults.top || '0px', + left: defaults.left || '0px', zIndex: defaults.zIndex, pointerEvents: 'none', transition: 'all ' + defaults.animationDuration + 'ms ease',