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


TypeScript animations.style函數代碼示例

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


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

示例1: trigger

import {
  animate,
  query,
  state,
  style,
  transition,
  trigger
} from '@angular/animations';

// https://stackblitz.com/edit/zen-feedback?embed=1&file=app/app.component.ts&view=preview

export const feedbackAnimation = trigger('feedbackAnimation', [
  transition(':enter', [
    query('.zen-menu', [
      style({ opacity: 0, transform: 'translateY(30px)' }),
      animate('.3s 1s ease-in-out', style({ transform: 'translateY(0)', opacity: 1 }))
    ])
  ])
]);

export const appearBottomTopAnimation = trigger('appearBottomTop', [
  state('inactive', style({ opacity: 0, visibility: 'hidden', transform: 'translateY(30px)' })),
  state('active', style({ opacity: 1, transform: 'translateY(0)' })),
  transition('inactive <=> active', animate('.3s .5s ease-in-out'))
]);

export const appearRightLeftAnimation = trigger('appearRightLeft', [
  state('inactive', style({ opacity: 0, visibility: 'hidden', transform: 'translateX(30px)' })),
  state('active', style({ opacity: 1, transform: 'translateX(0)' })),
  transition('inactive <=> active', animate('.3s .5s ease-in-out'))
]);
開發者ID:Meistercoach83,項目名稱:sfw,代碼行數:31,代碼來源:animations.ts

示例2: trigger

  animate,
  AnimationTriggerMetadata,
  keyframes,
  state,
  style,
  transition,
  trigger,
} from '@angular/animations';

/**
 * This animation fades in the background color and text content of the
 * select's options. It is time delayed to occur 100ms after the overlay
 * panel has transformed in.
 */
export const fadeInContent: AnimationTriggerMetadata = trigger('fadeInContent', [
  state('showing', style({ opacity: 1 })),
  transition('void => showing', [
    style({ opacity: 0 }),
    animate(`150ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)`)
  ])
]);

export const slideCalendar: AnimationTriggerMetadata = trigger('slideCalendar', [
  transition('* => left', [
    animate(180, keyframes([
      style({ transform: 'translateX(100%)', offset: 0.5 }),
      style({ transform: 'translateX(-100%)', offset: 0.51 }),
      style({ transform: 'translateX(0)', offset: 1 })
    ]))
  ]),
  transition('* => right', [
開發者ID:Promact,項目名稱:md2,代碼行數:31,代碼來源:datepicker-animations.ts

示例3: trigger

import {
  animate,
  AnimationTriggerMetadata,
  state,
  style,
  transition,
  trigger,
} from '@angular/animations';

export const TagAnimation: AnimationTriggerMetadata = trigger('tagAnimation', [
  state('*', style({ opacity: 1, transform: 'scale(1)' })),
  transition('void => *', [
    style({ opacity: 0, transform: 'scale(0)' }),
    animate('150ms linear')
  ]),
  state('void', style({ opacity: 0, transform: 'scale(0)' })),
  transition('* => void', [
    style({ opacity: 1, transform: 'scale(1)' }),
    animate('150ms linear')
  ])
])
開發者ID:afc163,項目名稱:ng-zorro-antd,代碼行數:21,代碼來源:tag-animations.ts

示例4: style

import { animate, animation, AnimationMetadata, AnimationReferenceMetadata, style } from '@angular/animations';
import { EaseOut } from '../easings';
import { IAnimationParams } from '../main';

const base: AnimationMetadata[] = [
    style({
        opacity: `{{startOpacity}}`
    }),
    animate(
        `{{duration}} {{delay}} {{easing}}`,
        style({
            opacity: `{{endOpacity}}`
        })
    )
];

const baseParams: IAnimationParams = {
    delay: '0s',
    duration: '350ms',
    easing: EaseOut.sine,
    endOpacity: 1,
    startOpacity: 0
};

const fadeIn: AnimationReferenceMetadata = animation(base, {
    params: baseParams
});

const fadeOut: AnimationReferenceMetadata = animation(base, {
    params: {
        delay: '0s',
開發者ID:IgniteUI,項目名稱:igniteui-angular,代碼行數:31,代碼來源:index.ts

示例5: trigger

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

export const Animations = {
    slideToggle: [
      trigger('isExpanded', [
        state('*', style({
          'height': '0',
          'overflow': 'hidden'
        })),
        state('true', style({
          'height': '*',
          'overflow': 'visible'
        })),
        transition('* => *', animate('.25s ease'))
      ])
    ]
};
開發者ID:berta-cms,項目名稱:berta,代碼行數:17,代碼來源:animations.ts

示例6: trigger

import { trigger, stagger, transition, style, animate, query } from '@angular/animations';

export const listAnimation = trigger('listAnim', [
  transition('* => *', [
    query(':enter', style({opacity: 0}), { optional: true }),
    query(':enter', stagger(100, [
      animate('1s', style({opacity: 1}))
    ]), { optional: true }),
    query(':leave', style({opacity: 1}), { optional: true }),
    query(':leave', stagger(100, [
      animate('1s', style({opacity: 0}))
    ]), { optional: true })
  ])
]);
開發者ID:zichenma,項目名稱:prodinator,代碼行數:14,代碼來源:list.anim.ts

示例7: trigger

/**
 * const tdRotateAnimation
 *
 * Parameter Options:
 * * degressStart: Degrees of rotation that the dom object will end up in during the "false" state
 * * degreesEnd: Degrees of rotation that the dom object will end up in during the "true" state
 * * duration: Duration the animation will run in milliseconds. Defaults to 150 ms.
 * * delay: Delay before the animation will run in milliseconds. Defaults to 0 ms.
 * * ease: Animation accelerates and decelerates. Defaults to ease-in.
 *
 * Returns an [AnimationTriggerMetadata] object with boolean states for a rotation animation.
 *
 * usage: [@tdRotate]="{ value: true | false, params: { degreesEnd: 90 }}"
 */

export const tdRotateAnimation: AnimationTriggerMetadata = trigger('tdRotate', [
  state('0', style({
    transform: 'rotate({{ degressStart }}deg)',
  }), { params: { degressStart: 0 }}),
  state('1',  style({
    transform: 'rotate({{ degreesEnd }}deg)',
  }), { params: { degreesEnd: 180 }}),
  transition('0 <=> 1', [
    group([
      query('@*', animateChild(), { optional: true }),
      animate('{{ duration }}ms {{ delay }}ms {{ ease }}'),
    ]),
  ], { params: { duration: 250, delay: '0', ease: 'ease-in' }}),
]);
開發者ID:Teradata,項目名稱:covalent,代碼行數:29,代碼來源:rotate.animation.ts

示例8: trigger

ďťż// import the required animation functions from the angular animations module
import {AnimationTriggerMetadata, trigger, animate, transition, style } from '@angular/animations';

export const FadeInAnimation: AnimationTriggerMetadata =
    // trigger name for attaching this animation to an element using the [@triggerName] syntax
    trigger('FadeInAnimation', [

        // route 'enter' transition
        transition(':enter', [

            // css styles at start of transition
            style({ opacity: 0 }),

            // animation and styles at end of transition
            animate('.3s', style({ opacity: 1 }))
        ]),
    ]);
開發者ID:lengwei2018,項目名稱:harbor,代碼行數:17,代碼來源:fade-in.animation.ts


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