From 3a851d1b62b57cd0295b3241b97d43a3beeb7ae9 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Wed, 12 Mar 2025 10:56:26 +0100 Subject: [PATCH] fusionDev1Dev3 --- package.json | 2 +- public/style/account.css | 61 ++++++++++++++++++- src/pages/account/account.ts | 114 +++++++++++++++++++++++++++-------- 3 files changed, 149 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index f0515ae..b2a2dfe 100755 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "build_wasm": "wasm-pack build --out-dir ../ihm_client/pkg ../sdk_client --target bundler --dev", + "build_wasm": "wasm-pack build --out-dir ../ihm_client_dev1/pkg ../sdk_client --target bundler --dev", "start": "vite --host 0.0.0.0", "build": "tsc && vite build", "deploy": "sudo cp -r dist/* /var/www/html/", diff --git a/public/style/account.css b/public/style/account.css index bdaca7b..992ff67 100755 --- a/public/style/account.css +++ b/public/style/account.css @@ -599,7 +599,7 @@ body { margin-top: 9vh; margin-left: -1%; text-align: left; - width: 209vh; + width: 100vw; } /* Liste des information sur l'account */ @@ -1364,3 +1364,62 @@ body { border-radius: 50%; border: 2px solid white; } + +/* ---------------------Style pour le QR code--------------------- */ + +.qr-code { + width: 50px; + height: 50px; + cursor: pointer; + transition: transform 0.2s ease; +} + +.qr-code:hover { + transform: scale(1.5); +} + +.qr-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.qr-modal-content { + background-color: white; + padding: 20px; + border-radius: 8px; + position: relative; + text-align: center; +} + +.close-qr-modal { + position: absolute; + right: 10px; + top: 5px; + font-size: 24px; + cursor: pointer; + color: #666; +} + +.close-qr-modal:hover { + color: #000; +} + +.qr-code-large { + max-width: 300px; + margin: 10px 0; +} + +.qr-address { + margin-top: 10px; + word-break: break-all; + font-size: 12px; + color: #666; +} diff --git a/src/pages/account/account.ts b/src/pages/account/account.ts index 46f1581..617dddb 100755 --- a/src/pages/account/account.ts +++ b/src/pages/account/account.ts @@ -2,7 +2,7 @@ declare global { interface Window { initAccount: () => void; showContractPopup: (contractId: string) => void; - showPairing: () => void; + showPairing: () => Promise; showWallet: () => void; showData: () => void; addWalletRow: () => void; @@ -36,6 +36,7 @@ declare global { generateRecoveryWords: () => string[]; exportUserData: () => void; updateActionButtons: () => void; + showQRCodeModal: (address: string) => void; } } @@ -45,6 +46,7 @@ import { Row, WalletRow, DataRow, Notification, Contract, NotificationMessage } import { addressToEmoji } from '../../utils/sp-address.utils'; import { getCorrectDOM } from '../../utils/document.utils'; import accountStyle from '../../../public/style/account.css?inline'; +import Services from '../../services/service'; let isAddingRow = false; let currentRow: HTMLTableRowElement | null = null; @@ -197,6 +199,7 @@ class AccountElement extends HTMLElement { window.updateActionButtons = () => this.updateActionButtons(); window.openAvatarPopup = () => this.openAvatarPopup(); window.closeAvatarPopup = () => this.closeAvatarPopup(); + window.showQRCodeModal = (address: string) => this.showQRCodeModal(address); if (!localStorage.getItem('rows')) { localStorage.setItem('rows', JSON.stringify(defaultRows)); @@ -552,6 +555,13 @@ private updateTableContent(rows: Row[]): void { ${row.column1} ${row.column2} ${row.column3} + + QR Code +