first commit

This commit is contained in:
Troy 2024-12-23 21:18:55 +00:00
commit ff7c974867
Signed by: troy
GPG key ID: DFC06C02ED3B4711
227 changed files with 12908 additions and 0 deletions

40
src/pages/404.astro Normal file
View file

@ -0,0 +1,40 @@
---
import Layout from "@layouts/Layout.astro";
import { SITE } from "@consts";
import { Icon } from "astro-icon/components";
---
<Layout title="404" description={SITE.DESCRIPTION}>
<section class="mb-32" id="postHero" aria-labelledby="featured-projects">
<div
class="flex flex-col items-start justify-between gap-6 md:flex-row md:items-center"
>
<div>
<h2
class="animate-reveal break-words text-4xl font-medium opacity-0"
id="featured-projects"
>
404
</h2>
<h3
class="mt-2 animate-reveal text-xl font-bold opacity-0 [animation-delay:0.3s]"
>
Content not found
</h3>
</div>
<div class="animate-reveal opacity-0 [animation-delay:0.6s]">
<a
href="/"
class="flex items-center gap-1 rounded bg-secondary px-3.5 py-2.5 text-sm font-semibold text-primary"
>
<p>Go back home</p>
<Icon
name="mdi:arrow-u-left-top"
title="Send me an email"
class="h-4 w-auto"
/>
</a>
</div>
</div>
</section>
</Layout>

85
src/pages/cv.astro Normal file
View file

@ -0,0 +1,85 @@
---
import Layout from "@layouts/Layout.astro";
import { CV } from "@consts";
import Work from "@components/Work.astro";
import Education from "@components/Education.astro";
import Skills from "@components/Skills.astro";
import { Icon } from "astro-icon/components";
import Link from "@components/Link.astro";
import Prose from "@components/Prose.astro";
---
<Layout title={CV.TITLE} description={CV.DESCRIPTION}>
<section>
<div
class="flex flex-col items-start justify-between gap-6 md:flex-row md:items-center"
>
<h1 class="animate-reveal break-words text-4xl font-medium opacity-0">
Troy Lusty
</h1>
<div
class="mt-4 flex flex-col items-start gap-2 text-lg text-tertiary md:flex-row"
>
<div
class="flex animate-reveal items-center gap-2 opacity-0 [animation-delay:0.3s]"
>
<Icon name="mdi:email" />
<Link href="mailto:hello@troylusty.com">
<p>hello@troylusty.com</p>
</Link>
<Icon name="mdi:web" />
<Link href="/">
<p>troylusty.com</p>
</Link>
</div>
</div>
</div>
</section>
<section class="mt-16 animate-reveal opacity-0 [animation-delay:0.4s]">
<Prose>
<h2>About me</h2>
<p>
Hi, my name is Troy and Im a student 3D artist studying on a BA (Hons)
Game Arts and Design course in the UK.
</p>
<p>
In 2019 I began experimenting with Blender after having used various 2D
art applications such as Adobe Photoshop for over 5 years. After making
this change, I realised that I have a huge interest in creating 3D
graphics for video games and TV. At the moment I am working on expanding
my skillset to encompass other areas with a focus on lighting and
rendering techniques in relation to environment art.
</p>
<p>
My current portfolio of work can be found on my website at:
<a href="/projects">troylusty.com/projects</a>.
</p>
</Prose>
</section>
<section class="mt-16 animate-reveal opacity-0 [animation-delay:0.5s]">
<Prose>
<h2>Education</h2>
<Education />
</Prose>
</section>
<section class="mt-16 animate-reveal opacity-0 [animation-delay:0.6s]">
<Prose>
<h2>Skills</h2>
<p>
My specific chosen area of focus is design, lighting, and rendering
focusing on 3D environments within software such as Blender and Unreal
Engine. Using either real-time or offline rendering techniques. In
addition to this, I am also very interested in web development.
</p>
<p>Please note, this skills section is a only placeholder.</p>
<Skills />
<ul><li>Full drivers licence for cars and motorbikes</li></ul>
</Prose>
</section>
<section class="mt-16 animate-reveal opacity-0 [animation-delay:0.7s]">
<Prose>
<h2>Experience</h2>
<Work />
</Prose>
</section>
</Layout>

74
src/pages/index.astro Normal file
View file

