Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f403fa274 | |||
| 0fc359a973 | |||
| 104fe35ee8 | |||
| a57f43e082 | |||
| efad6c30d1 | |||
| c2d26228ba | |||
|
94fe56022d
|
|||
| d171292dd2 | |||
| f52d285013 | |||
|
a79f53e90c
|
|||
| 5ad7e33c8a | |||
|
87f266a3e2
|
|||
| dc039046fe | |||
|
9c53f37b39
|
|||
| 093e1e2ccb | |||
| 7a77f0d2d2 | |||
| e29631c4af | |||
| 31aad5511f | |||
| 976bc0c413 | |||
| 0a2979ecfe | |||
| c3e4519682 | |||
| d9833e1c27 | |||
| 19e80809c1 | |||
| 00ef91b644 | |||
| 7f7f710fe8 | |||
| 1573331f87 | |||
| 14f7bdc024 | |||
| 0b116a05df | |||
|
849ca78598
|
|||
| 8377aefaf7 | |||
| 3f5682f80c | |||
| ae84560ddd | |||
|
1f7253d954
|
|||
| b6dfc738f1 | |||
| 63cbcdf39b | |||
| 10c4f9c768 | |||
| 880bafd41e | |||
| 3ebc36174b | |||
| 0abd1a2465 | |||
|
f2b27a01bf
|
|||
|
503cb401fc
|
|||
| a45a4d7dd7 | |||
| 6d3f3a49ab | |||
| 197ad63ada |
@@ -22,7 +22,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24.13.0
|
node-version: 24.13.1
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24.13.0
|
node-version: 24.13.1
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24.13.0
|
node-version: 24.13.1
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
@@ -50,3 +50,38 @@ jobs:
|
|||||||
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
||||||
actions: '[{"action": "view", "label": "Open Gitea", "url": "https://gitea.alexlebens.dev/alexlebens/site-profile/actions?workflow=test-build.yaml", "clear": true}]'
|
actions: '[{"action": "view", "label": "Open Gitea", "url": "https://gitea.alexlebens.dev/alexlebens/site-profile/actions?workflow=test-build.yaml", "clear": true}]'
|
||||||
image: true
|
image: true
|
||||||
|
|
||||||
|
guarddog:
|
||||||
|
runs-on: ubuntu-js
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: Install GuardDog
|
||||||
|
run: |
|
||||||
|
python3 -m pip install --upgrade pip
|
||||||
|
python3 -m pip install guarddog
|
||||||
|
|
||||||
|
- name: Run GuardDog
|
||||||
|
run: |
|
||||||
|
guarddog npm scan ./
|
||||||
|
|
||||||
|
- name: ntfy Failed
|
||||||
|
uses: niniyas/ntfy-action@master
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
url: '${{ secrets.NTFY_URL }}'
|
||||||
|
topic: '${{ secrets.NTFY_TOPIC }}'
|
||||||
|
title: 'Security Failure - Site Profile'
|
||||||
|
priority: 4
|
||||||
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
||||||
|
tags: action,failed
|
||||||
|
details: 'Guarddog scan failed for Site Profile'
|
||||||
|
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
||||||
|
actions: '[{"action": "view", "label": "Open Gitea", "url": "https://gitea.alexlebens.dev/alexlebens/site-profile/actions?workflow=test-build.yaml", "clear": true}]'
|
||||||
|
image: true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
ARG REGISTRY=docker.io
|
ARG REGISTRY=docker.io
|
||||||
FROM ${REGISTRY}/node:24.13.0-alpine AS base
|
FROM ${REGISTRY}/node:24.13.1-alpine AS base
|
||||||
|
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
@@ -26,10 +26,10 @@ COPY --from=build /app/dist /app/dist
|
|||||||
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV SITE_URL=https://www.alexlebens.dev
|
ENV SITE_URL=https://www.alexlebens.dev
|
||||||
ENV DIRECTUS_URL=https://directus.alexlebens.dev
|
ENV DIRECTUS_URL=https://directus.alexlebens.net
|
||||||
ENV PORT=4321
|
ENV PORT=4321
|
||||||
|
|
||||||
LABEL version="2.4.0"
|
LABEL version="2.9.0"
|
||||||
LABEL description="Astro based personal website"
|
LABEL description="Astro based personal website"
|
||||||
|
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
||||||
|
|||||||
22
package.json
22
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "site-profile",
|
"name": "site-profile",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.4.0",
|
"version": "2.9.0",
|
||||||
"homepage": "https://www.alexlebens.dev",
|
"homepage": "https://www.alexlebens.dev",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
||||||
@@ -28,29 +28,29 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.9.6",
|
"@astrojs/check": "^0.9.6",
|
||||||
"@astrojs/node": "^9.5.2",
|
"@astrojs/node": "^9.5.3",
|
||||||
"@astrojs/partytown": "^2.1.4",
|
"@astrojs/partytown": "^2.1.4",
|
||||||
"@astrojs/react": "^4.4.2",
|
"@astrojs/react": "^4.4.2",
|
||||||
"@astrojs/rss": "^4.0.15",
|
"@astrojs/rss": "^4.0.15",
|
||||||
"@astrojs/sitemap": "^3.7.0",
|
"@astrojs/sitemap": "^3.7.0",
|
||||||
"@directus/sdk": "^21.0.0",
|
"@directus/sdk": "^21.1.0",
|
||||||
"@giscus/react": "^3.1.0",
|
"@giscus/react": "^3.1.0",
|
||||||
"@iconify-json/mdi": "^1.2.3",
|
"@iconify-json/mdi": "^1.2.3",
|
||||||
"@iconify-json/pajamas": "^1.2.15",
|
"@iconify-json/pajamas": "^1.2.15",
|
||||||
"@iconify-json/simple-icons": "^1.2.69",
|
"@iconify-json/simple-icons": "^1.2.70",
|
||||||
"@playform/compress": "^0.2.1",
|
"@playform/compress": "^0.2.1",
|
||||||
"@swup/astro": "^1.7.0",
|
"@swup/astro": "^1.7.0",
|
||||||
"@tailwindcss/postcss": "^4.1.18",
|
"@tailwindcss/postcss": "^4.1.18",
|
||||||
"@tailwindcss/vite": "^4.1.18",
|
"@tailwindcss/vite": "^4.1.18",
|
||||||
"@types/react": "^19.2.10",
|
"@types/react": "^19.2.14",
|
||||||
"@types/unist": "^3.0.3",
|
"@types/unist": "^3.0.3",
|
||||||
"astro": "^5.17.1",
|
"astro": "^5.17.2",
|
||||||
"astro-compressor": "^1.2.0",
|
"astro-compressor": "^1.2.0",
|
||||||
"astro-icon": "^1.1.5",
|
"astro-icon": "^1.1.5",
|
||||||
"marked": "^17.0.1",
|
"marked": "^17.0.2",
|
||||||
"marked-shiki": "^1.2.1",
|
"marked-shiki": "^1.2.1",
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"motion": "^12.31.0",
|
"motion": "^12.34.0",
|
||||||
"preline": "^4.0.1",
|
"preline": "^4.0.1",
|
||||||
"react": "^19.2.4",
|
"react": "^19.2.4",
|
||||||
"react-dom": "^19.2.4",
|
"react-dom": "^19.2.4",
|
||||||
@@ -62,14 +62,14 @@
|
|||||||
"ultrahtml": "^1.6.0"
|
"ultrahtml": "^1.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint-react/eslint-plugin": "^2.9.4",
|
"@eslint-react/eslint-plugin": "^2.12.4",
|
||||||
"@tailwindcss/forms": "^0.5.11",
|
"@tailwindcss/forms": "^0.5.11",
|
||||||
"@tailwindcss/typography": "^0.5.19",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"astro-icon": "^1.1.5",
|
"astro-icon": "^1.1.5",
|
||||||
"eslint": "^10.0.0",
|
"eslint": "^10.0.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-astro": "^1.5.0",
|
"eslint-plugin-astro": "^1.5.0",
|
||||||
"eslint-plugin-format": "^1.3.1",
|
"eslint-plugin-format": "^1.4.0",
|
||||||
"eslint-plugin-react": "^7.37.5",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-plugin-react-hooks": "^7.0.1",
|
"eslint-plugin-react-hooks": "^7.0.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.0",
|
"eslint-plugin-react-refresh": "^0.5.0",
|
||||||
@@ -78,6 +78,6 @@
|
|||||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||||
"timeago.js": "^4.0.2",
|
"timeago.js": "^4.0.2",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.54.0"
|
"typescript-eslint": "^8.55.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
898
pnpm-lock.yaml
generated
898
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -16,14 +16,14 @@ const currentYear = new Date().getFullYear();
|
|||||||
transition:animate="none"
|
transition:animate="none"
|
||||||
>
|
>
|
||||||
<div class="relative px-4 pt-16 pb-12 sm:px-6">
|
<div class="relative px-4 pt-16 pb-12 sm:px-6">
|
||||||
<div class="mx-auto max-w-[85rem]">
|
<div class="mx-auto max-w-340">
|
||||||
<div class="grid grid-cols-1 gap-10 md:grid-cols-12">
|
<div class="grid grid-cols-1 gap-10 md:grid-cols-12">
|
||||||
<!-- Brand section -->
|
<!-- Brand section -->
|
||||||
<div class="col-span-1 md:col-span-3">
|
<div class="col-span-1 md:col-span-3">
|
||||||
<a href="/" class="group inline-block">
|
<a href="/" class="group inline-block">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="mx-auto aspect-square overflow-hidden rounded-lg">
|
<div class="mx-auto aspect-square overflow-hidden rounded-lg">
|
||||||
<BrandLogo class="max-h-[40px] max-w-[40px] rounded-full" />
|
<BrandLogo class="max-h-10 max-w-10 rounded-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="ml-3 text-xl font-bold text-neutral-800 dark:text-neutral-200">
|
<span class="ml-3 text-xl font-bold text-neutral-800 dark:text-neutral-200">
|
||||||
@@ -108,7 +108,23 @@ const currentYear = new Date().getFullYear();
|
|||||||
© {currentYear} All rights reserved.
|
© {currentYear} All rights reserved.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center">
|
||||||
|
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
||||||
|
Weather provided by
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
href="https://open-meteo.com/"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="group inline-flex items-center text-xs text-neutral-600 transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100"
|
||||||
|
>
|
||||||
|
<span class="relative ml-1">
|
||||||
|
Open-Meteo.
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="ml-4"></div>
|
||||||
|
|
||||||
<span class="text-xs text-neutral-500 dark:text-neutral-400">Built with </span>
|
<span class="text-xs text-neutral-500 dark:text-neutral-400">Built with </span>
|
||||||
<a
|
<a
|
||||||
href="https://astro.build"
|
href="https://astro.build"
|
||||||
@@ -116,24 +132,8 @@ const currentYear = new Date().getFullYear();
|
|||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="group inline-flex items-center text-xs text-neutral-600 transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100"
|
class="group inline-flex items-center text-xs text-neutral-600 transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100"
|
||||||
>
|
>
|
||||||
<svg class="mr-1 h-4 w-4 text-[#FF5D01]" viewBox="0 0 36 36" fill="none">
|
<span class="relative ml-1">
|
||||||
<path
|
Astro.
|
||||||
fill-rule="evenodd"
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M8.833 22.958c.622-1.185 1.832-1.918 3.18-1.918 2.292 0 4.145 1.86 4.145 4.153 0 1.34-.626 2.54-1.601 3.303 1.223-1.299 1.97-3.048 1.97-4.971 0-3.994-3.243-7.233-7.242-7.233-2.818 0-5.26 1.6-6.469 3.933.78-2.912 3.428-5.06 6.577-5.06 3.75 0 6.79 3.035 6.79 6.78 0 2.606-1.468 4.868-3.616 6.002a4.163 4.163 0 0 0 2.285-3.724c0-2.293-1.853-4.153-4.145-4.153-1.348 0-2.558.733-3.18 1.918l1.306-3.03Z"
|
|
||||||
fill="currentColor"></path>
|
|
||||||
<path
|
|
||||||
fill-rule="evenodd"
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M22.155 12.056c-.622 1.185-1.832 1.918-3.18 1.918-2.292 0-4.145-1.86-4.145-4.153 0-1.34.626-2.54 1.601-3.303-1.223 1.299-1.97 3.048-1.97 4.971 0 3.994 3.243 7.233 7.242 7.233 2.818 0 5.26-1.6 6.469-3.933-.78 2.912-3.428 5.06-6.577 5.06-3.75 0-6.79-3.035-6.79-6.78 0-2.606 1.468-4.868 3.616-6.002a4.163 4.163 0 0 0-2.285 3.724c0 2.293 1.853 4.153 4.145 4.153 1.348 0 2.558-.733 3.18-1.918l-1.306 3.03Z"
|
|
||||||
fill="currentColor"></path>
|
|
||||||
</svg>
|
|
||||||
<span class="relative">
|
|
||||||
Astro
|
|
||||||
<span
|
|
||||||
class="absolute bottom-0 left-0 h-0.5 w-0 bg-[#FF5D01] transition-all duration-300 group-hover:w-full"
|
|
||||||
>
|
|
||||||
</span>
|
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const currentPath = pathname.slice(1);
|
|||||||
aria-label="Toggle navigation"
|
aria-label="Toggle navigation"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="hs-collapse-open:hidden h-[1.25rem] w-[1.25rem] flex-shrink-0"
|
class="hs-collapse-open:hidden h-5 w-5 shrink-0"
|
||||||
width="24"
|
width="24"
|
||||||
height="24"
|
height="24"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
@@ -48,7 +48,7 @@ const currentPath = pathname.slice(1);
|
|||||||
<line x1="3" x2="21" y1="18" y2="18"></line>
|
<line x1="3" x2="21" y1="18" y2="18"></line>
|
||||||
</svg>
|
</svg>
|
||||||
<svg
|
<svg
|
||||||
class="hs-collapse-open:block hidden h-[1.25rem] w-[1.25rem] flex-shrink-0"
|
class="hs-collapse-open:block hidden h-5 w-5 shrink-0"
|
||||||
width="24"
|
width="24"
|
||||||
height="24"
|
height="24"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|||||||
62
src/components/ui/cards/EducationCard.astro
Normal file
62
src/components/ui/cards/EducationCard.astro
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
import Logo from '@components/ui/logos/Logo.astro';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
topic: string;
|
||||||
|
area: string;
|
||||||
|
date: string;
|
||||||
|
url: string;
|
||||||
|
logoUrlLight?: string;
|
||||||
|
logoUrlDark?: string;
|
||||||
|
logoIcon?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { topic, area, date, url, logoUrlLight, logoUrlDark, logoIcon } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="smooth-reveal group flex flex-col">
|
||||||
|
<a
|
||||||
|
class="card-base flex items-center"
|
||||||
|
href={url}
|
||||||
|
>
|
||||||
|
<div class="p-4 md:p-10">
|
||||||
|
<div class="flex items-center">
|
||||||
|
{logoUrlLight ? (
|
||||||
|
<div class="card-hover-icon-scale mr-5">
|
||||||
|
<Logo
|
||||||
|
srcLight={logoUrlLight}
|
||||||
|
srcDark={logoUrlDark}
|
||||||
|
alt={`Logo of ${topic}`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : logoIcon ? (
|
||||||
|
<div class="mr-5 text-header">
|
||||||
|
<Icon name={logoIcon} class="card-hover-icon-scale h-12 w-12" />
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
<div class="grow text-left">
|
||||||
|
<span class="card-text-title block text-lg">
|
||||||
|
{topic}
|
||||||
|
</span>
|
||||||
|
<span class="card-text-description block mt-1 font-medium text-xs uppercase">
|
||||||
|
{area} - {new Date(date).getFullYear()}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ml-6 flex">
|
||||||
|
<div class="relative inline-block">
|
||||||
|
<div class="card-text-title card-hover-text-title flex relative mx-auto min-h-11 items-center font-semibold text-md sm:mx-0 sm:mt-4">
|
||||||
|
<span class="relative inline-block overflow-hidden">
|
||||||
|
Visit Page
|
||||||
|
</span>
|
||||||
|
<Icon
|
||||||
|
name="mdi:keyboard-arrow-right"
|
||||||
|
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
@@ -10,33 +10,26 @@ interface Props {
|
|||||||
|
|
||||||
const { title, description, url, icon } = Astro.props;
|
const { title, description, url, icon } = Astro.props;
|
||||||
|
|
||||||
const baseClasses = 'smooth-reveal-2 group group-hover flex flex-col ';
|
|
||||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
|
||||||
const bgColorClasses =
|
|
||||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
|
||||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
|
||||||
const sizeClasses = 'h-30 w-100 md:w-[300px]';
|
const sizeClasses = 'h-30 w-100 md:w-[300px]';
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class={`${baseClasses}`}>
|
<div class="smooth-reveal-2 group flex flex-col">
|
||||||
<a
|
<a
|
||||||
class={`rounded-xl duration-300 transition-all ${sizeClasses} ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
class={`card-base flex items-center ${sizeClasses}`}
|
||||||
href={url}
|
href={url}
|
||||||
data-astro-prefetch
|
data-astro-prefetch
|
||||||
>
|
>
|
||||||
<div class="p-4 md:p-5">
|
<div class="p-5 w-full">
|
||||||
<div class="flex">
|
<div class="flex items-center">
|
||||||
<Icon
|
<Icon
|
||||||
name={icon}
|
name={icon}
|
||||||
class="group-hover:text-steel dark:group-hover:text-bermuda h-6 w-6 text-neutral-600 transition-all duration-300 md:h-8 md:w-8 dark:text-neutral-200"
|
class="card-hover-icon-scale shrink-0 h-6 w-6 md:h-8 md:w-8 "
|
||||||
/>
|
/>
|
||||||
<div class="ms-5 grow">
|
<div class="ms-5 grow text-left">
|
||||||
<span
|
<span class="card-text-title card-hover-text-title block text-lg">
|
||||||
class="group-hover:text-steel dark:group-hover:text-bermuda block text-lg font-bold text-neutral-600 transition-all duration-300 dark:text-neutral-300"
|
|
||||||
>
|
|
||||||
{title}
|
{title}
|
||||||
</span>
|
</span>
|
||||||
<span class="mt-1 block text-neutral-500 dark:text-neutral-400">
|
<span class="card-text-description block mt-1">
|
||||||
{description}
|
{description}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
72
src/components/ui/cards/HighlightsCard.astro
Normal file
72
src/components/ui/cards/HighlightsCard.astro
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
---
|
||||||
|
import { Icon } from 'astro-icon/components';
|
||||||
|
|
||||||
|
import Logo from '@components/ui/logos/Logo.astro';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
title?: string;
|
||||||
|
description?: string;
|
||||||
|
url?: string;
|
||||||
|
logoUrlLight?: string;
|
||||||
|
logoUrlDark?: string;
|
||||||
|
highlights?: string[];
|
||||||
|
visitSource?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { title, description, url, logoUrlLight, logoUrlDark, highlights, visitSource } = Astro.props;
|
||||||
|
|
||||||
|
const visitText = visitSource ? 'Visit Source' : 'Visit Page';
|
||||||
|
const visitClass = visitSource ? 'card-hover-text-gitea' : 'card-hover-text-title';
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="smooth-reveal group flex flex-col">
|
||||||
|
<a
|
||||||
|
class="card-base flex items-center"
|
||||||
|
href={url}
|
||||||
|
>
|
||||||
|
<div class="p-4 md:p-10">
|
||||||
|
<div class="flex items-center mb-4">
|
||||||
|
{logoUrlLight && (
|
||||||
|
<div class="card-hover-icon-scale mr-5">
|
||||||
|
<Logo
|
||||||
|
srcLight={logoUrlLight}
|
||||||
|
srcDark={logoUrlDark}
|
||||||
|
alt={`Logo of ${title}`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div class="grow text-left">
|
||||||
|
<span class="card-text-title block text-lg">
|
||||||
|
{title}
|
||||||
|
</span>
|
||||||
|
<span class="card-text-description block mt-1">
|
||||||
|
{description}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{highlights && (
|
||||||
|
<ul class="card-text-description text-sm mt-1 flex flex-col list-disc gap-2 [&>li]:ml-4">
|
||||||
|
{highlights.map((highlight) => (
|
||||||
|
<li class="marker:text-accent">
|
||||||
|
{highlight}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
<div class="ml-6 flex">
|
||||||
|
<div class="relative inline-block">
|
||||||
|
<div class={`card-text-title ${visitClass} flex relative mx-auto min-h-11 items-center font-semibold text-md sm:mx-0 sm:mt-4`}>
|
||||||
|
{visitSource && <Icon name="pajamas:gitea" />}
|
||||||
|
<span class="relative inline-block overflow-hidden ml-2">
|
||||||
|
{visitText}
|
||||||
|
</span>
|
||||||
|
<Icon
|
||||||
|
name="mdi:keyboard-arrow-right"
|
||||||
|
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
37
src/components/ui/cards/WeatherCard.astro
Normal file
37
src/components/ui/cards/WeatherCard.astro
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
interface Props {
|
||||||
|
dayName: string;
|
||||||
|
label: string;
|
||||||
|
icon: string;
|
||||||
|
temp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { dayName, label, icon, temp } = Astro.props;
|
||||||
|
|
||||||
|
const sizeClasses = 'w-32 md:w-40';
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="smooth-reveal-2 group flex flex-col">
|
||||||
|
<div class={`card-base ${sizeClasses}`}>
|
||||||
|
<div class="p-5 text-center">
|
||||||
|
<span class="card-text-description block font-bold text-xs uppercase tracking-widest">
|
||||||
|
{dayName}
|
||||||
|
</span>
|
||||||
|
<div class="flex justify-center my-2">
|
||||||
|
<img
|
||||||
|
src={`https://openweathermap.org/img/wn/${icon}@2x.png`}
|
||||||
|
alt={label}
|
||||||
|
class="card-hover-icon-scale h-12 w-12"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2">
|
||||||
|
<span class="card-text-title card-hover-text-title block text-2xl">
|
||||||
|
{temp}°F
|
||||||
|
</span>
|
||||||
|
<span class="card-text-description mt-1 block text-xs capitalize">
|
||||||
|
{label}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
52
src/components/ui/images/ImageTheme.astro
Normal file
52
src/components/ui/images/ImageTheme.astro
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
---
|
||||||
|
import { Image } from 'astro:assets';
|
||||||
|
import { blurStyle } from '@support/image';
|
||||||
|
|
||||||
|
const { srcLight, srcDark, alt, style, disableBlur, width, height } = Astro.props;
|
||||||
|
|
||||||
|
const showBlur = !disableBlur;
|
||||||
|
|
||||||
|
const blurLight = (srcLight?.fsPath && showBlur) ? await blurStyle(srcLight.fsPath) : {};
|
||||||
|
const blurDark = (srcDark?.fsPath && showBlur) ? await blurStyle(srcDark.fsPath) : {};
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="themed-image-container">
|
||||||
|
<Image
|
||||||
|
src={srcLight}
|
||||||
|
alt={alt}
|
||||||
|
class={`light-logo ${style}`}
|
||||||
|
style={blurLight}
|
||||||
|
inferSize={true}
|
||||||
|
width={width}
|
||||||
|
height={height}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Image
|
||||||
|
src={srcDark}
|
||||||
|
alt={alt}
|
||||||
|
class={`dark-logo ${style}`}
|
||||||
|
style={blurDark}
|
||||||
|
inferSize={true}
|
||||||
|
width={width}
|
||||||
|
height={height}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.themed-image-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-areas: "stack";
|
||||||
|
}
|
||||||
|
|
||||||
|
.themed-image-container :global(img) {
|
||||||
|
grid-area: stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.dark) .light-logo {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.dark) .dark-logo {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
import Image from '@components/ui/images/Image.astro';
|
|
||||||
|
|
||||||
const { src, alt } = Astro.props;
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<Image src={src} alt={alt} style="color: transparent; width: 32px; height: 32px; object-fit: contain; max-height: 100%; max-width: 100%;" draggable="false" loading="lazy" width="32" height="32" />
|
|
||||||
16
src/components/ui/logos/Logo.astro
Normal file
16
src/components/ui/logos/Logo.astro
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
import ImageTheme from '@components/ui/images/ImageTheme.astro';
|
||||||
|
|
||||||
|
const { srcLight, srcDark, alt } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<ImageTheme
|
||||||
|
srcLight={srcLight}
|
||||||
|
srcDark={srcDark}
|
||||||
|
alt={alt}
|
||||||
|
style='color: transparent; width: 48px; height: 48px; object-fit: contain; max-height: 100%; max-width: 100%;'
|
||||||
|
draggable="false"
|
||||||
|
loading="lazy"
|
||||||
|
width="48"
|
||||||
|
height="48"
|
||||||
|
/>
|
||||||
30
src/components/ui/sections/ApplicationSection.astro
Normal file
30
src/components/ui/sections/ApplicationSection.astro
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
import { readItems } from '@directus/sdk';
|
||||||
|
|
||||||
|
import type { Application } from '@lib/directusTypes';
|
||||||
|
|
||||||
|
import directus from '@lib/directus';
|
||||||
|
import HighlightsCard from '@components/ui/cards/HighlightsCard.astro';
|
||||||
|
|
||||||
|
const applications = ((await directus.request(
|
||||||
|
readItems('site_applications' as any, {
|
||||||
|
fields: ['*'],
|
||||||
|
sort: ['-isActive'],
|
||||||
|
})
|
||||||
|
)) as unknown) as Application[];
|
||||||
|
---
|
||||||
|
|
||||||
|
<section class:list={['mx-auto max-w-7xl px-4 py-10 sm:px-6 lg:px-8 lg:py-14', Astro.props.className]}>
|
||||||
|
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:gap-8 print:flex print:flex-col">
|
||||||
|
{applications.map((application: Application) => (
|
||||||
|
<HighlightsCard
|
||||||
|
title={application.name}
|
||||||
|
description={application.description}
|
||||||
|
url={application.url}
|
||||||
|
logoUrlLight={application.logoUrl}
|
||||||
|
logoUrlDark={application.logoUrl}
|
||||||
|
highlights={application.highlights}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
---
|
|
||||||
import { readItems } from '@directus/sdk';
|
|
||||||
import ApplicationLogo from '@components/ui/logos/ApplicationLogo.astro';
|
|
||||||
|
|
||||||
import type { Application } from '@lib/directusTypes';
|
|
||||||
|
|
||||||
import directus from '@lib/directus';
|
|
||||||
|
|
||||||
const applications = await directus.request(
|
|
||||||
readItems('site_applications', {
|
|
||||||
fields: ['*'],
|
|
||||||
sort: ['-isActive'],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const baseClasses = 'smooth-reveal-cards rounded-xl flex flex-col';
|
|
||||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
|
||||||
const bgColorClasses =
|
|
||||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
|
||||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
|
||||||
---
|
|
||||||
|
|
||||||
<section class:list={['flex flex-col gap-4', Astro.props.className]}>
|
|
||||||
<div class="ml-8 grid grid-cols-1 gap-3 md:grid-cols-2 print:flex print:flex-col">
|
|
||||||
{
|
|
||||||
applications.map((application: Application) => {
|
|
||||||
return (
|
|
||||||
<div class={`${baseClasses}`}>
|
|
||||||
<a
|
|
||||||
class={`rounded-xl transition-all duration-300 ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
|
||||||
href={application.url}
|
|
||||||
>
|
|
||||||
<div class="p-4 md:p-10">
|
|
||||||
<div class="flex">
|
|
||||||
<ApplicationLogo
|
|
||||||
src={application.logoUrl}
|
|
||||||
alt={`Logo of ${application.name}`}
|
|
||||||
/>
|
|
||||||
<h3 class="text-lg font-bold text-gray-800 dark:text-white ml-4">
|
|
||||||
{application.name}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<p class="mt-2 text-gray-500 dark:text-neutral-400">{application.description}</p>
|
|
||||||
<ul class="mt-1 flex list-disc flex-col gap-2 text-sm text-gray-500 dark:text-neutral-400 [&>li]:ml-4">
|
|
||||||
{application.highlights.map((highlight) => {
|
|
||||||
return <li class="marker:text-yellow-500">{highlight}</li>;
|
|
||||||
})}
|
|
||||||
</ul>
|
|
||||||
<div class="flex">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
---
|
|
||||||
import { Icon } from 'astro-icon/components';
|
|
||||||
import { readItems } from '@directus/sdk';
|
|
||||||
|
|
||||||
import type { Education } from '@lib/directusTypes';
|
|
||||||
|
|
||||||
import directus from '@lib/directus';
|
|
||||||
|
|
||||||
const education = await directus.request(
|
|
||||||
readItems('site_education', {
|
|
||||||
fields: ['*'],
|
|
||||||
sort: ['-graduationDate'],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const certificate = await directus.request(
|
|
||||||
readItems('site_certificate', {
|
|
||||||
fields: ['*'],
|
|
||||||
sort: ['-issuerDate'],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const baseClasses = 'rounded-xl flex flex-col';
|
|
||||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
|
||||||
const bgColorClasses =
|
|
||||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
|
||||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
|
||||||
---
|
|
||||||
|
|
||||||
<section class:list={['order-first flex flex-col gap-4', Astro.props.className]}>
|
|
||||||
<h3
|
|
||||||
class="smooth-reveal-1 relative flex w-full items-center gap-3 pb-5 text-5xl text-neutral-800 dark:text-neutral-200"
|
|
||||||
>
|
|
||||||
Education
|
|
||||||
</h3>
|
|
||||||
<div class="ml-8">
|
|
||||||
<h4 class="smooth-reveal-1 pt-5 text-2xl font-semibold text-neutral-800 dark:text-neutral-200">
|
|
||||||
College
|
|
||||||
</h4>
|
|
||||||
<ul class="space-y-4 py-3">
|
|
||||||
<div class="grid md:grid-cols-2 sm:grid-cols-1 gap-4">
|
|
||||||
{
|
|
||||||
education.map(({ institution, area, url, graduationDate}) => {
|
|
||||||
return (
|
|
||||||
<div class="smooth-reveal-cards mt-4 rounded-xl">
|
|
||||||
<div
|
|
||||||
class={`p-4 md:p-6 transition-all duration-300 ${shadowClasses} ${bgColorClasses} ${baseClasses} ${borderClasses}`}
|
|
||||||
>
|
|
||||||
<h3 class="flex flex-row text-lg font-bold text-neutral-800 dark:text-neutral-200">
|
|
||||||
<Icon
|
|
||||||
name="mdi:university-outline"
|
|
||||||
class="mr-2 h-3 w-3 translate-y-1 md:h-5 md:w-5"
|
|
||||||
/>
|
|
||||||
{institution}
|
|
||||||
</h3>
|
|
||||||
<p class="mt-2 ml-7 text-xs font-medium text-neutral-600 uppercase dark:text-neutral-400">
|
|
||||||
{area} - {new Date(graduationDate).getFullYear()}
|
|
||||||
</p>
|
|
||||||
<div class="ml-6 flex">
|
|
||||||
<a
|
|
||||||
class="group group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
|
||||||
href={url}
|
|
||||||
>
|
|
||||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-[44px] items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
|
||||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
|
||||||
<Icon
|
|
||||||
name="mdi:keyboard-arrow-right"
|
|
||||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
certificate.length > 0 && (
|
|
||||||
<div class="ml-8">
|
|
||||||
<h4 class="smooth-reveal-1 pt-8 text-2xl font-semibold text-neutral-800 dark:text-neutral-200">
|
|
||||||
Certificates
|
|
||||||
</h4>
|
|
||||||
<ul class="space-y-4 py-3">
|
|
||||||
<div class="grid md:grid-cols-2 sm:grid-cols-1 gap-4">
|
|
||||||
{certificate.map(({ name, issuer, url }) => {
|
|
||||||
return (
|
|
||||||
<div class="smooth-reveal-cards mt-4 rounded-xl">
|
|
||||||
<div
|
|
||||||
class={`p-4 md:p-6 transition-all duration-300 ${shadowClasses} ${bgColorClasses} ${baseClasses} ${borderClasses}`}
|
|
||||||
>
|
|
||||||
<h3 class="flex flex-row text-lg font-bold text-neutral-800 dark:text-neutral-200">
|
|
||||||
<Icon
|
|
||||||
name="mdi:script-text-outline"
|
|
||||||
class="mr-2 h-3 w-3 translate-y-1 md:h-5 md:w-5"
|
|
||||||
/>
|
|
||||||
{name}
|
|
||||||
</h3>
|
|
||||||
<p class="mt-2 ml-7 text-xs font-medium text-neutral-600 uppercase dark:text-neutral-400">
|
|
||||||
{issuer}
|
|
||||||
</p>
|
|
||||||
<div class="ml-6 flex">
|
|
||||||
<a
|
|
||||||
class="group group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
|
||||||
href={url}
|
|
||||||
>
|
|
||||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text relative z-10 mx-auto flex min-h-[44px] items-center text-sm font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
|
||||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
|
||||||
<Icon
|
|
||||||
name="mdi:keyboard-arrow-right"
|
|
||||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</section>
|
|
||||||
65
src/components/ui/sections/EducationSection.astro
Normal file
65
src/components/ui/sections/EducationSection.astro
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
import { readItems } from '@directus/sdk';
|
||||||
|
|
||||||
|
import type { Education, Certificate} from '@lib/directusTypes';
|
||||||
|
|
||||||
|
import directus from '@lib/directus';
|
||||||
|
import { getDirectusImageURL } from '@lib/directusFunctions';
|
||||||
|
import EducationCard from '@components/ui/cards/EducationCard.astro';
|
||||||
|
|
||||||
|
const educations = ((await directus.request(
|
||||||
|
readItems('site_education' as any, {
|
||||||
|
fields: ['*'],
|
||||||
|
sort: ['-graduationDate'],
|
||||||
|
})
|
||||||
|
)) as unknown) as Education[];
|
||||||
|
|
||||||
|
const certificates = ((await directus.request(
|
||||||
|
readItems('site_certificate' as any, {
|
||||||
|
fields: ['*'],
|
||||||
|
sort: ['-issuerDate'],
|
||||||
|
})
|
||||||
|
)) as unknown) as Certificate[];
|
||||||
|
---
|
||||||
|
|
||||||
|
<section class:list={['flex flex-col gap-4', Astro.props.className]}>
|
||||||
|
<h3 class="smooth-reveal card-text-header flex relative items-center w-full gap-3 pb-5">
|
||||||
|
Education
|
||||||
|
</h3>
|
||||||
|
<div class="mx-8">
|
||||||
|
<h4 class="smooth-reveal card-text-header-minor pt-5 ">
|
||||||
|
College
|
||||||
|
</h4>
|
||||||
|
<div class="grid md:grid-cols-2 sm:grid-cols-1 gap-4 py-3">
|
||||||
|
{educations.map((education: Education) => (
|
||||||
|
<EducationCard
|
||||||
|
topic={education.institution}
|
||||||
|
area={education.area}
|
||||||
|
date={education.graduationDate}
|
||||||
|
url={education.url}
|
||||||
|
logoUrlLight={getDirectusImageURL(education.logo)}
|
||||||
|
logoUrlDark={getDirectusImageURL(education.logoDark)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{certificates.length > 0 && (
|
||||||
|
<div class="mx-8">
|
||||||
|
<h4 class="smooth-reveal card-text-header-minor pt-8">
|
||||||
|
Certificates
|
||||||
|
</h4>
|
||||||
|
<div class="grid md:grid-cols-2 sm:grid-cols-1 gap-4 py-3">
|
||||||
|
{certificates.map((certificate: Certificate) => (
|
||||||
|
<EducationCard
|
||||||
|
topic={certificate.name}
|
||||||
|
area={certificate.issuer}
|
||||||
|
date={certificate.issuerDate}
|
||||||
|
url={certificate.url}
|
||||||
|
logoIcon={certificate.logoName}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
@@ -18,7 +18,7 @@ const experiences = await directus.request(
|
|||||||
class:list={['flex flex-col gap-8', Astro.props.className]}
|
class:list={['flex flex-col gap-8', Astro.props.className]}
|
||||||
|
|
||||||
>
|
>
|
||||||
<h3 class="relative smooth-reveal-1 flex w-full items-center gap-3 pb-10 text-5xl text-neutral-800 dark:text-neutral-200">Experience</h3>
|
<h3 class="relative flex w-full items-center gap-3 pb-10 text-5xl text-neutral-800 dark:text-neutral-200">Experience</h3>
|
||||||
<ul class="ml-8 w-full flex flex-col">
|
<ul class="ml-8 w-full flex flex-col">
|
||||||
{
|
{
|
||||||
experiences.map(
|
experiences.map(
|
||||||
@@ -28,7 +28,7 @@ const experiences = await directus.request(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<li class="relative">
|
<li class="relative">
|
||||||
<div class="group smooth-reveal-2 relative grid pb-1 transition-all sm:grid-cols-18 sm:gap-8 md:gap-6 lg:hover:!opacity-100">
|
<div class="group smooth-reveal relative grid pb-1 transition-all sm:grid-cols-18 sm:gap-8 md:gap-6 lg:hover:!opacity-100">
|
||||||
<header class="relative mt-1 text-lg font-semibold sm:col-span-3 text-neutral-800 dark:text-neutral-200">
|
<header class="relative mt-1 text-lg font-semibold sm:col-span-3 text-neutral-800 dark:text-neutral-200">
|
||||||
<time datetime={experience.startDate} data-title={experience.startDate}>
|
<time datetime={experience.startDate} data-title={experience.startDate}>
|
||||||
{startYear}
|
{startYear}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
<div
|
<div
|
||||||
class="flex flex-col items-center justify-center gap-y-2 sm:flex-row sm:gap-x-12 sm:gap-y-0 lg:gap-x-24"
|
class="flex flex-col items-center justify-center gap-y-2 sm:flex-row sm:gap-x-12 sm:gap-y-0 lg:gap-x-24"
|
||||||
>
|
>
|
||||||
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
|
<div class="max-w-5xl sm:px-6 lg:px-8">
|
||||||
<div class="flex flex-wrap gap-6 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 justify-center">
|
<div class="flex flex-wrap gap-6 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 justify-center">
|
||||||
<FeaturesCard
|
<FeaturesCard
|
||||||
title="Cloud Engineer"
|
title="Cloud Engineer"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ interface Props {
|
|||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<section class="lg:px- relative mx-auto mb-20 max-w-[85rem] px-4 pt-30 pb-30 sm:px-6">
|
<section class="lg:px- relative mx-auto mb-20 max-w-340 px-4 pt-30 pb-30 sm:px-6">
|
||||||
<div
|
<div
|
||||||
class="smooth-reveal absolute top-[55%] left-0 scale-90 md:top-[20%] xl:top-[25%] xl:left-[10%]"
|
class="smooth-reveal absolute top-[55%] left-0 scale-90 md:top-[20%] xl:top-[25%] xl:left-[10%]"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const recentPosts = posts
|
|||||||
.slice(0, 3);
|
.slice(0, 3);
|
||||||
---
|
---
|
||||||
|
|
||||||
<section class="mx-auto mb-20 max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
<section class="mx-auto mb-20 max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||||
<div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14">
|
<div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14">
|
||||||
<h1
|
<h1
|
||||||
class="smooth-reveal block text-4xl font-bold text-neutral-800 md:text-5xl md:leading-tight lg:text-5xl dark:text-neutral-200"
|
class="smooth-reveal block text-4xl font-bold text-neutral-800 md:text-5xl md:leading-tight lg:text-5xl dark:text-neutral-200"
|
||||||
|
|||||||
32
src/components/ui/sections/ProjectSection.astro
Normal file
32
src/components/ui/sections/ProjectSection.astro
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
import { readItems } from '@directus/sdk';
|
||||||
|
|
||||||
|
import type { Project } from '@lib/directusTypes';
|
||||||
|
|
||||||
|
import directus from '@lib/directus';
|
||||||
|
import HighlightsCard from '@components/ui/cards/HighlightsCard.astro';
|
||||||
|
|
||||||
|
const projects = ((await directus.request(
|
||||||
|
readItems('site_projects' as any, {
|
||||||
|
fields: ['*'],
|
||||||
|
sort: ['-isActive'],
|
||||||
|
})
|
||||||
|
)) as unknown) as Project[];
|
||||||
|
---
|
||||||
|
|
||||||
|
<section class:list={['flex flex-col gap-y-8', Astro.props.className]}>
|
||||||
|
<h3 class="smooth-reveal card-text-header flex relative items-center w-full gap-3 pb-5">
|
||||||
|
Projects
|
||||||
|
</h3>
|
||||||
|
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:gap-8 print:flex print:flex-col">
|
||||||
|
{projects.map((project: Project) => (
|
||||||
|
<HighlightsCard
|
||||||
|
title={project.name}
|
||||||
|
description={project.description}
|
||||||
|
url={project.source}
|
||||||
|
highlights={project.highlights}
|
||||||
|
visitSource={true}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
---
|
|
||||||
import { Icon } from 'astro-icon/components';
|
|
||||||
import { readItems } from '@directus/sdk';
|
|
||||||
|
|
||||||
import type { Project } from '@lib/directusTypes';
|
|
||||||
|
|
||||||
import directus from '@lib/directus';
|
|
||||||
|
|
||||||
const projects = await directus.request(
|
|
||||||
readItems('site_projects', {
|
|
||||||
fields: ['*'],
|
|
||||||
sort: ['-isActive'],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const baseClasses = 'smooth-reveal-cards rounded-xl flex flex-col';
|
|
||||||
const borderClasses = 'border border-neutral-100 dark:border-stone-500/20';
|
|
||||||
const bgColorClasses =
|
|
||||||
'bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90';
|
|
||||||
const shadowClasses = 'shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg';
|
|
||||||
---
|
|
||||||
|
|
||||||
<section class:list={['flex flex-col gap-4', Astro.props.className]}>
|
|
||||||
<h3
|
|
||||||
class="relative flex w-full items-center gap-3 pb-10 text-5xl text-neutral-800 dark:text-neutral-200"
|
|
||||||
>
|
|
||||||
Projects
|
|
||||||
</h3>
|
|
||||||
<div class="ml-8 grid grid-cols-1 gap-3 md:grid-cols-2 print:flex print:flex-col">
|
|
||||||
{
|
|
||||||
projects.map((project: Project) => {
|
|
||||||
return (
|
|
||||||
<div class={`${baseClasses}`}>
|
|
||||||
<div
|
|
||||||
class={`rounded-xl transition-all duration-300 ${borderClasses} ${bgColorClasses} ${shadowClasses}`}
|
|
||||||
>
|
|
||||||
<div class="p-4 md:p-10">
|
|
||||||
<h3 class="text-lg font-bold text-gray-800 dark:text-white">{project.name}</h3>
|
|
||||||
<p class="mt-2 text-gray-500 dark:text-neutral-400">{project.description}</p>
|
|
||||||
<ul class="mt-1 flex list-disc flex-col gap-2 text-sm text-gray-500 dark:text-neutral-400 [&>li]:ml-4">
|
|
||||||
{project.highlights.map((highlight) => {
|
|
||||||
return <li class="marker:text-yellow-500">{highlight}</li>;
|
|
||||||
})}
|
|
||||||
</ul>
|
|
||||||
<div class="flex">
|
|
||||||
<a
|
|
||||||
class="group group-hover relative inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
|
||||||
href={project.url}
|
|
||||||
>
|
|
||||||
<div class="group-hover:text-steel dark:group-hover:text-bermuda transition-text text-md relative z-10 mx-auto flex min-h-[44px] items-center font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
|
||||||
<span class="relative inline-block overflow-hidden"> Visit Page </span>
|
|
||||||
<Icon
|
|
||||||
name="mdi:keyboard-arrow-right"
|
|
||||||
class="translate-y-0.5 transition duration-300 group-hover:translate-x-1"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
class="group group-hover relative ml-auto inline-block gap-x-1 rounded-lg border border-transparent disabled:pointer-events-none disabled:opacity-50"
|
|
||||||
href={project.source}
|
|
||||||
>
|
|
||||||
<div class="group-hover:text-gitea-primary dark:group-hover:text-gitea-primary transition-text text-md relative z-10 mx-auto flex min-h-[44px] items-center font-semibold text-neutral-600 decoration-2 duration-300 sm:mx-0 sm:mt-4 dark:text-neutral-300">
|
|
||||||
<span class="relative inline-block overflow-hidden"> Source </span>
|
|
||||||
<Icon name="pajamas:gitea" class="ml-2 translate-y-0.5" />
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
@@ -54,7 +54,7 @@ const shadowClasses = 'shadow-xs hover:shadow-lg';
|
|||||||
|
|
||||||
<div class="relative h-1.5 w-full overflow-hidden rounded-full bg-stone-500/20 sm:h-2 dark:bg-stone-500/20">
|
<div class="relative h-1.5 w-full overflow-hidden rounded-full bg-stone-500/20 sm:h-2 dark:bg-stone-500/20">
|
||||||
<div
|
<div
|
||||||
class="progress-bar-animate from-steel via-bermuda to-steel absolute top-0 left-0 h-full rounded-full bg-gradient-to-r transition-all duration-1000"
|
class="progress-bar-animate from-steel via-bermuda to-steel absolute top-0 left-0 h-full rounded-full bg-linear-to-r transition-all duration-1000"
|
||||||
style={`width: ${skill.level}%`}
|
style={`width: ${skill.level}%`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -70,13 +70,13 @@ const shadowClasses = 'shadow-xs hover:shadow-lg';
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Gradient overlays for smooth fade effect -->
|
<!-- Gradient overlays -->
|
||||||
<div
|
<div
|
||||||
class="absolute top-0 bottom-0 left-0 z-10 w-12 bg-gradient-to-r from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
class="absolute top-0 bottom-0 left-0 z-10 w-12 bg-linear-to-r from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="absolute top-0 right-0 bottom-0 z-10 w-12 bg-gradient-to-l from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
class="absolute top-0 right-0 bottom-0 z-10 w-12 bg-linear-to-l from-neutral-200 to-transparent sm:w-24 dark:from-stone-700"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -85,7 +85,7 @@ const shadowClasses = 'shadow-xs hover:shadow-lg';
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('astro:page-load', () => {
|
document.addEventListener('astro:page-load', () => {
|
||||||
// Create seamless infinite scrolling effect
|
// Create infinite scrolling effect
|
||||||
function setupInfiniteScroll() {
|
function setupInfiniteScroll() {
|
||||||
const cards = document.querySelectorAll('.skill-card');
|
const cards = document.querySelectorAll('.skill-card');
|
||||||
if (!cards.length) return;
|
if (!cards.length) return;
|
||||||
37
src/components/ui/sections/WeatherSection.astro
Normal file
37
src/components/ui/sections/WeatherSection.astro
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
import WeatherCard from '@components/ui/cards/WeatherCard.astro';
|
||||||
|
import { getFiveDayForecast } from '@support/weather';
|
||||||
|
|
||||||
|
const { latitude = "44.95", longitude = "-93.09", cityName = "St. Paul, Minnesota", timezone = "America/Chicago" } = Astro.props;
|
||||||
|
const { forecastDays, error } = await getFiveDayForecast(latitude, longitude, timezone);
|
||||||
|
---
|
||||||
|
|
||||||
|
<section class="mx-auto mb-20 max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14 2xl:max-w-full">
|
||||||
|
<div class="mx-auto mb-10 max-w-2xl text-center lg:mb-14">
|
||||||
|
<h1 class="card-text-header smooth-reveal block font-bold md:leading-tight">
|
||||||
|
Weather in my Area
|
||||||
|
</h1>
|
||||||
|
<div class="smooth-reveal mx-auto mt-5 max-w-3xl text-center">
|
||||||
|
<span class="card-text-header-description">
|
||||||
|
Five day forecast for {cityName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{error ? (
|
||||||
|
<div class="card-base p-10 text-accent text-center">
|
||||||
|
{error}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div class="flex flex-wrap justify-center gap-4 lg:gap-6">
|
||||||
|
{forecastDays.map((forecastDay) => (
|
||||||
|
<WeatherCard
|
||||||
|
dayName={forecastDay.dayName}
|
||||||
|
label={forecastDay.label}
|
||||||
|
icon={forecastDay.icon}
|
||||||
|
temp={forecastDay.temp}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
@@ -53,15 +53,15 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`;
|
|||||||
}
|
}
|
||||||
window.localStorage.setItem('theme', theme);
|
window.localStorage.setItem('theme', theme);
|
||||||
</script>
|
</script>
|
||||||
|
<!-- Rybbit Tracking Snippet -->
|
||||||
|
<script
|
||||||
|
src="https://rybbit.alexlebens.dev/api/script.js"
|
||||||
|
data-site-id={global.rybbit_site_id}
|
||||||
|
defer
|
||||||
|
></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-stone-200 selection:bg-yellow-400 selection:text-neutral-700 dark:bg-stone-700">
|
<body class="bg-stone-200 selection:bg-yellow-400 selection:text-neutral-700 dark:bg-stone-700">
|
||||||
<!-- <div class="fixed inset-0 -z-10">
|
<div class="mx-auto w-full max-w-(--breakpoint-2xl) grow px-4 sm:px-6 lg:px-8">
|
||||||
<div
|
|
||||||
class="bg-grid-pattern absolute inset-0 [mask-image:radial-gradient(white,transparent_85%)] bg-[center_top_-1px]"
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="mx-auto w-full max-w-(--breakpoint-2xl) flex-grow px-4 sm:px-6 lg:px-8">
|
|
||||||
<Header />
|
<Header />
|
||||||
<main class="min-h-screen">
|
<main class="min-h-screen">
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { createDirectus, rest } from '@directus/sdk';
|
|||||||
|
|
||||||
import type {
|
import type {
|
||||||
Global,
|
Global,
|
||||||
|
Weather,
|
||||||
Post,
|
Post,
|
||||||
Application,
|
Application,
|
||||||
Experience,
|
Experience,
|
||||||
@@ -15,6 +16,7 @@ import { getDirectusURL } from '@lib/directusFunctions';
|
|||||||
|
|
||||||
type Schema = {
|
type Schema = {
|
||||||
site_global: Global;
|
site_global: Global;
|
||||||
|
site_weather: Weather;
|
||||||
posts: Post[];
|
posts: Post[];
|
||||||
site_applications: Application;
|
site_applications: Application;
|
||||||
site_experience: Experience;
|
site_experience: Experience;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const getDirectusURL = () => {
|
|||||||
if (process.env.DIRECTUS_URL) {
|
if (process.env.DIRECTUS_URL) {
|
||||||
return `https://${process.env.DIRECTUS_URL}`;
|
return `https://${process.env.DIRECTUS_URL}`;
|
||||||
}
|
}
|
||||||
return 'https://directus.alexlebens.dev';
|
return 'https://directus.alexlebens.net';
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getDirectusImageURL(image: string) {
|
async function getDirectusImageURL(image: string) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export type Global = {
|
|||||||
initials: string;
|
initials: string;
|
||||||
email: string;
|
email: string;
|
||||||
site_url: string;
|
site_url: string;
|
||||||
|
rybbit_site_id: string;
|
||||||
logo: string;
|
logo: string;
|
||||||
portrait: string;
|
portrait: string;
|
||||||
portrait_alt: string;
|
portrait_alt: string;
|
||||||
@@ -23,6 +24,14 @@ export type Global = {
|
|||||||
footer_image_alt: string;
|
footer_image_alt: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type Weather = {
|
||||||
|
id: string;
|
||||||
|
location: string;
|
||||||
|
latitude: string;
|
||||||
|
longitude: string;
|
||||||
|
timezone: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type Post = {
|
export type Post = {
|
||||||
slug: string;
|
slug: string;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -73,6 +82,8 @@ export type Education = {
|
|||||||
area: string;
|
area: string;
|
||||||
studyType: string;
|
studyType: string;
|
||||||
graduationDate: string;
|
graduationDate: string;
|
||||||
|
logo: string;
|
||||||
|
logoDark: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Certificate = {
|
export type Certificate = {
|
||||||
@@ -81,6 +92,7 @@ export type Certificate = {
|
|||||||
issuer: string;
|
issuer: string;
|
||||||
issuerDate: string;
|
issuerDate: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
logoName: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Project = {
|
export type Project = {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<section class="mt-20 grid place-content-center">
|
<section class="mt-20 grid place-content-center">
|
||||||
<div class="mx-auto max-w-screen-xl px-4 py-8 lg:px-6 lg:py-16">
|
<div class="mx-auto max-w-7xl px-4 py-8 lg:px-6 lg:py-16">
|
||||||
<div class="mx-auto max-w-screen-sm text-center">
|
<div class="mx-auto max-w-screen-sm text-center">
|
||||||
<div class="glitch-wrapper smooth-reveal">
|
<div class="glitch-wrapper smooth-reveal">
|
||||||
<h1
|
<h1
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import directus from '@lib/directus';
|
|||||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||||
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
||||||
import Experience from '@components/ui/sections/Experience.astro';
|
import Experience from '@components/ui/sections/Experience.astro';
|
||||||
import Projects from '@components/ui/sections/Projects.astro';
|
import EducationSection from '@components/ui/sections/EducationSection.astro';
|
||||||
import Skills from '@components/ui/sections/Skills.astro';
|
import ProjectSection from '@components/ui/sections/ProjectSection.astro';
|
||||||
import Education from '@components/ui/sections/Education.astro';
|
import SkillsSlider from '@components/ui/sections/SkillsSlider.astro';
|
||||||
|
|
||||||
import portraitImg from '@images/portrait.avif';
|
import portraitImg from '@images/portrait.avif';
|
||||||
|
|
||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
@@ -32,6 +33,7 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
<HeroSection
|
<HeroSection
|
||||||
title="About Me"
|
title="About Me"
|
||||||
subTitle={global.about}
|
subTitle={global.about}
|
||||||
@@ -40,23 +42,21 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
rounded={true}
|
rounded={true}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="mx-auto max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
|
<section class="mx-auto max-w-7xl px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
|
||||||
<main class="relative grid grid-cols-1 md:grid-cols-6 gap-12 p-8 md:p-16 xl:gap-24 max-w-7xl mx-auto">
|
<div class="flex flex-col gap-y-24 md:gap-y-32">
|
||||||
<div class="space-y-12 col-span-1 md:col-span-6">
|
<Experience className="smooth-reveal" />
|
||||||
<Experience className="smooth-reveal-2" />
|
<EducationSection className="smooth-reveal" />
|
||||||
<Education className="smooth-reveal-2 mt-30" />
|
<ProjectSection className="smooth-reveal" />
|
||||||
<Projects className="smooth-reveal-2 mt-30" />
|
<SkillsSlider className="smooth-reveal" />
|
||||||
<Skills className="smooth-reveal-2 mt-30" />
|
</div>
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Add smooth reveal animations for content after loading
|
// Add smooth reveal animations for content after loading
|
||||||
document.addEventListener('astro:page-load', () => {
|
document.addEventListener('astro:page-load', () => {
|
||||||
const animateContent = () => {
|
const animateContent = () => {
|
||||||
// Animate group 1
|
|
||||||
const smoothReveal = document.querySelectorAll('.smooth-reveal');
|
const smoothReveal = document.querySelectorAll('.smooth-reveal');
|
||||||
smoothReveal.forEach((el, index) => {
|
smoothReveal.forEach((el, index) => {
|
||||||
setTimeout(
|
setTimeout(
|
||||||
@@ -67,28 +67,6 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Animate group 2
|
|
||||||
const smoothReveal2 = document.querySelectorAll('.smooth-reveal-2');
|
|
||||||
smoothReveal2.forEach((el, index) => {
|
|
||||||
setTimeout(
|
|
||||||
() => {
|
|
||||||
el.classList.add('animate-reveal');
|
|
||||||
},
|
|
||||||
200 + index * 250
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Animate topic cards with staggered delay
|
|
||||||
const smoothRevealCards = document.querySelectorAll('.smooth-reveal-cards');
|
|
||||||
smoothRevealCards.forEach((el, index) => {
|
|
||||||
setTimeout(
|
|
||||||
() => {
|
|
||||||
el.classList.add('animate-reveal');
|
|
||||||
},
|
|
||||||
400 + index * 250
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Animate with just fade in with staggered delay
|
// Animate with just fade in with staggered delay
|
||||||
const smoothRevealFade = document.querySelectorAll('.smooth-reveal-fade');
|
const smoothRevealFade = document.querySelectorAll('.smooth-reveal-fade');
|
||||||
smoothRevealFade.forEach((el, index) => {
|
smoothRevealFade.forEach((el, index) => {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { readSingleton } from '@directus/sdk';
|
|||||||
import directus from '@lib/directus';
|
import directus from '@lib/directus';
|
||||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||||
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
||||||
import Applications from '@components/ui/sections/Applications.astro';
|
import ApplicationSection from '@components/ui/sections/ApplicationSection.astro';
|
||||||
|
|
||||||
import applicationImg from '@images/cedar_tree.png';
|
import applicationImg from '@images/cedar_tree.png';
|
||||||
|
|
||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
@@ -29,6 +30,7 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
<HeroSection
|
<HeroSection
|
||||||
title="Applications"
|
title="Applications"
|
||||||
subTitle={global.about_applications}
|
subTitle={global.about_applications}
|
||||||
@@ -36,13 +38,8 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
alt={global.applications_image_alt}
|
alt={global.applications_image_alt}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="mx-auto max-w-340 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
|
<ApplicationSection className="smooth-reveal-2" />
|
||||||
<main class="relative grid grid-cols-1 md:grid-cols-6 gap-12 p-8 md:p-16 xl:gap-24 max-w-7xl mx-auto">
|
|
||||||
<div class="space-y-12 col-span-1 md:col-span-6">
|
|
||||||
<Applications className="smooth-reveal-2" />
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</section>
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ const content = marked.parse(post.content);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<article
|
<article
|
||||||
class="prose prose-blog sm:prose-lg dark:prose-invert max-w-none text-justify text-neutral-800 dark:text-neutral-200"
|
class="prose prose-blog sm:prose-lg dark:prose-invert max-w-none text-neutral-800 dark:text-neutral-200"
|
||||||
>
|
>
|
||||||
<div set:html={content} />
|
<div set:html={content} />
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ import directus from '@lib/directus';
|
|||||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||||
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
import HeroSection from '@components/ui/sections/HeroSection.astro';
|
||||||
import FeaturesSection from '@components/ui/sections/FeaturesSection.astro';
|
import FeaturesSection from '@components/ui/sections/FeaturesSection.astro';
|
||||||
|
import WeatherSection from '@components/ui/sections/WeatherSection.astro';
|
||||||
import LatestPosts from '@components/ui/sections/LatestPosts.astro';
|
import LatestPosts from '@components/ui/sections/LatestPosts.astro';
|
||||||
import HeroSectionAlt from '@components/ui/sections/HeroSectionAlt.astro';
|
import HeroSectionAlt from '@components/ui/sections/HeroSectionAlt.astro';
|
||||||
import homeImg from '@images/autumn_mountain.png';
|
import homeImg from '@images/autumn_mountain.png';
|
||||||
|
|
||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
|
const weather = await directus.request(readSingleton('site_weather'));
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout
|
<BaseLayout
|
||||||
@@ -42,6 +44,15 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
|
|
||||||
<FeaturesSection />
|
<FeaturesSection />
|
||||||
|
|
||||||
|
<WeatherSection
|
||||||
|
server:defer
|
||||||
|
latitude={weather.latitude}
|
||||||
|
longitude={weather.longitude}
|
||||||
|
cityName={weather.location}
|
||||||
|
timezone={weather.timezone}
|
||||||
|
>
|
||||||
|
</WeatherSection>
|
||||||
|
|
||||||
<LatestPosts />
|
<LatestPosts />
|
||||||
|
|
||||||
<HeroSectionAlt
|
<HeroSectionAlt
|
||||||
@@ -101,5 +112,11 @@ const global = await directus.request(readSingleton('site_global'));
|
|||||||
};
|
};
|
||||||
|
|
||||||
animateContent();
|
animateContent();
|
||||||
|
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
animateContent();
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document.body, { childList: true, subtree: true });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,6 +17,13 @@
|
|||||||
--color-bronze: #9e7f5e;
|
--color-bronze: #9e7f5e;
|
||||||
--color-gitea-primary: #609926;
|
--color-gitea-primary: #609926;
|
||||||
--color-gitea-secondary: #4c7a33;
|
--color-gitea-secondary: #4c7a33;
|
||||||
|
|
||||||
|
--color-main: light-dark(var(--color-steel), var(--color-bermuda));
|
||||||
|
--color-accent: light-dark(var(--color-bronze), var(--color-desert));
|
||||||
|
|
||||||
|
--color-header: light-dark(var(--color-neutral-800), var(--color-neutral-200));
|
||||||
|
--color-primary: light-dark(var(--color-neutral-600), var(--color-neutral-200));
|
||||||
|
--color-secondary: light-dark(var(--color-neutral-500), var(--color-neutral-400));
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
@@ -24,6 +31,11 @@
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
--theme-transition: 0.3s ease;
|
--theme-transition: 0.3s ease;
|
||||||
|
color-scheme: light;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root:where(.dark, .dark *) {
|
||||||
|
color-scheme: dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
*,
|
*,
|
||||||
@@ -86,6 +98,63 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@utility card-base {
|
||||||
|
@apply rounded-xl transition-all duration-300
|
||||||
|
border border-neutral-100 dark:border-stone-500/20
|
||||||
|
bg-neutral-100/80 hover:bg-neutral-100 dark:bg-neutral-800/60 dark:hover:bg-neutral-800/90
|
||||||
|
shadow-xs hover:shadow-md dark:shadow-md dark:hover:shadow-lg
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-hover-icon-color {
|
||||||
|
@apply transition-all duration-300
|
||||||
|
text-primary
|
||||||
|
group-hover:text-main
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-hover-icon-scale {
|
||||||
|
@apply transition-all duration-300
|
||||||
|
drop-shadow-sm
|
||||||
|
group-hover:scale-110
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-text-header {
|
||||||
|
@apply text-header
|
||||||
|
md:text-5xl
|
||||||
|
text-4xl
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-text-header-minor {
|
||||||
|
@apply text-header
|
||||||
|
md:text-3xl
|
||||||
|
text-2xl
|
||||||
|
font-semibold
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-text-header-description {
|
||||||
|
@apply text-primary
|
||||||
|
text-lg
|
||||||
|
text-pretty
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-text-title {
|
||||||
|
@apply text-primary
|
||||||
|
font-bold
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-text-description {
|
||||||
|
@apply text-secondary
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-hover-text-title {
|
||||||
|
@apply transition-all duration-300
|
||||||
|
group-hover:text-main
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility card-hover-text-gitea {
|
||||||
|
@apply transition-all duration-300
|
||||||
|
group-hover:text-gitea-primary
|
||||||
|
}
|
||||||
|
|
||||||
/* Content reveal animations */
|
/* Content reveal animations */
|
||||||
.smooth-reveal,
|
.smooth-reveal,
|
||||||
.smooth-reveal-2,
|
.smooth-reveal-2,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
|
|
||||||
export interface BlurImageMetadata {
|
interface BlurImageMetadata {
|
||||||
/**
|
/**
|
||||||
* The width of the origin image
|
* The width of the origin image
|
||||||
*/
|
*/
|
||||||
@@ -23,7 +23,7 @@ export interface BlurImageMetadata {
|
|||||||
blurHeight: number;
|
blurHeight: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function blurStyle(filePath: string) {
|
async function blurStyle(filePath: string) {
|
||||||
const image = await blurImageMetadata(filePath);
|
const image = await blurImageMetadata(filePath);
|
||||||
const svg = blurImageSVG(image);
|
const svg = blurImageSVG(image);
|
||||||
return {
|
return {
|
||||||
@@ -64,3 +64,5 @@ async function blurImageMetadata(filepath: string): Promise<BlurImageMetadata> {
|
|||||||
|
|
||||||
return { blurDataURL, blurHeight, blurWidth, width, height };
|
return { blurDataURL, blurHeight, blurWidth, width, height };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export { blurStyle };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
|
||||||
export function resolveFilePath(path: string) {
|
function resolveFilePath(path: string) {
|
||||||
if (path.startsWith('/')) {
|
if (path.startsWith('/')) {
|
||||||
return resolveFilePathPublic(path);
|
return resolveFilePathPublic(path);
|
||||||
}
|
}
|
||||||
@@ -8,12 +8,14 @@ export function resolveFilePath(path: string) {
|
|||||||
return resolveFilePathInternal(path);
|
return resolveFilePathInternal(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveFilePathPublic(path: string) {
|
function resolveFilePathPublic(path: string) {
|
||||||
return join(process.cwd(), path);
|
return join(process.cwd(), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveFilePathInternal(path: string) {
|
function resolveFilePathInternal(path: string) {
|
||||||
const normalizePath = path.startsWith('@') ? path.replace('@', '') : path;
|
const normalizePath = path.startsWith('@') ? path.replace('@', '') : path;
|
||||||
|
|
||||||
return join(process.cwd(), 'src/', normalizePath);
|
return join(process.cwd(), 'src/', normalizePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export { resolveFilePath, resolveFilePathPublic, resolveFilePathInternal };
|
||||||
|
|||||||
65
src/support/weather.ts
Normal file
65
src/support/weather.ts
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
interface DayForecast {
|
||||||
|
date: string;
|
||||||
|
temp: number;
|
||||||
|
code: number;
|
||||||
|
label: string;
|
||||||
|
icon: string;
|
||||||
|
dayName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface WeatherResult {
|
||||||
|
forecastDays: DayForecast[];
|
||||||
|
error: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const getWeatherInfo = (code: number) => {
|
||||||
|
if (code === 0) return { label: 'Clear', icon: '01d' };
|
||||||
|
if (code >= 1 && code <= 3) return { label: 'Partly Cloudy', icon: '02d' };
|
||||||
|
if (code === 45 || code === 48) return { label: 'Foggy', icon: '50d' };
|
||||||
|
if (code >= 51 && code <= 55) return { label: 'Drizzle', icon: '09d' };
|
||||||
|
if (code >= 61 && code <= 65) return { label: 'Rainy', icon: '10d' };
|
||||||
|
if (code === 66 || code === 67) return { label: 'Freezing Rain', icon: '13d' };
|
||||||
|
if (code >= 71 && code <= 75) return { label: 'Snowy', icon: '13d' };
|
||||||
|
if (code === 77) return { label: 'Snow Grains', icon: '13d' };
|
||||||
|
if (code >= 80 && code <= 82) return { label: 'Showers', icon: '09d' };
|
||||||
|
if (code === 85 || code === 86) return { label: 'Snow Showers', icon: '13d' };
|
||||||
|
if (code >= 95 && code <= 99) return { label: 'Stormy', icon: '11d' };
|
||||||
|
|
||||||
|
return { label: 'Unknown', icon: '03d' };
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getDayName = (dateStr: string) => {
|
||||||
|
const date = new Date(`${dateStr}T00:00:00`);
|
||||||
|
return date.toLocaleDateString('en-US', { weekday: 'short' });
|
||||||
|
};
|
||||||
|
|
||||||
|
async function getFiveDayForecast(latitude: string, longitude: string, timezone: string): Promise<WeatherResult> {
|
||||||
|
const url = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&daily=weather_code,temperature_2m_max&timezone=${timezone}&temperature_unit=fahrenheit`;
|
||||||
|
let data: any;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(url);
|
||||||
|
if (!response.ok) throw new Error("Weather service unavailable");
|
||||||
|
data = await response.json();
|
||||||
|
|
||||||
|
} catch (e: unknown) {
|
||||||
|
return { forecastDays: [], error: "Failed to load weather" };
|
||||||
|
}
|
||||||
|
|
||||||
|
const forecastDays = data.daily.time
|
||||||
|
.slice(0, 5)
|
||||||
|
.map((date: string, index: number): DayForecast => {
|
||||||
|
return {
|
||||||
|
date,
|
||||||
|
temp: Math.round(data.daily.temperature_2m_max[index]),
|
||||||
|
code: data.daily.weather_code[index],
|
||||||
|
label: getWeatherInfo(data.daily.weather_code[index]).label,
|
||||||
|
icon: getWeatherInfo(data.daily.weather_code[index]).icon,
|
||||||
|
dayName: getDayName(date)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return { forecastDays, error: null };
|
||||||
|
}
|
||||||
|
|
||||||
|
export { getFiveDayForecast };
|
||||||
Reference in New Issue
Block a user