Skip to content

Commit

Permalink
chore: fmt (╯°□°)╯︵ ┻━┻
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Jan 12, 2024
1 parent 662b05f commit 650a4cf
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 77 deletions.
20 changes: 9 additions & 11 deletions src/components/CodeExample.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ interface Props {
code: string;
}
const {
filename,
lang,
code,
} = Astro.props;
const { filename, lang, code } = Astro.props;
---

<div class="code-example">
<div class="code-example-header">
<strong>{filename}</strong>
{Astro.slots.has("actions") && (
<div class="code-example-actions">
<slot name="actions" />
</div>
)}
{
Astro.slots.has("actions") && (
<div class="code-example-actions">
<slot name="actions" />
</div>
)
}
</div>
<!-- @ts-ignore -->
<Code {lang} {code}></Code>
<Code {lang} {code} />
</div>

<style>
Expand Down
28 changes: 19 additions & 9 deletions src/components/Navigation.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,25 @@ const { title = "" } = Astro.props;
}
<details class="mobile-navigation">
<summary class="mobile-navigation-button">
<svg class="navigation-menu-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<rect x="4" y="6" width="24" height="2" />
<rect x="4" y="24" width="24" height="2" />
<rect x="4" y="12" width="24" height="2" />
<rect x="4" y="18" width="24"height="2" />
</svg>
<svg class="navigation-close-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<polygon points="17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16" />
</svg>
<svg
class="navigation-menu-icon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32"
>
<rect x="4" y="6" width="24" height="2"></rect>
<rect x="4" y="24" width="24" height="2"></rect>
<rect x="4" y="12" width="24" height="2"></rect>
<rect x="4" y="18" width="24" height="2"></rect>
</svg>
<svg
class="navigation-close-icon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32"
>
<polygon
points="17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16"
></polygon>
</svg>
</summary>
<ul class="mobile-navigation-items">
<slot />
Expand Down
8 changes: 4 additions & 4 deletions src/components/NavigationItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const { selected } = Astro.props;
---

<li class={`navigation-item-wrapper ${selected ? "selected" : ""}`}>
<a class="navigation-item" {...Astro.props}>
<slot />
</a>
<a class="navigation-item" {...Astro.props}>
<slot />
</a>
</li>

<style>
Expand Down Expand Up @@ -53,4 +53,4 @@ const { selected } = Astro.props;
.mobile-navigation-items .navigation-item:active {
background-color: var(--interactive-primary);
}
</style>
</style>
8 changes: 2 additions & 6 deletions src/components/PageSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ interface Props {
[key: string]: any;
}
const {
element: Element = "section",
class: className,
...rest
} = Astro.props;
const { element: Element = "section", class: className, ...rest } = Astro.props;
---

<Element class:list={["page-section", { className }]} {...rest}>
<div class="page-section-inner">
<slot />
</div>

<slot name="outer" />
</Element>

