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