当前位置: 首页>>代码示例>>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;未经允许,请勿转载。