Skip to content

Commit

Permalink
refactor: index.html and outers.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAlvesdev committed Sep 7, 2024
1 parent 7817b39 commit d9a3fa4
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 23 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<a class="c-navbar__logo" slot="logo" href="/" data-link>
<img class="c-navbar__img ts-image-logo" src="/images/hbo-logo.svg" alt="logo da HBOMAX" />
</a>
<a class="c-navbar__link ts-assign-link" slot="link" href="/#c-subscription" data-link>assine agora</a>
<a class="c-navbar__link" slot="sign-link" href="/signin" data-link>entrar</a>
<a class="c-navbar__link ts-assign-link" slot="link" href="/hbomax/#c-subscription" data-link>assine agora</a>
<a class="c-navbar__link" slot="sign-link" href="/hbomax/signin" data-link>entrar</a>
</max-navbar>
<!-- ============================================================ -->
<!-- | Loader -->
Expand Down
26 changes: 13 additions & 13 deletions public/views/home.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
<div class="o-wrapper">
<div class="c-header__content o-flex-container">
<div class="c-header__channels o-flex-container">
<img src="/images/hbo.png" alt="HBO" class="c-header__channel" />
<img src="/images/dc.png" alt="DC" class="c-header__channel" />
<img src="/hbomax/images/hbo.png" alt="HBO" class="c-header__channel" />
<img src="/hbomax/images/dc.png" alt="DC" class="c-header__channel" />
<img
src="/images/wb.png"
src="/hbomax/images/wb.png"
alt="Warner Bross"
class="c-header__channel"
/>
<img
src="/images/cartoon-network_neutral.png"
src="/hbomax/images/cartoon-network_neutral.png"
alt="Cartoon Network"
class="c-header_channel"
/>
<img
src="/images/max_originals.png"
src="/hbomax/images/max_originals.png"
alt="Max Originals"
class="c-header__channel"
/>
Expand Down Expand Up @@ -78,7 +78,7 @@ <h3>Mobile</h3>
</li>
</ul>
</div>
<a href="/not-implemented" class="c-button c-button--gradient" data-link>
<a href="/hbomax/not-implemented" class="c-button c-button--gradient" data-link>
Escolher o Plano Mobile
</a>
</div>
Expand Down Expand Up @@ -113,7 +113,7 @@ <h3>Multitelas</h3>
</li>
</ul>
</div>
<a href="/not-implemented" class="c-button c-button--gradient" data-link>
<a href="/hbomax/not-implemented" class="c-button c-button--gradient" data-link>
Escolher o Plano Multitelas
</a>
</div>
Expand All @@ -127,38 +127,38 @@ <h2 class="c-contents__title">Descubra novos universos</h2>
<div class="c-contents__card">
<img
class="c-contents__image"
src="/images/hbo-default_0.webp"
src="/hbomax/images/hbo-default_0.webp"
alt="HBO"
/>
</div>
<div class="c-contents__card">
<img
class="c-contents__image"
src="/images/MAX-Default.webp"
src="/hbomax/images/MAX-Default.webp"
alt="Max Originals"
/>
</div>
<div class="c-contents__card">
<img class="c-contents__image" src="/images/DC_Default.webp" alt="DC" />
<img class="c-contents__image" src="/hbomax/images/DC_Default.webp" alt="DC" />
</div>
<div class="c-contents__card">
<img
class="c-contents__image"
src="/images/WB-Default.webp"
src="/hbomax/images/WB-Default.webp"
alt="Warner Bross"
/>
</div>
<div class="c-contents__card">
<img
class="c-contents__image"
src="/images/CN-Default.webp"
src="/hbomax/images/CN-Default.webp"
alt="Cartoon Network"
/>
</div>
<div class="c-contents__card">
<img
class="c-contents__image"
src="/images/UCL-Default.webp"
src="/hbomax/images/UCL-Default.webp"
alt="UEFA Champions League"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/views/not-found.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1 class="c-info__title">404</h1>
<p class="c-info__text">desculpe, mas a página que você solicitou não foi implementada</p>
<div class="c-info__actions">
<a href="/" class="c-button c-info__button c-button--gradient" data-link>go home</a>
<a href="/hbomax/" class="c-button c-info__button c-button--gradient" data-link>go home</a>
<a href="#" class="c-info__link">contact us</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/views/signin.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ <h1 class="c-login__title">Entrar</h1>
minlength="8"
/>
<div class="c-login__actions">
<a href="/not-implemented" class="c-button c-login__button c-button--gradient" data-link>Entrar</a>
<a href="/not-implemented" class="c-login__link" data-link> Esqueceu a senha? </a>
<a href="/hbomax/not-implemented" class="c-button c-login__button c-button--gradient" data-link>Entrar</a>
<a href="/hbomax/not-implemented" class="c-login__link" data-link> Esqueceu a senha? </a>
</div>
</form>
</main>
5 changes: 4 additions & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import getElement from './utils/get-element.util';
import setClasses from './utils/set-classes.util';
import sleep from './utils/sleep.util';

// Base URL
import viteConfig from '../vite.config'

const navigateTo = (url: string): void => {
history.pushState(null, '', url);
router();
Expand All @@ -28,7 +31,7 @@ const router: () => Promise<void> = async (): Promise<void> => {
const potentialMatches: IPotentialMatch[] = routes.map((route: IRoute): IPotentialMatch => {
return {
route: route,
isMatch: location.pathname === route.path
isMatch: location.pathname === `${viteConfig.base.substring(0, 7)}${route.path}`
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/views/home.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class HomeView extends AbstratctView {
}

async getHtml(): Promise<string> {
const url: string = '/views/home.view.html';
const url: string = '/hbomax/views/home.view.html';
const resquest: string = await fetch(url)
.then((data: Response): Promise<string> => data.text())

Expand Down
2 changes: 1 addition & 1 deletion src/views/not-found.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class NotFoundView extends AbstratctView {
}

async getHtml(): Promise<string> {
const url: string = '/views/not-found.view.html'
const url: string = '/hbomax/views/not-found.view.html'
const resquest: string = await fetch(url)
.then((data: Response): Promise<string> => data.text());

Expand Down
2 changes: 1 addition & 1 deletion src/views/signin.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class SignInView extends AbstratctView {
}

async getHtml(): Promise<string> {
const url: string = '/views/signin.view.html';
const url: string = '/hbomax/views/signin.view.html';
const resquest: string = await fetch(url)
.then((data: Response): Promise<string> => data.text());

Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserConfig } from 'vite'

export default {
base: '/'
base: '/hbomax/'
} satisfies UserConfig

0 comments on commit d9a3fa4

Please sign in to comment.