From d79ac300f398978f1f18af2b298a544c6d9a8048 Mon Sep 17 00:00:00 2001 From: Manol Donev Date: Tue, 19 Jun 2018 18:58:11 +0300 Subject: [PATCH] refactor: migrate animation-demo repo content (#5970) --- e2e/animation/app/animation-curves/page.ts | 63 + e2e/animation/app/animation-curves/page.xml | 20 + e2e/animation/app/background-color/page.ts | 21 + e2e/animation/app/background-color/page.xml | 13 + .../app/chaining-with-promises/page.ts | 34 + .../app/chaining-with-promises/page.xml | 13 + .../css-animations/animate-css/animate.css | 3340 +++++++++++++++++ .../app/css-animations/animate-css/page.css | 6 + .../app/css-animations/animate-css/page.ts | 14 + .../app/css-animations/animate-css/page.xml | 12 + .../css-animations/background-color/page.css | 14 + .../css-animations/background-color/page.ts | 18 + .../css-animations/background-color/page.xml | 6 + .../app/css-animations/bounce/page.css | 23 + .../app/css-animations/bounce/page.ts | 14 + .../app/css-animations/bounce/page.xml | 12 + .../app/css-animations/from-code/page.css | 18 + .../app/css-animations/from-code/page.ts | 20 + .../app/css-animations/from-code/page.xml | 12 + .../css-animations/initial-animation/page.css | 26 + .../css-animations/initial-animation/page.xml | 10 + .../app/css-animations/opacity/page.css | 14 + .../app/css-animations/opacity/page.ts | 17 + .../app/css-animations/opacity/page.xml | 13 + e2e/animation/app/css-animations/page.ts | 15 + e2e/animation/app/css-animations/page.xml | 18 + .../app/css-animations/settings/page.css | 12 + .../app/css-animations/settings/page.ts | 94 + .../app/css-animations/settings/page.xml | 48 + .../app/css-animations/transform/page.css | 17 + .../app/css-animations/transform/page.ts | 14 + .../app/css-animations/transform/page.xml | 11 + .../app/css-animations/visual-states/page.css | 14 + .../app/css-animations/visual-states/page.xml | 7 + e2e/animation/app/home/home-page.ts | 2 +- e2e/animation/app/home/home-page.xml | 10 +- e2e/animation/app/infinite/page.ts | 28 + e2e/animation/app/infinite/page.xml | 13 + e2e/animation/app/multiple-properties/page.ts | 28 + .../app/multiple-properties/page.xml | 13 + e2e/animation/app/multiple-views/page.ts | 62 + e2e/animation/app/multiple-views/page.xml | 16 + e2e/animation/app/opacity/page.ts | 20 + e2e/animation/app/opacity/page.xml | 13 + e2e/animation/app/res/icon_100x100.png | Bin 0 -> 2764 bytes e2e/animation/app/reusing/page.ts | 31 + e2e/animation/app/reusing/page.xml | 13 + e2e/animation/app/rotate/page.css | 3 + e2e/animation/app/rotate/page.ts | 20 + e2e/animation/app/rotate/page.xml | 13 + e2e/animation/app/scale/page.ts | 21 + e2e/animation/app/scale/page.xml | 13 + e2e/animation/app/slide-in-effect/page.ts | 32 + e2e/animation/app/slide-in-effect/page.xml | 11 + e2e/animation/app/translate/page.ts | 21 + e2e/animation/app/translate/page.xml | 13 + 56 files changed, 4393 insertions(+), 6 deletions(-) create mode 100644 e2e/animation/app/animation-curves/page.ts create mode 100644 e2e/animation/app/animation-curves/page.xml create mode 100644 e2e/animation/app/background-color/page.ts create mode 100644 e2e/animation/app/background-color/page.xml create mode 100644 e2e/animation/app/chaining-with-promises/page.ts create mode 100644 e2e/animation/app/chaining-with-promises/page.xml create mode 100644 e2e/animation/app/css-animations/animate-css/animate.css create mode 100644 e2e/animation/app/css-animations/animate-css/page.css create mode 100644 e2e/animation/app/css-animations/animate-css/page.ts create mode 100644 e2e/animation/app/css-animations/animate-css/page.xml create mode 100644 e2e/animation/app/css-animations/background-color/page.css create mode 100644 e2e/animation/app/css-animations/background-color/page.ts create mode 100644 e2e/animation/app/css-animations/background-color/page.xml create mode 100644 e2e/animation/app/css-animations/bounce/page.css create mode 100644 e2e/animation/app/css-animations/bounce/page.ts create mode 100644 e2e/animation/app/css-animations/bounce/page.xml create mode 100644 e2e/animation/app/css-animations/from-code/page.css create mode 100644 e2e/animation/app/css-animations/from-code/page.ts create mode 100644 e2e/animation/app/css-animations/from-code/page.xml create mode 100644 e2e/animation/app/css-animations/initial-animation/page.css create mode 100644 e2e/animation/app/css-animations/initial-animation/page.xml create mode 100644 e2e/animation/app/css-animations/opacity/page.css create mode 100644 e2e/animation/app/css-animations/opacity/page.ts create mode 100644 e2e/animation/app/css-animations/opacity/page.xml create mode 100644 e2e/animation/app/css-animations/page.ts create mode 100644 e2e/animation/app/css-animations/page.xml create mode 100644 e2e/animation/app/css-animations/settings/page.css create mode 100644 e2e/animation/app/css-animations/settings/page.ts create mode 100644 e2e/animation/app/css-animations/settings/page.xml create mode 100644 e2e/animation/app/css-animations/transform/page.css create mode 100644 e2e/animation/app/css-animations/transform/page.ts create mode 100644 e2e/animation/app/css-animations/transform/page.xml create mode 100644 e2e/animation/app/css-animations/visual-states/page.css create mode 100644 e2e/animation/app/css-animations/visual-states/page.xml create mode 100644 e2e/animation/app/infinite/page.ts create mode 100644 e2e/animation/app/infinite/page.xml create mode 100644 e2e/animation/app/multiple-properties/page.ts create mode 100644 e2e/animation/app/multiple-properties/page.xml create mode 100644 e2e/animation/app/multiple-views/page.ts create mode 100644 e2e/animation/app/multiple-views/page.xml create mode 100644 e2e/animation/app/opacity/page.ts create mode 100644 e2e/animation/app/opacity/page.xml create mode 100644 e2e/animation/app/res/icon_100x100.png create mode 100644 e2e/animation/app/reusing/page.ts create mode 100644 e2e/animation/app/reusing/page.xml create mode 100644 e2e/animation/app/rotate/page.css create mode 100644 e2e/animation/app/rotate/page.ts create mode 100644 e2e/animation/app/rotate/page.xml create mode 100644 e2e/animation/app/scale/page.ts create mode 100644 e2e/animation/app/scale/page.xml create mode 100644 e2e/animation/app/slide-in-effect/page.ts create mode 100644 e2e/animation/app/slide-in-effect/page.xml create mode 100644 e2e/animation/app/translate/page.ts create mode 100644 e2e/animation/app/translate/page.xml diff --git a/e2e/animation/app/animation-curves/page.ts b/e2e/animation/app/animation-curves/page.ts new file mode 100644 index 000000000..eb2d437b2 --- /dev/null +++ b/e2e/animation/app/animation-curves/page.ts @@ -0,0 +1,63 @@ +import { EventData, Page } from "tns-core-modules/ui/page"; +import { View } from "tns-core-modules/ui/core/view"; +import { AnimationCurve } from "tns-core-modules/ui/enums"; + +let view: View; + +export function pageLoaded(args: EventData) { + const page = args.object; + view = page.getViewById("view"); +} + +export function onAnimateLinear(args: EventData) { + view.animate({ + translate: { x: 0, y: 100}, + duration: 1000, + curve: AnimationCurve.linear + }); +} + +export function onAnimateEaseIn(args: EventData) { + view.animate({ + translate: { x: 0, y: 100}, + duration: 1000, + curve: AnimationCurve.easeIn + }); +} + +export function onAnimateEaseOut(args: EventData) { + view.animate({ + translate: { x: 0, y: 100}, + duration: 1000, + curve: AnimationCurve.easeOut + }); +} + +export function onAnimateEaseInEaseOut(args: EventData) { + view.animate({ + translate: { x: 0, y: 100}, + duration: 1000, + curve: AnimationCurve.easeInOut + }); +} + +export function onAnimateSpring(args: EventData) { + view.animate({ + translate: { x: 0, y: 100}, + duration: 1000, + curve: AnimationCurve.spring + }); +} + +export function onAnimateCustom(args: EventData) { + view.animate({ + translate: { x: 0, y: 100}, + duration: 1000, + curve: AnimationCurve.cubicBezier(0.1, 0.1, 0.1, 1) + }); +} + +export function onReset(args: EventData) { + view.translateX = 0; + view.translateY = 0; +} diff --git a/e2e/animation/app/animation-curves/page.xml b/e2e/animation/app/animation-curves/page.xml new file mode 100644 index 000000000..d1e213e6e --- /dev/null +++ b/e2e/animation/app/animation-curves/page.xml @@ -0,0 +1,20 @@ + + + + + + +