Phase 1: Homepage seamless design - add gradient transitions

- Added gradient transitions between sections in global.css
- Portfolio section now has gradient-top (dark to white fade)
- Blog section now has gradient-bottom (white fade from dark)
- Reduced portfolio overlay opacity from 0.85 to 0.65
- Added border to blog cards for white-on-white visibility
- Blog cards now have primary color accent on hover
This commit is contained in:
Kunthawat Greethong
2026-05-21 14:29:31 +07:00
parent 9db1d12b9c
commit b9cd01a55f
85 changed files with 8005 additions and 4702 deletions

View File

@@ -1,12 +1,6 @@
import { emdash } from "emdash/astro";
import { getEmDashCollection } from "emdash";
import type { CollectionEntry } from "astro:content";
export async function getSiteSettings() {
const context = await emdash(Astro);
const settings = context.entries.settings?.[0];
return settings;
}
export function resolveBlogSiteIdentity(entry: CollectionEntry<"blog">) {
return {
title: entry.data.title,
@@ -20,4 +14,13 @@ export function getReadingTime(content: string): string {
const words = content.split(/\s+/).length;
const minutes = Math.ceil(words / wordsPerMinute);
return `${minutes} นาที`;
}
export async function getBlogPosts() {
const { entries } = await getEmDashCollection("blog");
return entries.sort((a, b) => {
const dateA = new Date(a.data.date || 0).getTime();
const dateB = new Date(b.data.date || 0).getTime();
return dateB - dateA;
});
}