face-age 2.4.5 → 2.4.7
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 +70 -0
- package/dist/faceage.css +3365 -645
- package/dist/faceage.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -381,10 +381,21 @@ faceAge.API.setHistoryData({
|
|
|
381
381
|
meta: {
|
|
382
382
|
ts: Date.now(),
|
|
383
383
|
image: 'https://example.com/scan.jpg',
|
|
384
|
+
// Optional; values can use either 0..1 or 0..100.
|
|
385
|
+
quality: {
|
|
386
|
+
lightingScore: 0.92, // higher is better
|
|
387
|
+
brightness: 0.53, // used to detect lighting mismatch
|
|
388
|
+
sharpnessScore: 0.88,
|
|
389
|
+
blur: 0.08, // lower is better
|
|
390
|
+
noise: 0.10, // lower is better
|
|
391
|
+
confidence: 0.94,
|
|
392
|
+
},
|
|
384
393
|
},
|
|
385
394
|
});
|
|
386
395
|
```
|
|
387
396
|
|
|
397
|
+
When multiple history items are available, opening an analysis exposes a **Compare** tab for comparing it with any older scan. Shared metrics are normalized before comparison. Changes inside a 3-point noise band are treated as stable; optional `meta.quality` values widen that band or mark very low-confidence comparisons as insufficient data.
|
|
398
|
+
|
|
388
399
|
**Remove a history entry** by reference token. Pass `null` to clear all local history:
|
|
389
400
|
|
|
390
401
|
```js
|
|
@@ -393,6 +404,65 @@ faceAge.API.removeHistoryItem('analyze_ref_abc123').then((removed) => {
|
|
|
393
404
|
});
|
|
394
405
|
```
|
|
395
406
|
|
|
407
|
+
### Set Comments (Routine Tab)
|
|
408
|
+
|
|
409
|
+
Populate the customer review/comment carousel shown in the routine tab.
|
|
410
|
+
|
|
411
|
+
```js
|
|
412
|
+
faceAge.API.setComments([
|
|
413
|
+
{
|
|
414
|
+
name: 'Jane Doe',
|
|
415
|
+
comment: 'My skin feels amazing after just two weeks!', // also accepts: text, body
|
|
416
|
+
image: 'https://example.com/avatar.jpg', // optional; also: avatar, photo
|
|
417
|
+
job_position: 'Verified Buyer', // optional; also: jobPosition, position, company
|
|
418
|
+
},
|
|
419
|
+
]);
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
Each item requires `name` and at least one of `comment` / `text` / `body`. Comments longer than 280 characters are automatically truncated with a "read more" expand. Returns `true` on success, `false` on error.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
### Set Shorts (Routine Tab)
|
|
427
|
+
|
|
428
|
+
Populate the short-form video/image carousel shown in the routine tab.
|
|
429
|
+
|
|
430
|
+
```js
|
|
431
|
+
faceAge.API.setShorts([
|
|
432
|
+
{
|
|
433
|
+
coverImage: 'https://example.com/thumb.jpg', // also: cover_image, cover, image, thumbnail, poster
|
|
434
|
+
videoUrl: 'https://example.com/clip.mp4', // optional; also: video_url, video, src
|
|
435
|
+
link: 'https://example.com/product', // optional; also: url, href
|
|
436
|
+
overlayText: 'Morning Routine', // optional; also: overlay_text, title, text, caption, overlay
|
|
437
|
+
},
|
|
438
|
+
]);
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
Each item requires at least one of `coverImage` / `videoUrl`. `javascript:`, `data:`, and `vbscript:` URLs are rejected. Returns `true` on success, `false` on error.
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
### Set Analysis Tab Sort Order
|
|
446
|
+
|
|
447
|
+
Control the display order of the tabs on the analysis result page (`scan`, `routine`, `recommendations`). Tabs not listed keep their default position after the explicitly ordered ones.
|
|
448
|
+
|
|
449
|
+
```js
|
|
450
|
+
// Show the routine tab first, then recommendations, then scan
|
|
451
|
+
faceAge.API.setSort(['routine', 'recommendations', 'scan']);
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
**Accepted tab name aliases:**
|
|
455
|
+
|
|
456
|
+
| Canonical key | Accepted aliases |
|
|
457
|
+
|---------------|-----------------|
|
|
458
|
+
| `scan` | `scan`, `scan_info`, `scaninfo`, `skin_report`, `skinreport` |
|
|
459
|
+
| `routine` | `routine`, `routines` |
|
|
460
|
+
| `recommendations` | `recommendations`, `recommendation`, `products`, `product` |
|
|
461
|
+
|
|
462
|
+
The call is live — if the analysis result page is already open it re-orders the tabs immediately. Returns `true` on success, `false` on error.
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
396
466
|
### Generate PDF Report
|
|
397
467
|
|
|
398
468
|
Requires PDF access on your Face Age plan.
|