Skip to content

Commit

Permalink
prettier update
Browse files Browse the repository at this point in the history
  • Loading branch information
a2937 committed Jan 12, 2025
1 parent 66666e3 commit 45e4af1
Show file tree
Hide file tree
Showing 26 changed files with 157 additions and 122 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [ main ]
branches: [main]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

Expand All @@ -24,8 +24,8 @@ jobs:
uses: withastro/action@v3
with:
# path: . # The root location of your Astro project inside the repository. (optional)
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

deploy:
needs: build
Expand All @@ -36,4 +36,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# A2937's Activity log

Live at https://a2937.github.io/activity-log
Live at https://a2937.github.io/activity-log
2 changes: 1 addition & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import preact from "@astrojs/preact";

// https://astro.build/config
export default defineConfig({
site: 'https://a2937.github.io',
site: "https://a2937.github.io",
base: "/activity-log",
trailingSlash: "always",
integrations: [preact()],
Expand Down
15 changes: 7 additions & 8 deletions content/config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { defineCollection, z } from 'astro:content';
import { defineCollection, z } from "astro:content";

const personalCollection = defineCollection({
schema: z.object({
title: z.string(),
})
schema: z.object({
title: z.string(),
}),
});

const fccCollection = defineCollection({
schema: z.object({
title: z.string(),
})
}),
});


export const collections = {
'personal': personalCollection,
'fcc': fccCollection
personal: personalCollection,
fcc: fccCollection,
};
10 changes: 4 additions & 6 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
---
import Social from "./Social.astro"
import Social from "./Social.astro";
---

<style>
footer
{
footer {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
}
</style>

<footer>
<Social platform="github" username="a2937" />
</footer>


4 changes: 3 additions & 1 deletion src/components/Hamburger.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
---

<div class="hamburger">
<span class="line"></span>
<span class="line"></span>
<span class="line"></span>
</div>
</div>
9 changes: 5 additions & 4 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
import Navigation from "./Navigation.astro";
import Hamburger from "./Hamburger.astro";
import ThemeIcon from './ThemeIcon.astro';
import ThemeIcon from "./ThemeIcon.astro";
---

<header>
<nav>
<Navigation/>
<Navigation />
<ThemeIcon />
<Hamburger/>
<Hamburger />
</nav>
</header>
</header>
4 changes: 2 additions & 2 deletions src/components/MarkdownPost.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
const {title,url} = Astro.props;
const { title, url } = Astro.props;
---

<li><a href={url}>{title}</a></li>
<li><a href={url}>{title}</a></li>
2 changes: 2 additions & 0 deletions src/components/Navigation.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
---

<div class="nav-links">
<a href="/activity-log/">Home</a>
<a href="/activity-log/about/">About</a>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Social.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
const { platform, username } = Astro.props;
---

<a href={`https://www.${platform}.com/${username}`}>{platform}</a>

<style>
Expand All @@ -10,4 +11,4 @@ const { platform, username } = Astro.props;
background-color: #4c1d95;
text-decoration: none;
}
</style>
</style>
56 changes: 38 additions & 18 deletions src/components/ThemeIcon.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
---
---

