summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/shared/utils
diff options
context:
space:
mode:
authorChuyi Guo <guochuyi@chinamobile.com>2019-08-23 07:35:40 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-23 07:35:40 +0000
commitc12c0b1ef71d72a2af275b0bf7d8390c2e226e19 (patch)
tree407aa0aca84a943301ce536e01807e7b6f743e18 /usecaseui-portal/src/app/shared/utils
parentb3a6a997080331333b046346cbb6f2050e4d86e1 (diff)
parent4e11ad92dbc929de190a6c211457bebc88636acd (diff)
Merge "refactor: change the position of animates.ts to utils"
Diffstat (limited to 'usecaseui-portal/src/app/shared/utils')
-rw-r--r--usecaseui-portal/src/app/shared/utils/animates.ts57
1 files changed, 57 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/shared/utils/animates.ts b/usecaseui-portal/src/app/shared/utils/animates.ts
new file mode 100644
index 00000000..d5c29b7e
--- /dev/null
+++ b/usecaseui-portal/src/app/shared/utils/animates.ts
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+import { trigger, state, style, animate, transition } from '@angular/animations';
+
+// Routing animation
+export const slideToRight = trigger('routerAnimate', [
+ // Define void to indicate empty state
+ state('void', style({ position:'fixed', zIndex:'-1' })), //I don't understand why I want to add a positioning animation to take effect.
+ // * Indicates any state
+ state('*', style({ })),
+ // Admission animation
+ transition(':enter', [
+ style({transform: 'translateX(-100%)'}),
+ animate('.5s ease-in-out')
+ ]),
+ // Opening animation
+ transition(':leave', [
+ animate('.5s ease-in-out', style({transform: 'translateX(100%)'}) )
+ ])
+]);
+// Detail page shows hidden animation
+export const showHideAnimate = trigger('showHideAnimate', [
+ state('show', style({
+ transform: 'scale(1)',
+ display:'block',
+ })),
+ state('hide', style({
+ transform: 'scale(0)',
+ display:'none'
+ })),
+ transition('show => hide', animate('300ms ease-in')),
+ transition('hide => show', animate('300ms ease-out'))
+]);
+// Detail page shows hidden animation
+export const slideUpDown = trigger('slideUpDown', [
+ state('down', style({
+ height: "*"
+ })),
+ state('up', style({
+ height: "0"
+ })),
+ transition('down => up', animate('300ms ease-in')),
+ transition('up => down', animate('300ms ease-out'))
+]); \ No newline at end of file