Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/Icon.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
import { ICON_SIZES } from "../data/iconSizes";

interface Props {
name:
| "arrow"
| "article"
| "download"
| "github"
| "linkedin"
Expand All @@ -12,10 +15,12 @@ interface Props {
size?: number;
}

const { name, size = 20 } = Astro.props;
const { name, size = ICON_SIZES.lg } = Astro.props;

const paths = {
arrow: '<path d="M5 12h14M13 6l6 6-6 6"/>',
article:
'<rect x="5" y="3" width="14" height="18" rx="2"/><path d="M8 8h8M8 12h8M8 16h5"/>',
download: '<path d="M12 3v12m0 0 5-5m-5 5-5-5M5 21h14"/>',
github:
'<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3.3-.4 6.8-1.6 6.8-7A5.4 5.4 0 0 0 19.4 4 5 5 0 0 0 19.3.5S18.2.1 15 2a13.4 13.4 0 0 0-7 0C4.8.1 3.7.5 3.7.5A5 5 0 0 0 3.6 4a5.4 5.4 0 0 0-1.4 3.7c0 5.3 3.5 6.5 6.8 7A4.8 4.8 0 0 0 8 18v4m0-3c-3 .9-3-1.5-4.2-2"/>',
Expand Down
23 changes: 15 additions & 8 deletions src/components/Nav.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
---
import Icon from "./Icon.astro";
import { ICON_SIZES } from "../data/iconSizes";

const isHomePage = Astro.url.pathname === "/";
const sectionHref = (section: string) =>
isHomePage ? `#${section}` : `/#${section}`;
---

<header class="nav-shell">
<nav class="nav container" aria-label="Main navigation">
<a class="brand" href="#top">
<a class="brand" href={isHomePage ? "#top" : "/"}>
<span class="brand__mark" aria-hidden="true">DD</span>
<span>Derek DiLeo</span>
</a>
<div id="mobile-navigation" class="nav__links">
<a href="#about" data-section-link="about">About</a>
<a href="#work" data-section-link="work">Work</a>
<a href="#approach" data-section-link="approach">Approach</a>
<a href="#contact" data-section-link="contact">Contact</a>
<a href={sectionHref("about")} data-section-link="about">About</a>
<a href={sectionHref("work")} data-section-link="work">Work</a>
<a href={sectionHref("approach")} data-section-link="approach">
Approach
</a>
<a href={sectionHref("contact")} data-section-link="contact">Contact</a>
</div>
<div class="nav__actions">
<button
Expand All @@ -22,10 +29,10 @@ import Icon from "./Icon.astro";
title="Switch to light theme"
>
<span class="nav__theme-icon nav__theme-icon--sun"
><Icon name="sun" size={18} /></span
><Icon name="sun" size={ICON_SIZES.md} /></span
>
<span class="nav__theme-icon nav__theme-icon--moon"
><Icon name="moon" size={18} /></span
><Icon name="moon" size={ICON_SIZES.md} /></span
>
</button>
<a
Expand All @@ -35,7 +42,7 @@ import Icon from "./Icon.astro";
rel="noreferrer"
aria-label="GitHub profile"
>
<Icon name="github" size={18} />
<Icon name="github" size={ICON_SIZES.md} />
<span>GitHub</span>
</a>
<button
Expand Down
23 changes: 20 additions & 3 deletions src/components/ProjectCard.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import type { Project } from "../data/projects";
import { ICON_SIZES } from "../data/iconSizes";
import Icon from "./Icon.astro";

interface Props {
Expand Down Expand Up @@ -32,8 +33,19 @@ const { project, index } = Astro.props;
</ul>
<div class="project-card__links">
<a href={project.github} target="_blank" rel="noreferrer">
<Icon name="github" size={18} /> Source <Icon name="arrow" size={16} />
<Icon name="github" size={ICON_SIZES.md} /> Source <Icon
name="arrow"
size={ICON_SIZES.sm}
/>
</a>
{
project.caseStudy && (
<a class="case-study-link" href={project.caseStudy}>
<Icon name="article" size={ICON_SIZES.md} /> Case study
<Icon name="arrow" size={ICON_SIZES.sm} />
</a>
)
}
{
project.preview && (
<a
Expand All @@ -42,7 +54,7 @@ const { project, index } = Astro.props;
target="_blank"
rel="noreferrer"
>
<Icon name="play" size={18} /> Preview
<Icon name="play" size={ICON_SIZES.md} /> Preview
</a>
)
}
Expand Down Expand Up @@ -177,7 +189,12 @@ const { project, index } = Astro.props;
transform: translateX(3px);
}
.project-card__links .secondary-link {
color: var(--color-text-secondary);
color: var(--color-text);
font-weight: 650;
}
.project-card__links .case-study-link {
color: var(--color-text);
font-weight: 650;
}

@media (max-width: 800px) {
Expand Down
6 changes: 6 additions & 0 deletions src/data/iconSizes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const ICON_SIZES = {
xs: 14,
sm: 16,
md: 18,
lg: 20,
} as const;
2 changes: 2 additions & 0 deletions src/data/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Project = {
imageAlt: string;
stack: string[];
github: string;
caseStudy?: string;
preview?: string;
featured?: boolean;
};
Expand All @@ -22,6 +23,7 @@ export const projects: Project[] = [
imageAlt: "Request Live Music mobile application screens",
stack: ["Flutter", "Dart", "Firebase", "Cloud Firestore"],
github: "https://github.com/derekdotdev/request-live-mobile",
caseStudy: "/case-studies/request-live-music/",
featured: true,
},
{
Expand Down
Loading
Loading