face-age 2.4.17 → 2.5.1

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 CHANGED
@@ -44,7 +44,7 @@ Detect skin age, wrinkles, acne, dark circles, pores, pigmentation, oiliness, an
44
44
 
45
45
  - **AI Skin Analysis** — camera capture or image upload with real-time face detection
46
46
  - **13 Skin Metrics** — wrinkles, acne, dark circles, pores, pigment, redness, oiliness, dryness, and more
47
- - **3 Display Modes** — embed as a widget, inline section, or full-screen modal
47
+ - **4 Display Modes** — embed as a widget or inline section, open as a modal, or run as a fullscreen app
48
48
  - **Product Recommendations** — show matched products with add-to-cart and checkout callbacks
49
49
  - **Skincare Routines** — group recommendations by morning/evening routine steps
50
50
  - **Quiz Flow** — collect user preferences with pre-fillable form fields
@@ -131,7 +131,7 @@ import FaceAge from 'face-age';
131
131
  const faceAge = new FaceAge({
132
132
  elementId: 'FaceAge-module',
133
133
  faceageId: '<Your Client ID>',
134
- displayModel: 'section', // 'widget' | 'section' | 'modal'
134
+ displayModel: 'section', // 'widget' | 'section' | 'modal' | 'fullscreen'
135
135
  language: 'en',
136
136
  height: '550px',
137
137
  currency: '$',
@@ -183,7 +183,7 @@ All options are passed to `new FaceAge(options)`.
183
183
  |--------|------|---------|-------------|
184
184
  | `elementId` | `String` | — | **Required** for `widget` and `section` display modes. ID of the container element. |
185
185
  | `faceageId` | `String` | — | **Required.** Your Face Age license ID from the [panel](https://panel.getfaceage.com). |
186
- | `displayModel` | `String` | `'section'` | Display mode: `'widget'`, `'section'`, or `'modal'`. |
186
+ | `displayModel` | `String` | `'section'` | Display mode: `'widget'`, `'section'`, `'modal'`, or `'fullscreen'`. |
187
187
  | `language` | `String` | `'en'` | UI language code. See [supported languages](#supported-languages) below. |
188
188
  | `width` | `String` | `'360px'` | Width of the widget — only applies when `displayModel` is `'widget'`. |
189
189
  | `height` | `String` | `'800px'` / `'580px'` | Height of the widget — defaults differ for `section` vs `widget`. |
@@ -195,7 +195,38 @@ All options are passed to `new FaceAge(options)`.
195
195
  |------|----------|
196
196
  | `'section'` | Renders inline, expanding to fill one content row on the page |
197
197
  | `'widget'` | Renders as a fixed-size standalone panel (respects `width` and `height`) |
198
- | `'modal'` | Opens as a full-screen overlay; no `elementId` required |
198
+ | `'modal'` | A floating button opens the analysis over the page: full screen on phones, a centered window (90% of the screen, up to 1140 × 800 px) on tablets and desktops. No `elementId` required. |
199
+ | `'fullscreen'` | The app itself: opens right away over the whole screen, edge to edge, on every device. No floating button and no close button. No `elementId` required. |
200
+
201
+ #### Fullscreen mode
202
+
203
+ `'fullscreen'` turns the page into the app: the analysis opens as soon as `render()` runs and covers the whole screen. There is no floating button to open it and no way to close it — use it on a page that exists only for the scan.
204
+
205
+ ```js
206
+ const faceAge = new FaceAge({
207
+ faceageId: '<Your Client ID>',
208
+ displayModel: 'fullscreen',
209
+ });
210
+
211
+ faceAge.render();
212
+ ```
213
+
214
+ | | `'modal'` | `'fullscreen'` |
215
+ |---|---|---|
216
+ | Opens | When the shopper clicks the floating button | Right away, on `render()` |
217
+ | Floating button | Yes | No |
218
+ | Close button | Yes, in the top bar | No — it can't be closed |
219
+ | Phones | Covers the whole screen | Covers the whole screen |
220
+ | Tablets & desktops | Centered window with rounded corners over a dimmed page | Covers the whole screen, edge to edge, no frame |
221
+ | Page behind it | Visible around the window, scrolling locked | Hidden, scrolling locked |
222
+ | `onCloseModal` | Fires on close | Never fires |
223
+ | `elementId`, `width`, `height` | Not used | Not used |
224
+
225
+ - Fills the full width and height of the browser window and follows resizing and rotation.
226
+ - On phones it uses the visible screen height, so the browser's address bar and toolbar never cut off the bottom.
227
+ - On phones with a notch or rounded corners, the content stays inside the safe area.
228
+
229
+ Use it for a dedicated scan page, a web app or a home-screen shortcut, or a large screen such as an in-store tablet or kiosk. Use `'modal'` when shoppers should open the scan from your normal pages and go back to them.
199
230
 
200
231
  ### Quiz
201
232
 
@@ -294,7 +325,7 @@ The following interactions are tracked automatically in both GA and Pixel:
294
325
  | Product view / interaction | Product card viewed or clicked |
295
326
  | Add to cart | Add-to-cart button clicked |
296
327
  | Checkout | Checkout button clicked |
297
- | Modal open / close | Modal opened or dismissed |
328
+ | Modal open / close | Modal opened or dismissed (`modal` mode) |
298
329
  | Download report | PDF report download initiated |
299
330
 
300
331
  ---
@@ -507,7 +538,7 @@ Register callbacks to react to user interactions in real time.
507
538
  | `onAddToCart` | `(data)` | User clicks add to cart |
508
539
  | `onClickProduct` | `(product)` | User clicks a product card |
509
540
  | `onResetData` | `()` | User clicks reset / start over |
510
- | `onCloseModal` | `()` | User closes the modal |
541
+ | `onCloseModal` | `()` | User closes the modal (`modal` mode only — `fullscreen` can't be closed) |
511
542
  | `onCheckout` | `(data)` | User clicks the checkout button |
512
543
 
513
544
  **Example:**