aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/preloading/preloading-view.ts
blob: f299f2a30fb5b35f1602e37198bb326034b64b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';

interface IPreLoadingViewScope {
    startZoomIn:boolean;
}

export class PreLoadingViewModel {

    static '$inject' = ['$scope'];

    constructor(private $scope:IPreLoadingViewScope) {
        this.init($scope);
    }

    private init = ($scope:IPreLoadingViewScope):void => {
        this.animate($('.caption1'), 'fadeInUp', 400);
        this.animate($('.caption2'), 'fadeInUp', 800);
    };

    private animate = (element:any, animation:string, when:number):void => {
        window.setTimeout(()=> {
            element.addClass("animated " + animation);
            element[0].style = "visibility: visible;";
        }, when);
    };

}