Skip to content

Commit aee078e

Browse files
author
Di Wang
committed
notification page
1 parent ca9c423 commit aee078e

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

src/app/dashboard/notification/notification.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h4>Notification States</h4>
6363
<div class="card place">
6464
<h4 class="text-center">Notifications Places</h4>
6565
<p class="text-center">Click to view notifications</p>
66-
<div class="row page-title">
66+
<div class="row" style="margin-top: 15px">
6767
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
6868
<div class="col-md-4">
6969
<button md-raised-button class="btn btn-primary btn-block" (click)="btnClick('top-left')">TOP LEFT</button>
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import {Component, OnInit} from '@angular/core';
22
declare const $: any;
33

44
@Component({
@@ -8,36 +8,52 @@ declare const $: any;
88
})
99
export class NotificationComponent implements OnInit {
1010

11-
constructor() { }
11+
constructor() {
12+
}
1213

1314
ngOnInit() {
1415
}
1516

1617
btnClick(position) {
1718
let from = 'top';
1819
let align = 'right';
20+
let type = 'info';
1921
switch (position) {
2022
case 'top-left':
2123
align = 'left';
24+
type = 'rose';
2225
break;
2326
case 'top-center':
2427
align = 'center';
28+
type = 'success';
2529
break;
2630
case 'bottom-left':
2731
align = 'left';
2832
from = 'bottom';
33+
type = 'primary';
2934
break;
3035
case 'bottom-center':
3136
align = 'center';
3237
from = 'bottom';
38+
type = 'warning';
3339
break;
3440
case 'bottom-right':
3541
from = 'bottom';
42+
type = 'danger';
3643
break;
3744
}
3845
$.notify({
39-
message: 'Welcome to <b>MATERIAL DASHBOARD</b> - a beautiful dashboard for every web developer.'
40-
}, {placement: {from, align}});
46+
message: 'Welcome to <b>MATERIAL DASHBOARD</b> - a beautiful dashboard for every web developer.',
47+
}, {
48+
placement: {from, align},
49+
offset: {x: 20, y: 35},
50+
type,
51+
template: `<div class="alert alert-{0} alert-with-icon col-md-4">
52+
<i class="material-icons alert-icon">notifications</i>
53+
<button class="close" type="button" data-dismiss="alert" aria-label="Close"><i class="material-icons">close</i></button>
54+
<span>{2}</span>
55+
</div>`
56+
});
4157
}
4258

4359
}

src/app/dashboard/sweetalert/sweetalert.component.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<div class="container">
22
<app-navbar title="Sweet Alert"></app-navbar>
3+
<div class="row page-title">
4+
<h3 class="text-center">Sweet Alert 2</h3>
5+
</div>
36
<div class="row">
7+
<p class="text-center subtitle">A beautiful plugin, that replace the classic alert, Handcrafted by our friend <a href="https://twitter.com/t4t5" target="_blank">Tristan Edwards</a>. Please checkout the <a href="http://limonte.github.io/sweetalert2/" target="_blank">full documentation</a>.</p>
8+
</div>
9+
<div class="row page-title">
410
<div class="col-md-3 col-sm-6 col-xs-12">
511
<div class="card">
612
<h5>Basic example</h5>

src/styles.css

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ a:hover{
6464
text-decoration: none;
6565
}
6666

67+
b{
68+
font-weight: 300;
69+
}
70+
6771
.subtitle{
6872
margin-top: 15px;
6973
color: #3C4858;
@@ -394,27 +398,27 @@ a:hover{
394398
}
395399

396400
/* text color */
397-
.text-primary{
401+
.text-primary, .alert-primary .alert-icon{
398402
color: #9c27b0;
399403
}
400404

401-
.text-danger{
405+
.text-danger, .alert-danger .alert-icon{
402406
color: #f44336;
403407
}
404408

405-
.text-info{
409+
.text-info, .alert-info .alert-icon{
406410
color: #00bcd4;
407411
}
408412

409-
.text-warning{
413+
.text-warning, .alert-warning .alert-icon{
410414
color: #ff9800;
411415
}
412416

413-
.text-rose{
417+
.text-rose, .alert-rose .alert-icon{
414418
color: #e91e63;
415419
}
416420

417-
.text-success{
421+
.text-success, .alert-success .alert-icon{
418422
color: #4caf50;
419423
}
420424

@@ -494,11 +498,3 @@ a:hover{
494498
padding: 9px;
495499
box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.42), 0 4px 25px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);
496500
}
497-
498-
.alert-info .alert-icon{
499-
color: #00bcd4;
500-
}
501-
502-
.alert-rose .alert-icon{
503-
color: #eb3573;
504-
}

0 commit comments

Comments
 (0)