targetj 1.0.232 → 1.0.233
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -37
- package/build/Viewport.js +6 -0
- package/dist/targetjs.js +1 -1
- package/dist/targetjs.js.gz +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -378,14 +378,14 @@ App({
|
|
|
378
378
|
html() { return user.email; }
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
|
-
},
|
|
382
|
-
pause$$: { interval: 150 },
|
|
383
|
-
highlightOne$$() {
|
|
384
|
-
const user = this.getChild(0);
|
|
385
|
-
user.setTarget('backgroundColor', { value: ['#fff7cc', '#fff1a8'], steps: 14 });
|
|
386
|
-
user.setTarget('scale', { value: [1, 1.04, 1], steps: 14 });
|
|
387
|
-
user.setTarget('boxShadow', '0 10px 24px rgba(0,0,0,.14)');
|
|
388
381
|
}
|
|
382
|
+
},
|
|
383
|
+
pause$$: { interval: 150 },
|
|
384
|
+
highlightOne$$() {
|
|
385
|
+
const user = this.getChild(0);
|
|
386
|
+
user.setTarget('backgroundColor', { value: ['#fff7cc', '#fff1a8'], steps: 14 });
|
|
387
|
+
user.setTarget('scale', { value: [1, 1.04, 1], steps: 14 });
|
|
388
|
+
user.setTarget('boxShadow', '0 10px 24px rgba(0,0,0,.14)');
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
}).mount('#app');
|
|
@@ -425,42 +425,47 @@ App({
|
|
|
425
425
|
height() { return getScreenHeight(); },
|
|
426
426
|
x() { return (getScreenWidth() - this.getWidth()) / 2; },
|
|
427
427
|
containerOverflowMode: "always",
|
|
428
|
-
addChildren
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
428
|
+
addChildren: {
|
|
429
|
+
waitForChildren: 'visible',
|
|
430
|
+
value() {
|
|
431
|
+
return Array.from({ length: 10 }, (_, i) => ({
|
|
432
|
+
height: 56,
|
|
433
|
+
width() { return this.parent.getWidth(); },
|
|
434
|
+
bottomMargin: 8,
|
|
435
|
+
borderRadius: 12,
|
|
436
|
+
backgroundColor: "white",
|
|
437
|
+
boxShadow: "0 8px 20px rgba(0,0,0,0.08)",
|
|
438
|
+
photo: {
|
|
439
|
+
x: 10, y: 10, width: 34, height: 34,
|
|
440
|
+
borderRadius: "50%",
|
|
441
|
+
backgroundColor: "#ddd"
|
|
442
|
+
},
|
|
443
|
+
userName: {
|
|
444
|
+
x: 60, y: 10, width: 180, height: 30,
|
|
445
|
+
overflow: "hidden",
|
|
446
|
+
borderRadius: 5,
|
|
447
|
+
backgroundColor: "#ddd"
|
|
448
|
+
},
|
|
449
|
+
pause$$: { interval: 100 },
|
|
450
|
+
fetch$$: "https://targetjs.io/api/randomUser",
|
|
451
|
+
reveal$$() {
|
|
452
|
+
const userName = this.getChild("userName");
|
|
453
|
+
userName.setTarget("html", this.val("fetch$$").name);
|
|
454
|
+
userName.setTarget("backgroundColor", { value: "white", steps: 20 });
|
|
455
|
+
this.getChild("photo").setTarget("backgroundColor", { value: "#" + Math.random().toString(16).slice(-6), steps: 20 });
|
|
456
|
+
},
|
|
457
|
+
}));
|
|
458
|
+
}
|
|
456
459
|
},
|
|
457
460
|
wave$$: {
|
|
458
461
|
interval: 30,
|
|
459
462
|
cycles() { return this.visibleChildren.length; },
|
|
460
463
|
value(i) {
|
|
461
464
|
const child = this.visibleChildren[i];
|
|
462
|
-
child
|
|
463
|
-
|
|
465
|
+
if (child) {
|
|
466
|
+
child.setTarget("scale", { value: [1, 1.06, 1], steps: 18 });
|
|
467
|
+
child.setTarget("opacity", { value: [1, 0.92, 1], steps: 18 });
|
|
468
|
+
}
|
|
464
469
|
}
|
|
465
470
|
},
|
|
466
471
|
onScroll() {
|
package/build/Viewport.js
CHANGED
|
@@ -154,6 +154,12 @@ var Viewport = exports.Viewport = /*#__PURE__*/function () {
|
|
|
154
154
|
this.ySouth = Math.max(ySouth, this.ySouth);
|
|
155
155
|
child.getRealParent().viewport.xEast = Math.max(child.getRealParent().viewport.xEast, this.xEast);
|
|
156
156
|
child.getRealParent().viewport.ySouth = Math.max(child.getRealParent().viewport.ySouth, this.ySouth);
|
|
157
|
+
if (this.container.getContainerOverflowMode() === 'always' || this.currentChild.getItemOverflowMode() === 'always') {
|
|
158
|
+
this.yEast = child.getRealParent().viewport.ySouth;
|
|
159
|
+
this.yNext = child.getRealParent().viewport.ySouth;
|
|
160
|
+
this.xNext = child.getRealParent().viewport.xWest;
|
|
161
|
+
this.xSouth = child.getRealParent().viewport.xWest;
|
|
162
|
+
}
|
|
157
163
|
}
|
|
158
164
|
}]);
|
|
159
165
|
}();
|