Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anim-bar #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ notifications:
email: false

node_js:
- '6'
- '9'

branches:
except:
Expand All @@ -33,4 +33,4 @@ after_success:

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sh -e /etc/init.d/xvfb start
10 changes: 10 additions & 0 deletions src/toast.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ToastData } from './toasty.service';
selector: 'ng2-toast',
template: `
<div class="toast" [ngClass]="[toast.type, toast.theme]">
<div class="time-bar" [ngStyle]="timeBarAnim()">
<div *ngIf="toast.showClose" class="close-button" (click)="close($event)"></div>
<div *ngIf="toast.title || toast.msg" class="toast-text">
<span *ngIf="toast.title" class="toast-title" [innerHTML]="toast.title | safeHtml"></span>
Expand All @@ -26,6 +27,15 @@ export class ToastComponent {
@Input() toast: ToastData;
@Output('closeToast') closeToastEvent = new EventEmitter();

/**
* Returns Animation Style for time-bar
*
*/
timeBarAnim() {
let lef = this.toast.timeout + 'ms linear 0s 1 anim-time-bar';
return { 'animation': + lef, '-webkit-animation': lef, '-moz-animation': lef };
}

/**
* Event handler invokes when user clicks on close button.
* This method emit new event into ToastyContainer to close it.
Expand Down
5 changes: 5 additions & 0 deletions style-bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.