Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ciffelia committed Jan 18, 2024
1 parent 28a10c4 commit bb7e94d
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 30 deletions.
39 changes: 17 additions & 22 deletions src/components/hero/HeroSection.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
import { Image } from "astro:assets";
import { getCollection } from "astro:content";
import ciffeliaIcon from "@/assets/ciffelia.png";
import twitterIcon from "@/assets/twitter.svg";
import githubIcon from "@/assets/github.svg";
import InViewEffect from "@/components/InViewEffect.astro";
import Ocean from "./ocean/Ocean.astro";
import SocialLink from "./SocialLink.astro";
const links = await getCollection("link");
---

<header>
Expand All @@ -31,26 +32,20 @@ import SocialLink from "./SocialLink.astro";
</div>

<div class="links">
<InViewEffect>
<SocialLink
url="https://twitter.com/ciffelia"
color="var(--color-twitter)"
icon={twitterIcon}
iconLoading="eager"
>
Twitter
</SocialLink>
</InViewEffect>
<InViewEffect>
<SocialLink
url="https://github.com/ciffelia"
color="var(--color-github)"
icon={githubIcon}
iconLoading="eager"
>
GitHub
</SocialLink>
</InViewEffect>
{
links.map(({ data }) => (
<InViewEffect>
<SocialLink
url={data.url}
color={data.color}
icon={data.icon}
iconLoading="eager"
>
{data.name}
</SocialLink>
</InViewEffect>
))
}
</div>
</header>

Expand Down
1 change: 1 addition & 0 deletions src/components/hero/SocialLink.astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const { url, color, icon, iconLoading } = Astro.props;
background-color: var(--color);
filter: drop-shadow(0 4px 7px var(--color-shadow1));
border-radius: 12px;
text-decoration: none;
transition:
filter 0.15s var(--easing-pop),
transform 0.15s var(--easing-pop);
Expand Down
16 changes: 16 additions & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z, defineCollection } from "astro:content";

const linkCollection = defineCollection({
type: "data",
schema: ({ image }) =>
z.object({
name: z.string(),
url: z.string().url(),
color: z.string(),
icon: image(),
}),
});

export const collections = {
link: linkCollection,
};
6 changes: 6 additions & 0 deletions src/content/link/0-twitter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Twitter",
"url": "https://twitter.com/ciffelia",
"color": "#1da1f2",
"icon": "./0-twitter.svg"
}
File renamed without changes
6 changes: 6 additions & 0 deletions src/content/link/1-github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "GitHub",
"url": "https://github.com/ciffelia",
"color": "#231f20",
"icon": "./1-github.svg"
}
File renamed without changes
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
8 changes: 0 additions & 8 deletions src/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
--color-light-cover1: #3585ff;
--color-light-cover2: #0044ac;
--color-light-ocean: #3585ff;
--color-light-twitter: #1da1f2;
--color-light-github: #231f20;

/* Dark Theme */
--color-dark-text1: #fdfdfd;
Expand All @@ -28,8 +26,6 @@
--color-dark-cover1: #0044ac;
--color-dark-cover2: #3585ff;
--color-dark-ocean: #0044ac;
--color-dark-twitter: #1da1f2;
--color-dark-github: #231f20;

/* Miscellaneous */
--border1: var(--color-border1) solid 1px;
Expand All @@ -51,8 +47,6 @@
--color-cover1: var(--color-light-cover1);
--color-cover2: var(--color-light-cover2);
--color-ocean: var(--color-light-ocean);
--color-twitter: var(--color-light-twitter);
--color-github: var(--color-light-github);
}

@media (prefers-color-scheme: dark) {
Expand All @@ -70,7 +64,5 @@
--color-cover1: var(--color-dark-cover1);
--color-cover2: var(--color-dark-cover2);
--color-ocean: var(--color-dark-ocean);
--color-twitter: var(--color-dark-twitter);
--color-github: var(--color-dark-github);
}
}

0 comments on commit bb7e94d

Please sign in to comment.