Skip to content

Commit

Permalink
Optimize files and semantics
Browse files Browse the repository at this point in the history
(major buff)
  • Loading branch information
kubgus committed Sep 3, 2024
1 parent febb96c commit 3c076f1
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 238 deletions.
59 changes: 0 additions & 59 deletions src/components/hero.astro

This file was deleted.

61 changes: 0 additions & 61 deletions src/components/picker.astro

This file was deleted.

14 changes: 0 additions & 14 deletions src/components/portrait-container.astro

This file was deleted.

2 changes: 1 addition & 1 deletion src/data/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default [
github: "https://github.com/kubgus/stratus-cli",
},
{
title: "untitled-game-engine",
title: "untitled game engine",
description: "SDL2 game engine made with C++.",
github: "https://github.com/kubgus/untitled-game-engine",
},
Expand Down
16 changes: 7 additions & 9 deletions src/layouts/blog-navbar.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import FixedNavbarLayout from "./fixed-navbar.astro";
import NavbarLayout from "./navbar.astro";
import "../styles/default-padding.css";
import "../styles/article.css";
Expand All @@ -10,20 +10,18 @@ const title = `${frontmatter.title} | ${frontmatter.author}` || "Jakub Gustafik"
const dateString = new Date(frontmatter.date).toLocaleString("en-US", { month: "long", day: "numeric", year: "numeric" });
---

<FixedNavbarLayout title={title}>
<main>
<section class="article-header">
<NavbarLayout title={title} meta={[]} fixed={true}>
<header>
<h1>{frontmatter.title}</h1>
<p id="article-description">{frontmatter.description}</p>
<div id="article-info" class="faded">
<p>{dateString}</p>
<p>|</p>
<p>{frontmatter.author}</p>
</div>
</section>
</header>
<slot />
</main>
</FixedNavbarLayout>
</NavbarLayout>

<style>
main {
Expand All @@ -42,13 +40,13 @@ const dateString = new Date(frontmatter.date).toLocaleString("en-US", { month: "
}
}

.article-header {
header {
border-bottom: 1px solid var(--secondary-background-dark);

padding-bottom: 2.5rem;
}

.article-header h1 {
header h1 {
font-size: 3rem;
font-weight: 600;
}
Expand Down
10 changes: 5 additions & 5 deletions src/layouts/core.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const { title, meta } = Astro.props || {
--complementary-accent-dark-3: #54bc70
}

* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

::selection {
background-color: var(--primary-accent-dark);
Expand Down
12 changes: 0 additions & 12 deletions src/layouts/fixed-navbar.astro

This file was deleted.

37 changes: 27 additions & 10 deletions src/layouts/navbar.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import CoreLayout from "../layouts/core.astro";
import ContactBar from "../components/contact-bar.astro";
const { title, meta } = Astro.props || {
Expand All @@ -10,6 +11,32 @@ const { title, meta } = Astro.props || {
const { fixed } = Astro.props;
---

<CoreLayout title={title} meta={meta}>
<header class={fixed ? "scrolled" : ""}>
<figure><a href="/" class="implied">Jakub Gustafik</a></figure>
<ContactBar />
</header>

<slot />
</CoreLayout>

<script define:vars={{ fixed }} is:inline>
if (!fixed) {
const header = document.querySelector("header");

const updateHeader = () => {
if (window.scrollY > 200) {
header?.classList.add("scrolled");
} else {
header?.classList.remove("scrolled");
}
}

updateHeader();
document.addEventListener("scroll", updateHeader);
}
</script>

<style>
header {
position: fixed;
Expand Down Expand Up @@ -62,13 +89,3 @@ const { fixed } = Astro.props;
font-size: 1rem;
}
</style>

<CoreLayout title={title} meta={meta}>
<header class={fixed ? "scrolled" : ""}>
<figure><a href="/" class="implied">Jakub Gustafik</a></figure>
<nav>
<ContactBar />
</nav>
</header>
<slot />
</CoreLayout>
27 changes: 0 additions & 27 deletions src/layouts/retracting-navbar.astro

This file was deleted.

Loading

0 comments on commit 3c076f1

Please sign in to comment.