feat:update demo

This commit is contained in:
pengfei.zhou 2019-12-14 11:30:56 +08:00
parent ecd40b9641
commit b238485894

View File

@ -29,7 +29,7 @@ class AnimatorDemo extends Panel {
hlayout([
thisLabel('Reset').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
view.width = view.height = 20
view.x = view.y = 0
@ -54,7 +54,7 @@ class AnimatorDemo extends Panel {
hlayout([
thisLabel('X').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
view.x = view.x || 0
view.x += 100
@ -66,7 +66,7 @@ class AnimatorDemo extends Panel {
}),
thisLabel('Y').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
view.y = view.y || 0
view.y += 100
@ -78,7 +78,7 @@ class AnimatorDemo extends Panel {
}),
thisLabel('Width').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
view.width += 100
},
@ -88,7 +88,7 @@ class AnimatorDemo extends Panel {
}),
thisLabel('Height').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
view.height += 100
},
@ -100,7 +100,7 @@ class AnimatorDemo extends Panel {
hlayout([
thisLabel('BgColor').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
view.backgroundColor = colors[(idx++) % colors.length]
},
@ -110,7 +110,7 @@ class AnimatorDemo extends Panel {
}),
thisLabel('Rotation').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
if (view.rotation) {
view.rotation += 0.5
@ -124,7 +124,7 @@ class AnimatorDemo extends Panel {
}),
thisLabel('Corner').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
if (typeof view.corners === 'number') {
view.corners += 10
@ -141,7 +141,7 @@ class AnimatorDemo extends Panel {
hlayout([
thisLabel('scaleX').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
if (view.scaleX) {
view.scaleX += 0.1
@ -155,7 +155,7 @@ class AnimatorDemo extends Panel {
}),
thisLabel('scaleY').apply({
onClick: () => {
animate(this)({
animate(context)({
animations: () => {
if (view.scaleY) {
view.scaleY += 0.1