rafa-links/src/pages/index.astro

51 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-01-08 04:21:53 +00:00
---
2022-08-18 04:38:12 +00:00
import MainLayout from "../layouts/main.astro";
2022-01-08 04:21:53 +00:00
import profileData from '../data/profile.json';
2022-01-19 00:44:26 +00:00
import Icon from "../components/icon.svelte";
2022-01-08 04:21:53 +00:00
2022-08-12 19:54:04 +00:00
type IconData = {
2022-08-18 04:38:12 +00:00
name: string;
url: string;
icon: string;
iconUrl?: string;
}
2022-08-12 19:54:04 +00:00
2022-01-08 04:21:53 +00:00
const profileName = profileData.name;
const personalLinks = [];
const profesionalLinks = [];
for (let link of profileData.personalLinks) {
2022-08-18 04:38:12 +00:00
const withUrl: IconData = { ...link };
2022-01-08 04:21:53 +00:00
2022-01-19 22:35:47 +00:00
withUrl.iconUrl = `/icons/${link.icon}.svg`;
2022-01-08 04:21:53 +00:00
personalLinks.push(withUrl);
}
for (let link of profileData.profesionalLinks) {
2022-08-18 04:38:12 +00:00
const withUrl: IconData = { ...link };
2022-01-08 04:21:53 +00:00
2022-01-19 22:35:47 +00:00
withUrl.iconUrl = `/icons/${link.icon}.svg`;
2022-01-08 04:21:53 +00:00
profesionalLinks.push(withUrl);
}
---
2022-08-18 04:38:12 +00:00
<MainLayout>
<h2 class="font-mono font-bold uppercase text-xl my-14 mx-auto tracking-wide w-11/12 max-w-5xl dark:text-white">
Personal Links</h2>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 w-11/12 max-w-5xl my-2 mx-auto">
{personalLinks.map(perLink => (
2022-08-25 13:03:59 +00:00
<Icon client:load perLink={perLink} profileName={profileName} />
2022-08-18 04:38:12 +00:00
))}
</div>
<h2 class="font-mono font-bold uppercase text-xl my-14 mx-auto tracking-wide w-11/12 max-w-5xl dark:text-white">
Profesional Links</h2>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 w-11/12 max-w-5xl my-2 mx-auto">
{profesionalLinks.map(perLink => (
<Icon client:load perLink={perLink} profileName={profileName} />
))}
</div>
</MainLayout>