From c1b2794611548ef1fa30055a91926c4074f2f63e Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 8 Feb 2024 21:41:36 -0500 Subject: [PATCH] Fixed overflow for mobile, loading in gh projects --- .frontmatter/database/mediaDb.json | 1 + .frontmatter/database/pinnedItemsDb.json | 1 + .frontmatter/database/taxonomyDb.json | 1 + .vscode/settings.json | 46 ++++++++----------- frontmatter.json | 46 +++++++++++++++++++ src/components/GitHubProjects.jsx | 42 +++++++++-------- src/data/projects.json | 2 +- src/layouts/Default.astro | 2 +- .../downloads/osft-software-archive.astro | 6 ++- 9 files changed, 100 insertions(+), 47 deletions(-) create mode 100644 .frontmatter/database/mediaDb.json create mode 100644 .frontmatter/database/pinnedItemsDb.json create mode 100644 .frontmatter/database/taxonomyDb.json create mode 100644 frontmatter.json diff --git a/.frontmatter/database/mediaDb.json b/.frontmatter/database/mediaDb.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.frontmatter/database/mediaDb.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.frontmatter/database/pinnedItemsDb.json b/.frontmatter/database/pinnedItemsDb.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.frontmatter/database/pinnedItemsDb.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.frontmatter/database/taxonomyDb.json b/.frontmatter/database/taxonomyDb.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.frontmatter/database/taxonomyDb.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 177e7da..8dfdb2d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,30 +1,24 @@ { - "frontMatter.taxonomy.contentTypes": [ + "[markdown]": { + "editor.fontSize": 14, + "editor.lineHeight": 26, + "editor.wordWrap": "wordWrapColumn", + "editor.wordWrapColumn": 64, + "editor.lineNumbers": "off", + "editor.quickSuggestions": false, + "editor.minimap.enabled": false + }, + "frontMatter.content.publicFolder": "public", + "frontMatter.content.pageFolders": [ { - "name": "default", - "pageBundle": false, - "fields": [ - { - "title": "title", - "name": "title", - "type": "string" - }, - { - "title": "description", - "name": "description", - "type": "string" - }, - { - "title": "pubDate", - "name": "pubDate", - "type": "datetime" - }, - { - "title": "tags", - "name": "tags", - "type": "tags" - } - ] + "title": "blog", + "path": "[[workspace]]/src/content/blog" + }, + { + "title": "pages", + "path": "[[workspace]]/src/pages" } - ] + ], + "frontMatter.framework.id": "astro", + "frontMatter.preview.host": "http://localhost:4321" } \ No newline at end of file diff --git a/frontmatter.json b/frontmatter.json new file mode 100644 index 0000000..d8b2f42 --- /dev/null +++ b/frontmatter.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://frontmatter.codes/frontmatter.schema.json", + "frontMatter.framework.id": "astro", + "frontMatter.preview.host": "http://localhost:4321", + "frontMatter.content.publicFolder": "public", + "frontMatter.content.pageFolders": [ + { + "title": "blog", + "path": "[[workspace]]/src/content/blog" + } + ], + "frontMatter.taxonomy.contentTypes": [ + { + "name": "blog", + "previewPath": "'blog'", + "pageBundle": false, + "clearEmpty": true, + "fields": [ + { + "name": "title", + "type": "string", + "single": true, + "required": true + }, + { + "name": "description", + "type": "string", + "single": true, + "required": true + }, + { + "name": "pubDate", + "type": "datetime", + "default": "{{now}}", + "required": true + }, + { + "name": "tags", + "type": "tags", + "required": true + } + ] + } + ], + "frontMatter.framework.startCommand": "bun run dev" +} \ No newline at end of file diff --git a/src/components/GitHubProjects.jsx b/src/components/GitHubProjects.jsx index c4e805b..7497b4a 100644 --- a/src/components/GitHubProjects.jsx +++ b/src/components/GitHubProjects.jsx @@ -4,6 +4,7 @@ import { useState, useEffect } from 'preact/hooks'; const GitHubProjects = ({ username, isOrganization }) => { const [repos, setRepos] = useState([]); const [error, setError] = useState(null); + const [isLoading, setIsLoading] = useState(true); const [currentPage, setCurrentPage] = useState(1); const reposPerPage = 10; @@ -40,6 +41,7 @@ const GitHubProjects = ({ username, isOrganization }) => { setRepos([]); } + setIsLoading(false); return allRepos; }; @@ -47,34 +49,38 @@ const GitHubProjects = ({ username, isOrganization }) => { fetchRepos().then(setRepos); }, [username, isOrganization]); - // Get current repos const indexOfLastRepo = currentPage * reposPerPage; const indexOfFirstRepo = indexOfLastRepo - reposPerPage; const currentRepos = repos.slice(indexOfFirstRepo, indexOfLastRepo); - // Change page const nextPage = () => setCurrentPage(currentPage + 1); const prevPage = () => setCurrentPage(currentPage - 1); return ( -
- {error &&
{error}
} -
- {currentRepos.map((repo) => ( -
-

{repo.name}

-

{repo.description}

- -
- ))} -
- {currentPage > 1 && } - {currentPage < Math.ceil(repos.length / reposPerPage) && } + {isLoading ? ( +
Loading...
+ ) : ( + <> + {error &&
{error}
} +
+ {currentRepos.map((repo) => ( +
+

{repo.name}

+

{repo.description}

+ +
+ ))} +
+
+ {currentPage > 1 && } + {currentPage < Math.ceil(repos.length / reposPerPage) && } +
+ + )}
-
); }; diff --git a/src/data/projects.json b/src/data/projects.json index c5e5f52..5b5b0a7 100644 --- a/src/data/projects.json +++ b/src/data/projects.json @@ -39,7 +39,7 @@ }, { "name": "Snug Cup", - "description": "Snug Cup was a school project that I made with my classmates back in 2021.", + "description": "A school project that I made with my classmates in high school.", "links": [ { "name": "Website", diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index 15d3c78..db559c0 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -43,7 +43,7 @@ const date = new Date();

Made with {Astro.generator} and Hosted on Vercel

-

Copyright © {date.getFullYear()} Andrew Lee. View source code.

+

Copyright © {date.getFullYear()} Andrew Lee. View source code.

diff --git a/src/pages/downloads/osft-software-archive.astro b/src/pages/downloads/osft-software-archive.astro index c106cef..039fc2e 100644 --- a/src/pages/downloads/osft-software-archive.astro +++ b/src/pages/downloads/osft-software-archive.astro @@ -69,7 +69,7 @@ import '../../styles/cards.css';
  • Zeon OS 0.2
  • -
    +

    MD5: d14f7bfd17fa66ada3d48020deffcce0

    SHA512: b481d73f839c2ad99b6d6502d5735f416fbcc38dbac811c3d939845d319fecf8b15dd4ff1728ed96abe19077be19527df3692c54751bb81c201e58934d016527

    SHA256: c7ad3f799f14e610f8931f87e2612385ec39e2662308e7005e10715f9e94c6a0

    @@ -101,4 +101,8 @@ import '../../styles/cards.css'; a { font-size: 1.5em; } + + .checksum { + overflow-wrap: break-word; + }