<button id="themeToggle">
<svg width="30px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path class="sun" fill-rule="evenodd" d="M12 17.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zm0 1.5a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm12-7a.8.8 0 0 1-.8.8h-2.4a.8.8 0 0 1 0-1.6h2.4a.8.8 0 0 1 .8.8zM4 12a.8.8 0 0 1-.8.8H.8a.8.8 0 0 1 0-1.6h2.5a.8.8 0 0 1 .8.8zm16.5-8.5a.8.8 0 0 1 0 1l-1.8 1.8a.8.8 0 0 1-1-1l1.7-1.8a.8.8 0 0 1 1 0zM6.3 17.7a.8.8 0 0 1 0 1l-1.7 1.8a.8.8 0 1 1-1-1l1.7-1.8a.8.8 0 0 1 1 0zM12 0a.8.8 0 0 1 .8.8v2.5a.8.8 0 0 1-1.6 0V.8A.8.8 0 0 1 12 0zm0 20a.8.8 0 0 1 .8.8v2.4a.8.8 0 0 1-1.6 0v-2.4a.8.8 0 0 1 .8-.8zM3.5 3.5a.8.8 0 0 1 1 0l1.8 1.8a.8.8 0 1 1-1 1L3.5 4.6a.8.8 0 0 1 0-1zm14.2 14.2a.8.8 0 0 1 1 0l1.8 1.7a.8.8 0 0 1-1 1l-1.8-1.7a.8.8 0 0 1 0-1z"/>
<path class="moon" fill-rule="evenodd" d="M16.5 6A10.5 10.5 0 0 1 4.7 16.4 8.5 8.5 0 1 0 16.4 4.7l.1 1.3zm-1.7-2a9 9 0 0 1 .2 2 9 9 0 0 1-11 8.8 9.4 9.4 0 0 1-.8-.3c-.4 0-.8.3-.7.7a10 10 0 0 0 .3.8 10 10 0 0 0 9.2 6 10 10 0 0 0 4-19.2 9.7 9.7 0 0 0-.9-.3c-.3-.1-.7.3-.6.7a9 9 0 0 1 .3.8z"/>
<path
class="sun"
fill-rule="evenodd"
d="M12 17.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zm0 1.5a7 7 0 1 0 0-14 7 7 0 0 0 0 14zm12-7a.8.8 0 0 1-.8.8h-2.4a.8.8 0 0 1 0-1.6h2.4a.8.8 0 0 1 .8.8zM4 12a.8.8 0 0 1-.8.8H.8a.8.8 0 0 1 0-1.6h2.5a.8.8 0 0 1 .8.8zm16.5-8.5a.8.8 0 0 1 0 1l-1.8 1.8a.8.8 0 0 1-1-1l1.7-1.8a.8.8 0 0 1 1 0zM6.3 17.7a.8.8 0 0 1 0 1l-1.7 1.8a.8.8 0 1 1-1-1l1.7-1.8a.8.8 0 0 1 1 0zM12 0a.8.8 0 0 1 .8.8v2.5a.8.8 0 0 1-1.6 0V.8A.8.8 0 0 1 12 0zm0 20a.8.8 0 0 1 .8.8v2.4a.8.8 0 0 1-1.6 0v-2.4a.8.8 0 0 1 .8-.8zM3.5 3.5a.8.8 0 0 1 1 0l1.8 1.8a.8.8 0 1 1-1 1L3.5 4.6a.8.8 0 0 1 0-1zm14.2 14.2a.8.8 0 0 1 1 0l1.8 1.7a.8.8 0 0 1-1 1l-1.8-1.7a.8.8 0 0 1 0-1z"
></path>
<path
class="moon"
fill-rule="evenodd"
d="M16.5 6A10.5 10.5 0 0 1 4.7 16.4 8.5 8.5 0 1 0 16.4 4.7l.1 1.3zm-1.7-2a9 9 0 0 1 .2 2 9 9 0 0 1-11 8.8 9.4 9.4 0 0 1-.8-.3c-.4 0-.8.3-.7.7a10 10 0 0 0 .3.8 10 10 0 0 0 9.2 6 10 10 0 0 0 4-19.2 9.7 9.7 0 0 0-.9-.3c-.3-.1-.7.3-.6.7a9 9 0 0 1 .3.8z"
></path>
</svg>
</button>

Expand All @@ -12,39 +22,49 @@
border: 0;
background: none;
}
.sun { fill: black; }
.moon { fill: transparent; }
.sun {
fill: black;
}
.moon {
fill: transparent;
}

:global(.dark) .sun { fill: transparent; }
:global(.dark) .moon { fill: white; }
:global(.dark) .sun {
fill: transparent;
}
:global(.dark) .moon {
fill: white;
}
</style>

<script is:inline>
const theme = (() => {
if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
return localStorage.getItem('theme') ?? "light";
if (typeof localStorage !== "undefined" && localStorage.getItem("theme")) {
return localStorage.getItem("theme") ?? "light";
}
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
return "dark";
}
return 'light';
return "light";
})();

