From 4a223c6ae3d782b26d2b8884f0b9f015e3cda66e Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Thu, 3 Aug 2023 01:34:37 +0530 Subject: [PATCH] code refactoring --- index.html | 136 ---------------------------------------- scripts/components.js | 140 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 139 insertions(+), 137 deletions(-) diff --git a/index.html b/index.html index 3d284bc..cc4e5be 100644 --- a/index.html +++ b/index.html @@ -2578,142 +2578,6 @@ floGlobals.prefersReducedMotion = reduceMotionQuery.matches }); floGlobals.prefersReducedMotion = reduceMotionQuery.matches - - window.customElements.define('keys-generator', class extends HTMLElement { - constructor() { - super(); - this.innerHTML = ` - -
-
- -
- -

Keep your keys safe!

-
-

Don't share with anyone. Once lost private key can't be recovered.

-
-
-
-
-
FLO address
- -
-
-
Private key
- -
-
- -

You can use these FLO credentials with other RanchiMall apps too.

-
- ` - } - get keys() { - return { - floID: this.querySelector('#generated_flo_address').value, - privKey: this.querySelector('#generated_private_key').value - } - } - - generateKeys() { - const { floID, privKey } = floCrypto.generateNewID() - this.querySelector('#generated_flo_address').value = floID - this.querySelector('#generated_private_key').value = privKey - } - clearKeys() { - this.querySelector('#generated_flo_address').value = '' - this.querySelector('#generated_private_key').value = '' - } - }); - const adBlockerWarning = document.createElement('template') - adBlockerWarning.innerHTML = ` - -
- `; - window.customElements.define('adblocker-warning', class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: 'open' }); - this.shadowRoot.appendChild(adBlockerWarning.content.cloneNode(true)); - } - connectedCallback() { - const isBrave = navigator.brave !== undefined - this.shadowRoot.querySelector('#adblocker_warning').innerHTML = ` - -

Ad-Blocker Detected!

-

- Please disable your ad-blocker for optimal experience. Our app doesn't show ads or track activity. -

- ${isBrave ? `If you have enabled Brave shield then disable it also.` : ''} - `; - } - });