@ -0,0 +1,74 @@
---
import Layout from "@layouts/Layout.astro";
import { HOME } from "@consts";
import { getCollection } from "astro:content";
import { Icon } from "astro-icon/components";
import Showcase from "@components/Showcase.astro";
const posts = (await getCollection("posts"))
.filter((post) => !post.data.draft)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
.slice(0, HOME.HOMESETTINGS?.NUM_POSTS_ON_HOMEPAGE);
const projects = (await getCollection("projects"))
.filter((project) => !project.data.draft && project.data.featured)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
.slice(0, HOME.HOMESETTINGS?.NUM_PROJECTS_ON_HOMEPAGE);
---
<Layout title={HOME.TITLE} description={HOME.DESCRIPTION}>
<section class="mb-32" id="postHero" aria-labelledby="featured-projects">
<div class="flex flex-row items-center justify-between gap-6">
<a href="/projects">
<h2
class="animate-reveal break-words text-4xl font-medium opacity-0"
id="featured-projects"
>
Featured projects
</h2>
</a>
<a
href="/projects"
class="animate-reveal rounded-full bg-secondary p-1 opacity-0 transition-all ease-in-out [animation-delay:0.3s] hover:scale-90 hover:bg-tertiary"
>
<Icon
name="mdi:arrow-right"
title="All projects"
class="h-4 w-auto text-primary"
/>
</a>
</div>
<div
class="mt-16 grid animate-reveal grid-cols-1 gap-6 opacity-0 [animation-delay:0.4s] md:grid-cols-3 md:[&>*:nth-child(4n+2)]:col-span-2 md:[&>*:nth-child(4n+3)]:col-span-2 md:[&>*:only-child]:col-span-3"
>
{projects.map((project) => <Showcase collection={project} />)}
</div>
</section>
<section aria-labelledby="recent-posts">
<div class="flex flex-row items-center justify-between gap-6">
<a href="/posts">
<h2
class="animate-reveal break-words text-4xl font-medium opacity-0 [animation-delay:0.5s]"
id="recent-posts"
>
Recent posts
</h2>
</a>
<a
href="/posts"
class="animate-reveal rounded-full bg-secondary p-1 opacity-0 transition-all ease-in-out [animation-delay:0.8s] hover:scale-90 hover:bg-tertiary"
>
<Icon
name="mdi:arrow-right"
title="All posts"
class="h-4 w-auto text-primary"
/>
</a>
</div>
<div
class="mt-16 grid animate-reveal grid-cols-1 gap-6 opacity-0 [animation-delay:0.9s] md:grid-cols-3 md:[&>*:nth-child(4n+2)]:col-span-2 md:[&>*:nth-child(4n+3)]:col-span-2 md:[&>*:only-child]:col-span-3"
>
{posts.map((post) => <Showcase collection={post} />)}
</div>
</section>
</Layout>

View file

@ -0,0 +1,19 @@
---
import { type CollectionEntry, getCollection } from "astro:content";
import Article from "@components/Article.astro";
export async function getStaticPaths() {
const posts = (await getCollection("posts"))
.filter((post) => !post.data.draft)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
return posts.map((post) => ({
params: { slug: post.slug },
props: post,
}));
}
type Props = CollectionEntry<"posts">;
const post = Astro.props;
---
<Article article={post} isPost={true} />

View file

@ -0,0 +1,11 @@
---
import { getCollection } from "astro:content";
import { POSTS } from "@consts";
import ShowcasePage from "@components/ShowcasePage.astro";
const posts = (await getCollection("posts"))
.filter((post) => !post.data.draft)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
---
<ShowcasePage content={posts} CONSTS={POSTS} />

View file

@ -0,0 +1,19 @@
---
import { type CollectionEntry, getCollection } from "astro:content";
import Article from "@components/Article.astro";
export async function getStaticPaths() {
const projects = (await getCollection("projects"))
.filter((project) => !project.data.draft)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
return projects.map((project) => ({
params: { slug: project.slug },
props: project,
}));
}
type Props = CollectionEntry<"projects">;
const project = Astro.props;
---
<Article article={project} />

View file

@ -0,0 +1,11 @@
---
import { getCollection } from "astro:content";
import { PROJECTS } from "@consts";
import ShowcasePage from "@components/ShowcasePage.astro";
const projects = (await getCollection("projects"))
.filter((project) => !project.data.draft)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
---
<ShowcasePage content={projects} CONSTS={PROJECTS} />

15
src/pages/robots.txt.ts Normal file
View file

@ -0,0 +1,15 @@
import type { APIRoute } from "astro";
const getRobotsTxt = (sitemapURL: URL) => `
User-agent: *
Disallow: /cv
Disallow: /privacy
Allow: /
Sitemap: ${sitemapURL.href}
`;
export const GET: APIRoute = ({ site }) => {
const sitemapURL = new URL("sitemap-index.xml", site);
return new Response(getRobotsTxt(sitemapURL));
};

29
src/pages/rss.xml.ts Normal file
View file

@ -0,0 +1,29 @@
import rss from "@astrojs/rss";
import { SITE } from "@consts";
import { getCollection } from "astro:content";
export async function GET(context: { site: string }) {
const posts = (await getCollection("posts")).filter(
(post) => !post.data.draft,
);
const projects = (await getCollection("projects")).filter(
(project) => !project.data.draft,
);
const items = [...posts, ...projects].sort(
(a, b) => new Date(b.data.date).valueOf() - new Date(a.data.date).valueOf(),
);
return rss({
title: SITE.TITLE,
description: SITE.DESCRIPTION,
site: context.site,
items: items.map((item) => ({
title: item.data.title,
description: item.data.description,
pubDate: item.data.date,
link: `/${item.collection}/${item.slug}/`,
})),
});
}