From 6b1039a9bbd155eb4dd47319d4e578fb8cd7c565 Mon Sep 17 00:00:00 2001 From: Andre Torquato Date: Mon, 27 Oct 2025 13:21:38 -0300 Subject: [PATCH 1/2] chore: update favicon --- index.html | 4 +- public/favicon.ico | Bin 4286 -> 0 bytes public/logo.svg | 50 ++++++++++++++++++++++++ src/routes/loaders/loadLandingRemote.ts | 12 ++++++ src/types/landing.d.ts | 7 ++++ src/utils/applyDocumentMeta.ts | 25 ++++++++++++ 6 files changed, 96 insertions(+), 2 deletions(-) delete mode 100644 public/favicon.ico create mode 100644 public/logo.svg create mode 100644 src/routes/loaders/loadLandingRemote.ts create mode 100644 src/types/landing.d.ts create mode 100644 src/utils/applyDocumentMeta.ts diff --git a/index.html b/index.html index fb5c481..3eab86a 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,9 @@ - + - Shell + Moduflix diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index df36fcfb72584e00488330b560ebcf34a41c64c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..72e936f --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/routes/loaders/loadLandingRemote.ts b/src/routes/loaders/loadLandingRemote.ts new file mode 100644 index 0000000..2e13de8 --- /dev/null +++ b/src/routes/loaders/loadLandingRemote.ts @@ -0,0 +1,12 @@ +import { applyDocumentMeta } from "../../utils/applyDocumentMeta"; + +export async function loadLandingRemote() { + const remote = await import("landing/Landing"); + + applyDocumentMeta({ + title: "Moduflix - Landing", + description: "Application with Vue.js", + }); + + return remote.default; +} diff --git a/src/types/landing.d.ts b/src/types/landing.d.ts new file mode 100644 index 0000000..115cdf4 --- /dev/null +++ b/src/types/landing.d.ts @@ -0,0 +1,7 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/no-empty-object-type */ +declare module "landing/Landing" { + import { DefineComponent } from "vue"; + const component: DefineComponent<{}, {}, any>; + export default component; +} diff --git a/src/utils/applyDocumentMeta.ts b/src/utils/applyDocumentMeta.ts new file mode 100644 index 0000000..4ec7e26 --- /dev/null +++ b/src/utils/applyDocumentMeta.ts @@ -0,0 +1,25 @@ +export function applyDocumentMeta({ + title, + description, +}: { + title?: string; + description?: string; +}) { + if (title) { + document.title = title; + } + + if (description) { + let metaDesc = document.querySelector( + 'meta[name="description"]', + ) as HTMLMetaElement | null; + + if (!metaDesc) { + metaDesc = document.createElement("meta"); + metaDesc.name = "description"; + document.head.appendChild(metaDesc); + } + + metaDesc.content = description; + } +} From 1e7076eb0308b09e08b10008c5698b8f61057cbf Mon Sep 17 00:00:00 2001 From: Andre Torquato Date: Mon, 27 Oct 2025 13:24:37 -0300 Subject: [PATCH 2/2] feat: add shell navigate --- eslint.config.js | 1 + src/main.ts | 2 +- src/routes/routes.ts | 12 +++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index f4575c4..6cc9ef1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -20,6 +20,7 @@ export default defineConfig([ rules: { semi: "error", "prefer-const": "error", + "@typescript-eslint/no-explicit-any": "off" }, }, { diff --git a/src/main.ts b/src/main.ts index 64267dc..8830cc0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { createPinia } from "pinia"; import { createApp } from "vue"; -import { router } from "./routes/routes"; +import router from "./routes/routes"; import App from "./App.vue"; const app = createApp(App); diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 10ca36a..3f3fbd9 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1,15 +1,21 @@ import { createRouter, createWebHistory } from "vue-router"; import Auth from "../views/Auth.vue"; -import Landing from "../views/Landing.vue"; import Catalog from "../views/Catalog.vue"; import Player from "../views/Player.vue"; +import { loadLandingRemote } from "./loaders/loadLandingRemote"; const routes = [ - { path: "/", component: Landing }, + { path: "/", component: loadLandingRemote }, { path: "/auth", component: Auth }, { path: "/catalog", component: Catalog }, { path: "/player", component: Player }, ]; -export const router = createRouter({ history: createWebHistory(), routes }); +const router = createRouter({ history: createWebHistory(), routes }); + +(window as any).shellNavigate = (to: string) => { + router.push(to); +}; + +export default router;