Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/sass/alertify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,28 @@ $border-radius: 1px;
}
}

&.center {
left: 0;
width: 100%;
> {
.default, .success, .error {
left: 50%;
transform: translateX(-50%);
text-align: center;
}
}
}

&.middle {
height: 100%;
> {
.default, .success, .error {
top: 50%;
transform: translateY(-50%);
}
}
}

> * {
box-sizing: border-box;
transition: all .4s cubic-bezier(.25, .8, .25, 1);
Expand Down
26 changes: 21 additions & 5 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,23 +352,39 @@ <h5 class="mdl-typeography--headline">Setting the Position</h5>
<h5 class="mdl-typeography--headline">Code Example</h5>
<pre>
alertify.delay(1000); // This is just to make the demo go faster.
alertify.log("Default botoom left position");
alertify.log("Default bottom left position");
setTimeout(function() {
alertify.logPosition("middle left");
alertify.log("middle left");
}, 1500);
setTimeout(function() {
alertify.logPosition("top left");
alertify.log("top left");
}, 1500);
}, 3000);
setTimeout(function() {
alertify.logPosition("top center");
alertify.log("top center");
}, 4500);
setTimeout(function() {
alertify.logPosition("top right");
alertify.log("top right");
}, 3000);
}, 6000);
setTimeout(function() {
alertify.logPosition("middle right");
alertify.log("middle right");
}, 7500);
setTimeout(function() {
alertify.logPosition("bottom right");
alertify.log("bottom right");
}, 4500);
}, 9000);
setTimeout(function() {
alertify.logPosition("bottom center");
alertify.log("bottom center");
}, 10500);
setTimeout(function() {
alertify.reset(); // Puts the message back to default position.
alertify.log("Back to default");
}, 6000);
}, 12000);
</pre>
</div>
</div>
Expand Down
24 changes: 20 additions & 4 deletions website/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,38 @@
demo("#log-position", function() {
alertify.delay(1000); // This is just to make the demo go faster.
alertify.log("Default bottom left position");
setTimeout(function() {
alertify.logPosition("middle left");
alertify.log("middle left");
}, 1500);
setTimeout(function() {
alertify.logPosition("top left");
alertify.log("top left");
}, 1500);
}, 3000);
setTimeout(function() {
alertify.logPosition("top center");
alertify.log("top center");
}, 4500);
setTimeout(function() {
alertify.logPosition("top right");
alertify.log("top right");
}, 3000);
}, 6000);
setTimeout(function() {
alertify.logPosition("middle right");
alertify.log("middle right");
}, 7500);
setTimeout(function() {
alertify.logPosition("bottom right");
alertify.log("bottom right");
}, 4500);
}, 9000);
setTimeout(function() {
alertify.logPosition("bottom center");
alertify.log("bottom center");
}, 10500);
setTimeout(function() {
alertify.reset(); // Puts the message back to default position.
alertify.log("Back to default");
}, 6000);
}, 12000);
});

})();
Expand Down