當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.keyframes函數代碼示例

本文整理匯總了TypeScript中@angular/core.keyframes函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript keyframes函數的具體用法?TypeScript keyframes怎麽用?TypeScript keyframes使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了keyframes函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('should get annotations for HeroDetailComponent', () => {
   const HeroDetailComponent =
       reflector.findDeclaration('src/app/hero-detail.component', 'HeroDetailComponent');
   const annotations = reflector.annotations(HeroDetailComponent);
   expect(annotations.length).toEqual(1);
   const annotation = annotations[0];
   expect(annotation.selector).toEqual('my-hero-detail');
   expect(annotation.animations).toEqual([trigger('myAnimation', [
     state('state1', style({'background': 'white'})),
     transition(
         '* => *',
         sequence([group([animate(
             '1s 0.5s',
             keyframes([style({'background': 'blue'}), style({'background': 'red'})]))])]))
   ])]);
 });
開發者ID:JSMike,項目名稱:angular,代碼行數:16,代碼來源:static_reflector_spec.ts

示例2: Collapse

export function Collapse(duration: number = 300) {
    return trigger('collapse', [
            state('collapsed, true, void', style({
                height: '0',
                opacity: '0',
                overflow: 'hidden'
            })),
            state('expanded, false', style({
                height: '*',
                opacity: '1',
                overflow: 'hidden'
            })),
            transition('true => false, collapsed => expanded', [
                animate(duration+'ms ease', keyframes([
                    style({opacity: '1'}),
                    style({height: '*'})
                ]))
            ]),
            transition('false => true, expanded => collapsed', [
                animate(duration+'ms ease', style({height: '0'}))
            ])
        ])
}
開發者ID:Bcpoole,項目名稱:fuel-ui,代碼行數:23,代碼來源:Collapse.ts

示例3: trigger

import { trigger, state, style, transition, animate,keyframes } from '@angular/core';

export const flyIn = trigger('flyIn', [
  state('in', style({transform: 'translateX(0)'})),
  transition('void => *', [
       animate(500, keyframes([
        style({opacity: 0, transform: 'translateX(100%)', offset: 0}),
        style({opacity: 1, transform: 'translateX(25px)',  offset: 0.3}),
        style({opacity: 1, transform: 'translateX(0)',     offset: 1.0})
      ]))
  ]),
  transition('* => void', [
        animate(500, keyframes([
        style({opacity: 1, transform: 'translateX(0)',     offset: 0}),
        style({opacity: 1, transform: 'translateX(-25px)', offset: 0.7}),
        style({opacity: 0, transform: 'translateX(-100%)',  offset: 1.0})
      ]))
  ])
]);
開發者ID:lovae123,項目名稱:one,代碼行數:19,代碼來源:fly-in.ts

示例4: trigger

import { trigger, state, style, transition, animate,keyframes } from '@angular/core';

export const fadeIn = trigger('fadeIn', [
  state('in', style({transform: 'translateX(0)'})),
  transition('void => *', [
    animate(800, keyframes([
      style({opacity: 0}),
      style({opacity: 0.2}),
      style({opacity: 0.4}),
      style({opacity: 0.6}),
      style({opacity: 0.8}),
      style({opacity: 1})
    ]))
  ]),
  transition('* => void', [
    animate(800, keyframes([
      style({opacity: 1}),
      style({opacity: 0.8}),
      style({opacity: 0.6}),
      style({opacity: 0.4}),
      style({opacity: 0.2}),
      style({opacity: 0})
    ]))
  ])
]);
開發者ID:lovae123,項目名稱:one,代碼行數:25,代碼來源:fade-in.ts

示例5: state

		state('true', style({opacity: 1})),
		state('false', style({opacity: 0})),
   		transition('0 <=> 1', animate('.5s'))
		]),
	trigger('postEnter', [
		state('void', style({transform: 'translateY(0%)'})),
		state('true', style({transform: 'translateY(-20%)'})),
		transition('void => true', animate('.5s'))
		]),
	trigger('fadeOut', [
		state('in', style({transform: 'translateY(0px)', opacity: 1})),
		state('out', style({transform: 'translateY(-100px)', opacity: 0})),
		transition('out => in', animate('.45s')),
		transition('in => out', [
			animate('275ms 175ms', keyframes([
					style({opacity: 1}),
					style({opacity: 0})
				]))
		])
		]),
	trigger('appearTopBottom', [
		state('in', style({transform: 'scaleY(1)', opacity: 1})),
		state('out', style({transform: 'scaleY(0)', opacity: 0})),
		transition('out => in', animate('.45s')),
		transition('in => out', animate('.45s')),
		]),
	trigger('simpleFade', [
		state('void', style({opacity: 0})),
		state('*', style({opacity: 1})),
		transition('void => *', animate('.5s')),
		transition('* => void', animate('.5s')),
開發者ID:bkirby989,項目名稱:WallaceTheme,代碼行數:31,代碼來源:post-list.animations.ts


注:本文中的@angular/core.keyframes函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。