MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / resetTimeline

Method resetTimeline

examples/piu/cards/main.js:106–117  ·  view source on GitHub ↗
(layout)

Source from the content-addressed store, hash-verified

104 this.timeline.seekTo(time);
105 }
106 resetTimeline(layout) {
107 let anchors = this.anchors;
108 this.timeline = (new Timeline)
109 .on(anchors.background.behavior, { x: [layout.width, 0] }, 500, Math.quadEaseOut, 500)
110 .on(anchors.logo, { x: [(layout.width - 60) / 2, 20], y: [(layout.height - 60) / 2, 15], state: [0, 1] }, 500, Math.quadEaseOut, -500)
111 .on(anchors.company, { x: [layout.width, 40] }, 500, Math.quadEaseOut, -500)
112 .on(anchors.name, { x: [layout.width, 0] }, 250, Math.quadEaseOut, -125)
113 .on(anchors.title, { x: [layout.width, 0] }, 250, Math.quadEaseOut, -125)
114 .on(anchors.address, { x: [layout.width, 0] }, 250, Math.quadEaseOut)
115
116 layout.duration = this.timeline.duration + 500;
117 }
118 onFitHorizontally(layout, width) {
119 this.anchors.name.width = this.anchors.title.width = this.anchors.address.width = this.anchors.background.width = width;
120 this.resetTimeline(layout);

Callers 3

onDisplayingMethod · 0.80
onFitHorizontallyMethod · 0.80
onFitVerticallyMethod · 0.80

Calls 1

onMethod · 0.45

Tested by

no test coverage detected