Skip to content

Commit 2d7f034

Browse files
committed
remove stream refs, add icons from ktrain5369's site, add socials buttons
1 parent e4d8555 commit 2d7f034

10 files changed

Lines changed: 91 additions & 11 deletions

File tree

.github/workflows/checks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## Worked on during a community livestream!
2-
## Go watch it @ twitch.tv/trhrichard if it's still live!
32

43
name: Lint & check commits
54

.github/workflows/deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## Worked on during a community livestream!
2-
## Go watch it @ twitch.tv/trhrichard if it's still live!
32

43
name: Build & deploy to GitHub Pages
54

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
"start": "astro dev",
88
"build": "astro check && astro build",
99
"preview": "astro preview",
10-
"astro": "astro"
10+
"astro": "astro",
11+
"build-dev": "astro build && astro preview"
1112
},
1213
"dependencies": {
1314
"@astrojs/check": "^0.9.4",
1415
"@astrojs/vue": "^5.0.6",
1516
"@tailwindcss/vite": "^4.0.2",
1617
"astro": "^5.2.3",
18+
"lucide-astro": "^0.473.0",
19+
"simple-icons-astro": "^14.5.0",
1720
"tailwindcss": "^4.0.2",
1821
"typescript": "^5.5.4",
1922
"vue": "^3.4.35"

pnpm-lock.yaml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Header.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
// Worked on during a community livestream!
3-
// Go watch it @ twitch.tv/trhrichard if it's still live!
43
---
54

65
<header class="bg-purple-800 p-2.5">

src/components/Icon.astro

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
import * as LucideIcons from 'lucide-astro';
3+
import * as SimpleIcons from 'simple-icons-astro';
4+
5+
// Props passed to the Icon component
6+
const { icon, iconType = 'lucide', size = 24, color = 'white' } = Astro.props;
7+
8+
// Helper types to restrict icon name to valid keys
9+
type LucideIconKeys = keyof typeof LucideIcons;
10+
type SimpleIconKeys = keyof typeof SimpleIcons;
11+
12+
const toPascalCase = (str: string) =>
13+
str.replace(/(^\w|-\w)/g, (match) => match.replace('-', '').toUpperCase());
14+
15+
let IconComponent: any = null;
16+
17+
if (iconType.toLowerCase() === 'lucide') {
18+
// Ensure icon is a valid key for LucideIcons and cast
19+
const lucideIconName = toPascalCase(icon); // Convert lucideIconNames to PascalCase
20+
IconComponent = LucideIcons[lucideIconName as LucideIconKeys];
21+
} else if (iconType.toLowerCase() === 'simple') {
22+
// Ensure icon is a valid key for SimpleIcons and cast
23+
const simpleIconName = toPascalCase(icon); // Convert simpleIconNames to PascalCase
24+
IconComponent = SimpleIcons[simpleIconName as SimpleIconKeys];
25+
}
26+
27+
// Handle the case when the icon is not found
28+
if (!IconComponent) {
29+
console.error(`Icon ${icon} not found for ${iconType}`);
30+
}
31+
---
32+
33+
{iconType.toLowerCase() === 'lucide' && IconComponent && (
34+
<IconComponent color={color} size={size} />
35+
)}
36+
37+
{iconType.toLowerCase() === 'simple' && IconComponent && (
38+
<IconComponent color={color} size={size} />
39+
)}

src/components/SocialLink.astro

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
const { platform, url, iconName, iconType, color = 'white' } = Astro.props;
3+
import Icon from './Icon.astro';
4+
---
5+
6+
<a href={url} class="flex items-center gap-2 no-underline">
7+
<Icon icon={iconName} iconType={iconType} size={24} color={color} />
8+
<span>{platform}</span>
9+
</a>

src/layouts/Layout.astro

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Props {
66
import Header from "../components/Header.astro";
77
import Footer from "../components/Footer.astro";
88
9-
import "./src/styles/global.css"
9+
import "../styles/global.css"
1010
1111
const { title } = Astro.props;
1212
---
@@ -26,7 +26,4 @@ const { title } = Astro.props;
2626
<slot />
2727
<Footer />
2828
</body>
29-
</html>
30-
31-
32-
<!-- guess I can't convert the above -->
29+
</html>

src/pages/index.astro

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
---
22
// Worked on during a community livestream!
3-
// Go watch it @ twitch.tv/trhrichard if it's still live!
43
import Layout from '../layouts/Layout.astro';
4+
import SocialLink from '../components/SocialLink.astro';
55
---
66

77
<Layout title="KTools2202">
88
<main class="mx-auto p-4 w-full max-w-[800px] text-white text-lg leading-6 items-center justify-center">
99
<h1 class="text-4xl font-bold text-center mb-4">KTools2202</h1>
1010
<h2 class="text-2xl text-center mb-4">This is the landing page for KTools2202.</h2>
1111
<br>
12+
<div class="flex lg:flex-row flex-col justify-center gap-3.5 mb-5">
13+
<button class="block mx-auto px-5 py-2.5 bg-black text-white text-center border-none cursor-pointer">
14+
<SocialLink platform="GitHub" iconName="github" iconType="lucide" url="https://github.com/KTools2202" />
15+
</button>
16+
<button class="block mx-auto px-5 py-2.5 bg-orange-700 text-white text-center border-none cursor-pointer">
17+
<SocialLink platform="GitLab" iconName="gitlab" iconType="lucide" url="https://gitlab.com/KTools2202" />
18+
</button>
19+
<button class="block mx-auto px-5 py-2.5 bg-indigo-700 text-white text-center border-none cursor-pointer">
20+
<SocialLink platform="Discord" iconName="discord" iconType="simple" url="https://discord.gg/G6YvWhctjk" />
21+
</button>
22+
</div>
23+
<br>
1224
<p class="text-3xl font-bold italic text-center mb-4">(this is a work in progress)</p>
1325
</main>
1426
</Layout>

src/pages/projects.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
// Worked on during a community livestream!
3-
// Go watch it @ twitch.tv/trhrichard if it's still live!
43
import Layout from '../layouts/Layout.astro';
54
import Card from '../components/Card.astro';
65

0 commit comments

Comments
 (0)