Skip to content

Commit

Permalink
fix: update pahts
Browse files Browse the repository at this point in the history
  • Loading branch information
jagcruz committed Oct 30, 2024
1 parent 38681b4 commit 6a878a8
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 50 deletions.
4 changes: 1 addition & 3 deletions src/components/CardSample.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ type Props = {
const { defaultCategory } = Astro.props;
const BASE_URL = import.meta.env.BASE_URL;
const cardLevel = 6;
const defaultTitle = `Categoría ${demoCategoryTitles[defaultCategory]}`;
const defaultImage = demoCategoryImages[defaultCategory];
Expand Down Expand Up @@ -65,7 +63,7 @@ const cssVars = {
</div>

<div class="card-back">
<img class="logo" src={`${BASE_URL}/assets/images/logo.png`} />
<img class="logo" src="/assets/images/logo.png" />
</div>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/components/Cards/Card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
import { stringifyCardNumber } from '@utils';
import { Icon } from 'astro-icon/components';
const BASE_URL = import.meta.env.BASE_URL;
type Props = AnaCard;
const { id, name, description, image, category, level = 1 } = Astro.props;
Expand All @@ -27,7 +25,7 @@ function getStyledCard(cat: CardCategory) {
<h1 class="card-title">{name}</h1>

<div class="card-image">
<img src={`${BASE_URL}/assets/images/cards/${image}`} loading="lazy" />
<img src={`/assets/images/cards/${image}`} loading="lazy" />
</div>

<p class="card-content">{description}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Cards/ana-card.wc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class AnaCard extends HTMLElement {
}

getImageURL() {
return `s/assets/images/cards/${this.cardImage}`;
return `/assets/images/cards/${this.cardImage}`;
}

render() {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Creator/Creator.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import type { Creator, CreatorIcon, HorizontalAlignment } from '@contracts';
import { Icon } from 'astro-icon/components';
const BASE_URL = import.meta.env.BASE_URL;
const ICON_TITLES: Record<CreatorIcon, string> = {
github: 'GitHub',
linkedin: 'LinkedIn',
Expand All @@ -26,7 +24,7 @@ const { name, description, avatar, direction, links, birthdate, isAmazing = fals
<article class:list={['creator', direction, { isAmazing }]} data-birthdate={birthdate}>
<header>
<div class="avatar-wrapper">
<img src={`${BASE_URL}/assets/images/creators/${avatar}`} alt={name} class="avatar" />
<img src={`/assets/images/creators/${avatar}`} alt={name} class="avatar" />
</div>

<div class="creator-card">
Expand Down
15 changes: 4 additions & 11 deletions src/components/Footer/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
---
import Logo from '../Logo.astro';
const BASE_URL = import.meta.env.BASE_URL;
---

<footer class="footer-wrapper">
<div class="footer">
<a class="logo" href="https://anarangel.github.io" target="_blank" rel="noopener noreferrer">
<a class="logo" href="https://uxanarangel.com" target="_blank" rel="noopener noreferrer">
<Logo size={96} />
</a>

<span class="last-row">
Hecho con
<span class="heart">
<img
src={`${BASE_URL}/assets/images/heart_on_fire.png`}
width="32"
height="32"
alt="love"
/>
<img src="/assets/images/heart_on_fire.png" width="32" height="32" alt="love" />
</span>
para la comunidad | Inspirado en <a
class="manzlink"
Expand Down Expand Up @@ -217,11 +210,11 @@ const BASE_URL = import.meta.env.BASE_URL;
}
</style>

<script define:vars={{ BASE_URL }}>
<script>
const manzlink = document.querySelector('.manzlink');

manzlink?.addEventListener('mouseenter', () => {
const audio = new Audio(`${BASE_URL}/assets/audio/star.mp3`);
const audio = new Audio('/assets/audio/star.mp3');

audio.play();
});
Expand Down
10 changes: 5 additions & 5 deletions src/components/Navbar/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const BASE_URL = import.meta.env.BASE_URL;
const items: NavbarItem[] = [
{ text: 'Inicio', slug: `${BASE_URL}` },
{ text: 'Ranking', slug: `${BASE_URL}/ranking` },
{ text: 'Creadores', slug: `${BASE_URL}/creators` },
{ text: 'Roadmap', slug: `${BASE_URL}/roadmap` },
{ text: 'Ranking', slug: `${BASE_URL}ranking` },
{ text: 'Creadores', slug: `${BASE_URL}creators` },
{ text: 'Roadmap', slug: `${BASE_URL}roadmap` },
{ text: 'Contacto', slug: 'https://discord.com/invite/6rfgHETy', external: true }
];
Expand All @@ -20,8 +20,8 @@ const items: NavbarItem[] = [
* @returns `true` si la ruta actual es la misma que la ruta del enlace, `false` en caso contrario.
*/
function isActiveSlug(slug: string) {
const normalizedPath = Astro.url.pathname.replace(`${BASE_URL}/`, '/');
const normalizedSlug = slug.replace(`${BASE_URL}/`, '/');
const normalizedPath = Astro.url.pathname.replace(`${BASE_URL}`, '/');
const normalizedSlug = slug.replace(`${BASE_URL}`, '/');
return (
normalizedPath === normalizedSlug ||
Expand Down
2 changes: 1 addition & 1 deletion src/components/RankingItem/RankingItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { place, score, username } = Astro.props;
{ 'first-place': place === 1, 'second-place': place === 2, 'third-place': place === 3 }
]}
>
<a href={`${BASE_URL}/ranking/${username}`} class="ranking-item">
<a href={`${BASE_URL}ranking/${username}`} class="ranking-item">
<header class="placement">
<span class="number">
{formatNumber(place, 2)}
Expand Down
2 changes: 1 addition & 1 deletion src/data/creators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const creators: Creator[] = [
description:
'UX Designer con una comunidad tan avanzada que ya es casi una secta, de hecho, mis seguidores llevan mi apellido en sus nicknames. Amante de los unicornios, devs y todo lo que tenga que ver con jugar en equipo (o sea, Fortnite y juegos a fines). Me encontrarás siempre rompiendo el estereotipo del UX gruñón: en lugar de hacerle la vida imposible a los devs, prefiero enseñar, compartir risas, y conquistar corazones... Si buscas unicornios, buena onda, y algo de código, estás oficialmente en territorio UX Corp Rangel!',
links: [
{ href: 'https://anarangel.github.io', icon: 'website' },
{ href: 'https://uxanarangel.com', icon: 'website' },
{ href: 'https://github.com/anarangel', icon: 'github' },
{ href: 'https://linkedin.com/in/ux-ana-rangel', icon: 'linkedin' },
{ href: 'https://instagram.com/ux.ana.rangel', icon: 'instagram' },
Expand Down
14 changes: 7 additions & 7 deletions src/data/demo-categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ const BASE_URL = import.meta.env.BASE_URL;

/** Imágenes de demostración de las categorías de las cartas */
export const demoCategoryImages: CategoryMap = {
[CardCategory.DESIGN]: `${BASE_URL}/assets/images/dummies/cat-design.webp`,
[CardCategory.HARLEY]: `${BASE_URL}/assets/images/dummies/cat-harley.webp`,
[CardCategory.DEVELOPMENT]: `${BASE_URL}/assets/images/dummies/cat-development.webp`,
[CardCategory.LORE]: `${BASE_URL}/assets/images/dummies/cat-lore.webp`,
[CardCategory.TROLL]: `${BASE_URL}/assets/images/dummies/cat-troll.webp`,
[CardCategory.TOOLS]: `${BASE_URL}/assets/images/dummies/cat-tools.webp`,
[CardCategory.SPECIAL]: `${BASE_URL}/assets/images/dummies/cat-special.webp`
[CardCategory.DESIGN]: `${BASE_URL}assets/images/dummies/cat-design.webp`,
[CardCategory.HARLEY]: `${BASE_URL}assets/images/dummies/cat-harley.webp`,
[CardCategory.DEVELOPMENT]: `${BASE_URL}assets/images/dummies/cat-development.webp`,
[CardCategory.LORE]: `${BASE_URL}assets/images/dummies/cat-lore.webp`,
[CardCategory.TROLL]: `${BASE_URL}assets/images/dummies/cat-troll.webp`,
[CardCategory.TOOLS]: `${BASE_URL}assets/images/dummies/cat-tools.webp`,
[CardCategory.SPECIAL]: `${BASE_URL}assets/images/dummies/cat-special.webp`
};

/** Títulos de las categorías de las cartas */
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const _title = !title ? 'Ana×Cards' : `${title} • Ana×Cards`;
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href={`${BASE_URL}/favicon.svg`} />
<link rel="icon" type="image/svg+xml" href={`${BASE_URL}favicon.svg`} />
<meta name="generator" content={Astro.generator} />
<title>{_title}</title>
<link rel="preload" as="font" href={bebasNeue} type="font/woff2" crossorigin />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const BASE_URL = import.meta.env.BASE_URL;
<main class="container">
<img
class="angry-unicorn"
src={`${BASE_URL}/assets/images/404.webp`}
src={`${BASE_URL}assets/images/404.webp`}
alt="Unicornio de caricaturas enojado"
width="350"
/>
Expand All @@ -18,7 +18,7 @@ const BASE_URL = import.meta.env.BASE_URL;

<a href={BASE_URL} class="link">Regresar al inicio</a>

<a href="https://anarangel.github.io" target="_self" rel="noopener noreferrer" class="logo">
<a href="https://uxanarangel.com" target="_self" rel="noopener noreferrer" class="logo">
<Logo size={100} />
</a>
</main>
Expand Down
8 changes: 2 additions & 6 deletions src/pages/ranking/[user].astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ const totalCards = formatNumber(cards.length, DIGITS);
<PageLayout title="Ranking: User">
<main class="container">
<aside class="user-wrapper">
<a class="back-button" href={`${BASE_URL}/ranking`}>
<a class="back-button" href={`${BASE_URL}ranking`}>
<Icon name="arrow-left" title="Ir arriba" size={32} />
</a>

<img
class="user-avatar"
src={`${BASE_URL}/assets/images/unicorn-avatar.png`}
alt="User Avatar"
/>
<img class="user-avatar" src="/assets/images/unicorn-avatar.png" alt="User Avatar" />

<h1 class="user-name">{currentUser.username}</h1>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/ranking/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ import { RANKING_MOCK } from '@data/ranking';
const username = searchInput?.value.trim().toLowerCase();

if (username) {
location.href = `${BASE_URL}/ranking/${username}`;
location.href = `${BASE_URL}ranking/${username}`;
}
}

Expand Down
6 changes: 1 addition & 5 deletions src/sections/home/Hero.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
const BASE_URL = import.meta.env.BASE_URL;
---

<section class="card-container">
<div>
<div class="card">
<div class="card-back">
<img class="logo" src={`${BASE_URL}/assets/images/logo.png`} />
<img class="logo" src="/assets/images/logo.png" />
</div>
</div>
</div>
Expand Down

0 comments on commit 6a878a8

Please sign in to comment.