if (theme === 'light') {
document.documentElement.classList.remove('dark');
if (theme === "light") {
document.documentElement.classList.remove("dark");
} else {
document.documentElement.classList.add('dark');
document.documentElement.classList.add("dark");
}

window.localStorage.setItem('theme', theme);
window.localStorage.setItem("theme", theme);

const handleToggleClick = () => {
const element = document.documentElement;
element.classList.toggle("dark");

const isDark = element.classList.contains("dark");
localStorage.setItem("theme", isDark ? "dark" : "light");
}
};

document.getElementById("themeToggle")?.addEventListener("click", handleToggleClick);
</script>
document
.getElementById("themeToggle")
?.addEventListener("click", handleToggleClick);
</script>
26 changes: 13 additions & 13 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
import '../styles/global.css';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import "../styles/global.css";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
const { pageTitle } = Astro.props;
---

<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{pageTitle}</title>
</head>
<body>
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{pageTitle}</title>
</head>
<body>
<Header />
<h1>{pageTitle}</h1>
<h1>{pageTitle}</h1>
<slot />
<Footer />
<script>
import "../scripts/menu.js";
</script>
</body>
</body>
</html>
5 changes: 3 additions & 2 deletions src/layouts/MarkdownPostLayout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import BaseLayout from './BaseLayout.astro';
import BaseLayout from "./BaseLayout.astro";
const { frontmatter } = Astro.props;
---

<BaseLayout pageTitle={frontmatter.title}>
<slot />
<slot />
</BaseLayout>
4 changes: 2 additions & 2 deletions src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
const pageTitle = "About";
import BaseLayout from '../layouts/BaseLayout.astro';
import BaseLayout from "../layouts/BaseLayout.astro";
---

<BaseLayout pageTitle={pageTitle}>
<h2>And what do I hope to accomplish with this?</h2>
<p>This is where my about section will be.</p>
</BaseLayout>
</BaseLayout>
14 changes: 9 additions & 5 deletions src/pages/fcc.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---
import MarkdownPost from '../components/MarkdownPost.astro';
import BaseLayout from '../layouts/BaseLayout.astro'
const allPosts = Object.values(import.meta.glob('./fcc/*.md', { eager: true }));
import MarkdownPost from "../components/MarkdownPost.astro";
import BaseLayout from "../layouts/BaseLayout.astro";
const allPosts = Object.values(import.meta.glob("./fcc/*.md", { eager: true }));
const pageTitle = "FreeCodeCamp Activity Log";
---

<BaseLayout pageTitle={pageTitle}>
<p>This is what I've worked on for FreeCodeCamp.</p>
<ul>
{allPosts.map((post: any) => <MarkdownPost url={post.url} title={post.frontmatter.title}/>)}
{
allPosts.map((post: any) => (
<MarkdownPost url={post.url} title={post.frontmatter.title} />
))
}
</ul>
</BaseLayout>
</BaseLayout>
11 changes: 5 additions & 6 deletions src/pages/fcc/01-04-2025.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ layout: ../../layouts/MarkdownPostLayout.astro
title: Week of January 4th 2024
---

## FreeCodeCamp work
## FreeCodeCamp work

- Updated answers for the CSS Colors Quiz
- Updated answers for the CSS Colors Quiz

- Reviewed PR to update the working with media lecture
- Reviewed PR to update the working with media lecture

- Reviewed PR to update tests in event-hub lab

- Reviewed PR to update forms lecture wording
- Reviewed PR to update tests in event-hub lab

- Reviewed PR to update forms lecture wording
15 changes: 7 additions & 8 deletions src/pages/fcc/01-11-2025.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ layout: ../../layouts/MarkdownPostLayout.astro
title: Week of January 11th 2024
---

## FreeCodeCamp work
## FreeCodeCamp work

- Enabled JSON syntax highlighting in the description in the Curriculum

- Enabled JSON syntax highlighting in the description in the Curriculum
- Enable JSON syntax highlighting for the UI library

- Enable JSON syntax highlighting for the UI library

- Removed unused CSS rule from client
- Removed unused CSS rule from client

- Removed counter-productive hint from accessibility quiz project (both legacy and modern versions)

- Added a link to the development version of the challenge from the challenge editor

- Explored the templates to add seed verification
- Explored the templates to add seed verification

## Goals
## Goals

- Determine if the seed verification works
- Determine if the seed verification works
Loading

0 comments on commit 45e4af1

Please sign in to comment.