Skip to content

Commit 3102827

Browse files
committed
feat: add resume and refactor button component
1 parent 0c47245 commit 3102827

File tree

6 files changed

+35
-9
lines changed

6 files changed

+35
-9
lines changed

public/resume.pdf

113 KB
Binary file not shown.

src/components/button.astro

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
---
2-
const { link, text } = Astro.props;
2+
interface Props {
3+
link: string;
4+
text: string;
5+
variant?: 'solid' | 'outline' | 'ghost';
6+
target?: string;
7+
rel?: string;
8+
class?: string;
9+
}
10+
const { link, text, variant = 'solid', target, rel, class: extraClass = '' }: Props = Astro.props;
11+
12+
const base = 'inline-flex w-auto px-4 py-2 mt-5 text-xs font-semibold duration-300 ease-out rounded-full';
13+
const solid = 'border bg-neutral-900 dark:bg-white dark:text-neutral-900 text-neutral-100 hover:border-neutral-700 border-neutral-900 dark:hover:border-neutral-300 hover:bg-white dark:hover:bg-black dark:hover:text-white hover:text-neutral-900';
14+
const outline = 'border border-neutral-300 dark:border-neutral-600 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-900 hover:text-white dark:hover:bg-white dark:hover:text-neutral-900';
15+
const ghost = 'text-neutral-600 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-white';
16+
const styleMap: Record<string,string> = { solid, outline, ghost };
17+
const classes = `${base} ${styleMap[variant]} ${extraClass}`.trim();
318
---
419

5-
<a
6-
href={link}
7-
class="inline-flex w-auto px-4 py-2 mt-5 text-xs font-semibold duration-300 ease-out border rounded-full bg-neutral-900 dark:bg-white dark:text-neutral-900 text-neutral-100 hover:border-neutral-700 border-neutral-900 dark:hover:border-neutral-300 hover:bg-white dark:hover:bg-black dark:hover:text-white hover:text-neutral-900"
8-
>
9-
{text}
10-
</a>
20+
<a href={link} class={classes} target={target} rel={rel}>{text}</a>

src/components/header.astro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ import Logo from "../components/logo.astro";
7171
)
7272
})
7373
}
74+
<a
75+
href="/resume.pdf"
76+
target="_blank"
77+
rel="noopener"
78+
class="relative flex items-center justify-center w-full px-3 py-2 font-medium tracking-wide text-center duration-200 ease-out sm:py-0 sm:mb-0 md:w-auto hover:text-neutral-900 dark:hover:text-white"
79+
>
80+
Resume
81+
</a>
7482
</div>
7583
<div
7684
id="darkToggle"

src/components/home/writings.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const feed = (Astro.site ? new URL('/feed.xml', Astro.site).href : '/feed.xml');
2525
<PostsLoop count="3" />
2626

2727
<div class="flex items-center justify-center w-full py-5">
28-
<Button text="View All My Writing" link="/posts" />
28+
<Button text="View All My Blogs" link="/posts" />
2929
</div>
3030
</div>
3131
<div class="w-full mt-10 md:w-1/3 md:mt-0">

src/pages/about.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import AboutExperience from "../components/about-experience.astro";
66
import AboutEducation from "../components/about-education.astro";
77
import PageHeading from "../components/page-heading.astro";
88
import Layout from "../layouts/main.astro";
9+
import Button from "../components/button.astro";
910
---
1011

1112
<Layout title="About Me">
@@ -73,6 +74,10 @@ import Layout from "../layouts/main.astro";
7374
}
7475
</div>
7576

77+
<div class="mb-8">
78+
<Button link="/resume.pdf" text="View my Resume" variant="outline" target="_blank" rel="noopener" />
79+
</div>
80+
7681
<h2 class="mt-5 mb-2 text-2xl font-bold lg:mt-10 sm:mt-6 dark:text-neutral-200">Let's Connect</h2>
7782
<p
7883
class="text-sm leading-6 text-gray-600 dark:text-neutral-400 sm:leading-7 lg:leading-8 sm:text-base lg:text-lg"

src/pages/index.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ import photo from "../assets/images/about/photo.png";
3636
<li>Planning your next trip</li>
3737
<li>and more...</li>
3838
</ul>
39-
<Button text="Contact me" link="mailto:gautammehta.connect@gmail.com" />
39+
<div class="flex flex-wrap items-center gap-3">
40+
<Button text="Contact me" link="mailto:gautammehta.connect@gmail.com" />
41+
<Button text="View Resume" link="/resume.pdf" variant="outline" target="_blank" rel="noopener" />
42+
</div>
4043
</div>
4144
<div
4245
class="relative justify-end hidden w-full mt-10 md:flex md:pl-10 md:w-1/2 md:mt-0 md:translate-y-4 xl:translate-y-0"

0 commit comments

Comments
 (0)