From 465a4a3c1869883d0ed173f43347afb88d9cedd9 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Tue, 4 Nov 2025 23:03:02 +0100 Subject: [PATCH] Updated the home page --- src/pages/home/home-component.ts | 40 ++++++------ src/pages/home/home.html | 13 +--- src/pages/home/home.ts | 102 +++++++++++++++++-------------- 3 files changed, 80 insertions(+), 75 deletions(-) diff --git a/src/pages/home/home-component.ts b/src/pages/home/home-component.ts index b38e1a5..d7af469 100644 --- a/src/pages/home/home-component.ts +++ b/src/pages/home/home-component.ts @@ -1,5 +1,6 @@ +// src/pages/home/home-component.ts + import loginHtml from './home.html?raw'; -import loginScript from './home.ts?raw'; import loginCss from '../../4nk.css?raw'; import { initHomePage } from './home'; @@ -11,11 +12,26 @@ export class LoginComponent extends HTMLElement { } connectedCallback() { - console.log('CALLBACK LOGIN PAGE'); this.render(); - setTimeout(() => { - initHomePage(); - }, 500); + + try { + if (this.shadowRoot) { + initHomePage(this.shadowRoot); + } else { + console.error("[LoginComponent] đŸ’„ ShadowRoot est nul. Impossible d'initialiser."); + } + } catch (e) { + console.error("[LoginComponent] đŸ’„ Échec de l'initHomePage:", e); + } + } + + render() { + if (this.shadowRoot) { + this.shadowRoot.innerHTML = ` + + ${loginHtml} + `; + } } set callback(fn) { @@ -25,23 +41,9 @@ export class LoginComponent extends HTMLElement { console.error('Callback is not a function'); } } - get callback() { return this._callback; } - - render() { - if (this.shadowRoot) - this.shadowRoot.innerHTML = ` - ${loginHtml} -