From 38824cf91a7575d4d42640846463e9de2754ce4d Mon Sep 17 00:00:00 2001 From: Barnabas Nsoh Date: Fri, 19 Jan 2024 10:40:50 +0000 Subject: [PATCH] Move selfie instruction to new branch --- .../selfie-capture/SelfieInstruction.js | 687 ------------------ .../SelfieInstruction.stories.js | 17 - 2 files changed, 704 deletions(-) delete mode 100644 packages/components/selfie-capture/SelfieInstruction.js delete mode 100644 packages/components/selfie-capture/SelfieInstruction.stories.js diff --git a/packages/components/selfie-capture/SelfieInstruction.js b/packages/components/selfie-capture/SelfieInstruction.js deleted file mode 100644 index b509df9d..00000000 --- a/packages/components/selfie-capture/SelfieInstruction.js +++ /dev/null @@ -1,687 +0,0 @@ -"use strict"; - -function templateString() { - return ` - - - -
- ${this.showNavigation ? ` - - ` : ''} -
- - - - - - - - - - - - - - - -

Next, we'll take a quick selfie

-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
-

Good Light

-

- Make sure you are in a well-lit environment where your face is - clear and visible -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
-

Clear Image

-

- Hold your phone steady so the selfie is clear and sharp. Don't - take blurry images. -

-
-
-
- - - - - - -
-

Remove Obstructions

-

- Remove anything that covers your face, such glasses, masks, hats - and scarves -

-
-
-
- ${this.hideAttribution ? '' : ` - - `} -
- `; -} - -class SelfieInstruction extends HTMLElement { - constructor() { - super(); - this.templateString = templateString.bind(this); - this.render = () => { - return this.templateString(); - }; - - this.attachShadow({ mode: "open" }); - } - - connectedCallback() { - this.pages = []; - const template = document.createElement("template"); - template.innerHTML = this.render(); - - this.shadowRoot.appendChild(template.content.cloneNode(true)); - - this.backButton = this.shadowRoot.querySelector("#back-button"); - const CloseIframeButtons = - this.shadowRoot.querySelectorAll(".close-iframe"); - - this.backButton && this.backButton.addEventListener("click", (e) => { - this.handleBackEvents(e); - }); - - CloseIframeButtons.forEach((button) => { - button.addEventListener( - "click", - () => { - this.closeWindow(); - }, - false, - ); - }); - } - - get hideBack() { - return this.hasAttribute("hide-back-to-host"); - } - - get themeColor() { - return this.getAttribute("theme-color") || "#043C93"; - } - - get hideAttribution() { - return this.hasAttribute('hide-attribution'); - } - - handleBackEvents() { - this.dispatchEvent(new CustomEvent("SmileIdentity::Exit")); - } - - closeWindow() { - const referenceWindow = window.parent; - referenceWindow.postMessage("SmileIdentity::Close", "*"); - } -} - -if ("customElements" in window) { - window.customElements.define('selfie-instruction', SelfieInstruction); -} - -export { - SelfieInstruction -}; diff --git a/packages/components/selfie-capture/SelfieInstruction.stories.js b/packages/components/selfie-capture/SelfieInstruction.stories.js deleted file mode 100644 index 6d9906f8..00000000 --- a/packages/components/selfie-capture/SelfieInstruction.stories.js +++ /dev/null @@ -1,17 +0,0 @@ -import "./index"; - -const meta = { - component: "selfie-instruction", -}; - -export default meta; - -export const SelfieInstruction = { - render: () => ` - - - `, -} \ No newline at end of file