From 09fdbf7ec792c47609ffd90b5df0f5d326f2ab4a Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Sat, 24 Jan 2026 18:57:44 -0700 Subject: [PATCH] Updated nav a bit --- astro.config.mjs | 3 +- src/components/NavigationBar.vue | 6 -- src/components/ResumeDownloadButton.vue | 93 ++++++++++++------------- src/components/ResumeSkills.vue | 4 +- src/components/TechLinks.astro | 1 - src/config.ts | 16 ++--- src/pages/api/posts.json.ts | 29 ++++---- 7 files changed, 69 insertions(+), 83 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 2fa9c69..82a6984 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -21,7 +21,6 @@ export default defineConfig({ plugins: [tailwindcss()], }, - // Configure default image behavior image: { responsiveStyles: true, layout: "constrained", @@ -58,7 +57,7 @@ export default defineConfig({ "gitea", "bluesky", "react", - "vue", + "vuedotjs", "typescript", "astro", "go", diff --git a/src/components/NavigationBar.vue b/src/components/NavigationBar.vue index 24e3013..63734f7 100644 --- a/src/components/NavigationBar.vue +++ b/src/components/NavigationBar.vue @@ -11,14 +11,12 @@ const isVisible = ref(true); const isScrolling = ref(false); const currentClientPath = ref(props.currentPath); -// Filter out disabled navigation items const enabledNavigationItems = config.navigationItems.filter( (item) => item.enabled !== false, ); const activePath = computed(() => currentClientPath.value); -// Normalize path const normalizedPath = computed(() => { const path = activePath.value; return path.endsWith("/") && path.length > 1 ? path.slice(0, -1) : path; @@ -30,7 +28,6 @@ const updatePath = () => { } }; -// Scroll handling let lastScrollY = 0; let ticking = false; let scrollTimer: ReturnType | undefined; @@ -38,12 +35,9 @@ let scrollTimer: ReturnType | undefined; const updateScroll = () => { const currentScrollY = window.scrollY; - // Always show near top if (currentScrollY < 50) { isVisible.value = true; } else { - // Show if scrolling up, hide if scrolling down - // Only update if position actually changed to avoid jitter if (Math.abs(currentScrollY - lastScrollY) > 0) { isVisible.value = currentScrollY < lastScrollY; } diff --git a/src/components/ResumeDownloadButton.vue b/src/components/ResumeDownloadButton.vue index a2bb33f..e37918e 100644 --- a/src/components/ResumeDownloadButton.vue +++ b/src/components/ResumeDownloadButton.vue @@ -1,62 +1,59 @@ diff --git a/src/components/ResumeSkills.vue b/src/components/ResumeSkills.vue index 5d20c42..2ba14c9 100644 --- a/src/components/ResumeSkills.vue +++ b/src/components/ResumeSkills.vue @@ -18,7 +18,7 @@ let observer: IntersectionObserver | null = null; let animationFrameId: number | null = null; const animateSkills = () => { - const duration = 1000; // 1 second animation duration + const duration = 1000; const startTime = performance.now(); const animate = (currentTime: number) => { @@ -26,7 +26,6 @@ const animateSkills = () => { const progress = Math.min(elapsed / duration, 1); props.skills.forEach((skill) => { - // Linear interpolation from 0 to target level animatedLevels.value[skill.id] = skill.level * progress; }); @@ -46,7 +45,6 @@ onMounted(() => { hasAnimated.value = true; animateSkills(); - // Stop observing once triggered if (skillsSection.value && observer) { observer.unobserve(skillsSection.value); } diff --git a/src/components/TechLinks.astro b/src/components/TechLinks.astro index d832848..8833f64 100644 --- a/src/components/TechLinks.astro +++ b/src/components/TechLinks.astro @@ -2,7 +2,6 @@ import { Icon } from "astro-icon/components"; import { config } from "../config"; -// Helper function to check if icon is a string (Astro icon) function isAstroIcon(icon: any): icon is string { return typeof icon === "string"; } diff --git a/src/config.ts b/src/config.ts index 295d54a..e963ef2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -11,6 +11,7 @@ const RSS_ICON = "mdi:rss" as const; const GITEA_ICON = "simple-icons:gitea" as const; const BLUESKY_ICON = "simple-icons:bluesky" as const; const REACT_ICON = "simple-icons:react" as const; +const VUEJS_ICON = "simple-icons:vuedotjs" as const; const TYPESCRIPT_ICON = "simple-icons:typescript" as const; const ASTRO_ICON = "simple-icons:astro" as const; const GO_ICON = "simple-icons:go" as const; @@ -19,7 +20,6 @@ const DOTNET_ICON = "simple-icons:dotnet" as const; const DOCKER_ICON = "simple-icons:docker" as const; const KOTLIN_ICON = "simple-icons:kotlin" as const; const SWIFT_ICON = "simple-icons:swift" as const; -const FLUTTER_ICON = "simple-icons:flutter" as const; const NIX_ICON = "simple-icons:nixos" as const; export const config: Config = { @@ -272,6 +272,13 @@ export const config: Config = { icon: REACT_ICON, ariaLabel: "React", }, + { + id: "vuejs", + name: "Vue.js", + url: "https://vuejs.org//", + icon: VUEJS_ICON, + ariaLabel: "Vue.js", + }, { id: "typescript", name: "TypeScript", @@ -328,13 +335,6 @@ export const config: Config = { icon: SWIFT_ICON, ariaLabel: "Swift", }, - { - id: "flutter", - name: "Flutter", - url: "https://flutter.dev", - icon: FLUTTER_ICON, - ariaLabel: "Flutter", - }, { id: "nix", name: "Nix", diff --git a/src/pages/api/posts.json.ts b/src/pages/api/posts.json.ts index 465f0ab..098c4de 100644 --- a/src/pages/api/posts.json.ts +++ b/src/pages/api/posts.json.ts @@ -1,33 +1,32 @@ -import { getCollection } from 'astro:content'; -import type { APIRoute } from 'astro'; +import { getCollection } from "astro:content"; +import type { APIRoute } from "astro"; export const GET: APIRoute = async () => { try { - const posts = await getCollection('posts'); - - // Get the raw content from each post + const posts = await getCollection("posts"); + const postsWithContent = posts.map((post) => ({ - slug: post.slug, + slug: post.id, title: post.data.title, description: post.data.description, - pubDate: post.data.pubDate.toISOString().split('T')[0], + pubDate: post.data.pubDate.toISOString().split("T")[0], tags: post.data.tags || [], - content: post.body + content: post.body, })); - + return new Response(JSON.stringify(postsWithContent), { status: 200, headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }); } catch (error) { - console.error('Error fetching posts:', error); + console.error("Error fetching posts:", error); return new Response(JSON.stringify([]), { status: 500, headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }); } -}; \ No newline at end of file +};