Expand Down
100 changes: 66 additions & 34 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
import Navigation from '~/components/Navigation.astro';
import NavigationItem from '~/components/NavigationItem.astro';
import Navigation from "~/components/Navigation.astro";
import NavigationItem from "~/components/NavigationItem.astro";
import Button from '~/components/Button.svelte';
import { GITHUB_REPO_URL, DISCORD_INVITE_URL } from '~/constants';
import Button from "~/components/Button.svelte";
import { GITHUB_REPO_URL, DISCORD_INVITE_URL } from "~/constants";
interface Props {
name?: string;
Expand All @@ -13,10 +13,10 @@ interface Props {
}
const {
name = "pros-rs",
title = "pros-rs",
name = "pros-rs",
title = "pros-rs",
type = "website",
description = "Open-source Rust tooling for VEX robots."
description = "Open-source Rust tooling for VEX robots.",
} = Astro.props;
---

Expand All @@ -29,25 +29,44 @@ const {

<!-- SEO Stuff -->
<link rel="canonical" href={Astro.url} />
<link rel="sitemap" href="/sitemap-index.xml" />
<link rel="sitemap" href="/sitemap-index.xml" />
<meta name="generator" content={Astro.generator} />

<!-- Favicon & Page Theme -->
<link rel="icon" type="image/svg+xml" href="/images/logo.svg" />
<meta name="color-scheme" content="dark" />
<meta name="theme-color" content="#e54643" />
<meta name="color-scheme" content="dark" />
<meta name="theme-color" content="#e54643" />

<!-- Preload Fonts -->
<link rel="preload" href="/fonts/Manrope-VariableFont_wght.woff2" as="font" crossorigin="anonymous">
<link rel="preload" href="/fonts/iosevka-fixed_latin-ext.woff2" as="font" crossorigin="anonymous">
<link rel="preload" href="/fonts/iosevka-fixed-extralight_latin-ext.woff2" as="font" crossorigin="anonymous">

<link
rel="preload"
href="/fonts/Manrope-VariableFont_wght.woff2"
as="font"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/fonts/iosevka-fixed_latin-ext.woff2"
as="font"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/fonts/iosevka-fixed-extralight_latin-ext.woff2"
as="font"
crossorigin="anonymous"
/>

<!-- OpenGraph Page Metadata -->
<meta property="og:site_name" content={name} />
<meta property="og:title" content={title} />
<meta property="og:type" content="website" />
<meta property="og:url" content={Astro.url} />
<meta property="og:description" name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:type" content="website" />
<meta property="og:url" content={Astro.url} />
<meta
property="og:description"
name="description"
content={description}
/>
<!-- <meta property="og:image" content={image} />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
Expand All @@ -72,8 +91,20 @@ const {
<NavigationItem href="#">Simulator</NavigationItem>
<NavigationItem href="/blog">Blog</NavigationItem>
<Fragment slot="actions">
<Button href={DISCORD_INVITE_URL} target="_blank" rel="noreferrer noopener">Discord</Button>
<Button href={GITHUB_REPO_URL} target="_blank" rel="noreferrer noopener">GitHub</Button>
<Button
href={DISCORD_INVITE_URL}
target="_blank"
rel="noreferrer noopener"
>
Discord
</Button>
<Button
href={GITHUB_REPO_URL}
target="_blank"
rel="noreferrer noopener"
>
GitHub
</Button>
</Fragment>
</Navigation>
<slot />
Expand All @@ -85,7 +116,8 @@ const {
font-family: "Iosevka";
font-style: ultralight;
font-weight: 200;
src: url("/fonts/iosevka-fixed-extralight_latin-ext.woff2") format("woff2");
src: url("/fonts/iosevka-fixed-extralight_latin-ext.woff2")
format("woff2");
unicode-range: U+0000-00FF;
}

Expand Down Expand Up @@ -128,7 +160,7 @@ const {
--font-primary: "Manrope", system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", Arial, sans-serif;

--breakpoint-large: 1280px;
--breakpoint-medium: 1024px;
--breakpoint-small: 768px;
Expand Down Expand Up @@ -173,16 +205,16 @@ const {
font-family: var(--font-monospace);
}

.skip-to-content {
transition: none;
z-index: 9999;
position: fixed;
inset-inline-start: 0;
inset-block-start: 0;
transform: translateY(-100%);
}

.skip-to-content:focus-visible {
transform: none;
}
.skip-to-content {
transition: none;
z-index: 9999;
position: fixed;
inset-inline-start: 0;
inset-block-start: 0;
transform: translateY(-100%);
}

.skip-to-content:focus-visible {
transform: none;
}
</style>
2 changes: 1 addition & 1 deletion src/pages/blog/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const blogPosts = await Astro.glob("./posts/**.md");

<BaseLayout>
{JSON.stringify(blogPosts)}
</BaseLayout>
</BaseLayout>
54 changes: 42 additions & 12 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import BlogCard from "~/components/BlogCard.astro";
import Button from "~/components/Button.svelte";
import CircuitsPattern from "~/components/CircuitsPattern.svelte";
const latestBlogPost = (await Astro.glob("./blog/posts/**.md"))
.sort((a, b) => (
new Date(b.frontmatter.date).getTime() - new Date(a.frontmatter.date).getTime()
))[0];
const latestBlogPost = (await Astro.glob("./blog/posts/**.md")).sort(
(a, b) =>
new Date(b.frontmatter.date).getTime() -
new Date(a.frontmatter.date).getTime(),
)[0];
---

<BaseLayout>
Expand All @@ -24,7 +25,16 @@ const latestBlogPost = (await Astro.glob("./blog/posts/**.md"))
Open-source Rust tooling for VEX robots.
</h1>
<p class="subtext">
pros-rs provides opinionated bindings to the <a href="https://pros.cs.purdue.edu/" target="_blank" rel="noreferrer noopener">PROS kernel</a> and tooling for programming VEX V5 robots using the <a href="https://rust-lang.com/" target="_blank" rel="noreferrer noopener">Rust Programming Language</a>. 🦀
pros-rs provides opinionated bindings to the <a
href="https://pros.cs.purdue.edu/"
target="_blank"
rel="noreferrer noopener">PROS kernel</a
> and tooling for programming VEX V5 robots using the <a
href="https://rust-lang.com/"
target="_blank"
rel="noreferrer noopener"
>Rust Programming Language</a
>. 🦀
</p>
</div>
<div class="hero-buttons">
Expand All @@ -35,8 +45,16 @@ const latestBlogPost = (await Astro.glob("./blog/posts/**.md"))
target="_blank"
>
API Documentation
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 32 32">
<path fill="currentColor" d="M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6z" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 32 32"
>
<path
fill="currentColor"
d="M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6z"
></path>
</svg>
</Button>
<Button
Expand All @@ -46,14 +64,26 @@ const latestBlogPost = (await Astro.glob("./blog/posts/**.md"))
target="_blank"
>
GitHub
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 32 32">
<path fill="currentColor" d="M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6z" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 32 32"
>
<path
fill="currentColor"
d="M10 6v2h12.59L6 24.59L7.41 26L24 9.41V22h2V6z"
></path>
</svg>
</Button>
</div>
</div>
<div class="hero-right">
<CodeExample lang="rust" filename="main.rs" code={EXAMPLES[0].code} />
<CodeExample
lang="rust"
filename="main.rs"
code={EXAMPLES[0].code}
/>
<BlogCard
url={latestBlogPost.url ?? "#"}
title={latestBlogPost.frontmatter.title}
Expand Down Expand Up @@ -162,7 +192,7 @@ const latestBlogPost = (await Astro.glob("./blog/posts/**.md"))
}

@media only screen and (max-width: 1024px) {
:global(#hero > .page-section-inner) {
:global(#hero > .page-section-inner) {
padding-block: 48px;
flex-direction: column;
max-height: unset;
Expand All @@ -173,4 +203,4 @@ const latestBlogPost = (await Astro.glob("./blog/posts/**.md"))
font-size: 6.4rem;
}
}
</style>
</style>

0 comments on commit 650a4cf

Please sign in to comment.