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

52
seed-all.cjs Normal file
View File

@@ -0,0 +1,52 @@
const seed = require('./seed/seed.json');
const Database = require('better-sqlite3');
const db = new Database('./data.db');
// Helper to get current timestamp
const now = new Date().toISOString();
// 1. Seed Pages
const insertPage = db.prepare(`
INSERT OR REPLACE INTO ec_pages (id, slug, status, locale, title, subtitle, badge, hero_image, theme, show_cta, cta_text, cta_link, variant, size, created_at, updated_at, published_at)
VALUES (?, ?, 'published', 'th', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`);
(seed.content?.pages || []).forEach(p => {
insertPage.run(p.id, p.slug, p.data.title, p.data.subtitle, p.data.badge, p.data.hero_image, p.data.theme, p.data.show_cta ? 1 : 0, p.data.cta_text, p.data.cta_link, p.data.variant, p.data.size, now, now, now);
});
console.log('Pages seeded:', db.prepare('SELECT COUNT(*) as c FROM ec_pages').get().c);
// 2. Seed Portfolio
const insertPortfolio = db.prepare(`
INSERT OR REPLACE INTO ec_portfolio (id, slug, status, locale, name, url, category, category_label, thumbnail, description, created_at, updated_at, published_at)
VALUES (?, ?, 'published', 'th', ?, ?, ?, ?, ?, ?, ?, ?, ?)
`);
(seed.content?.portfolio || []).forEach((p, i) => {
const pid = p.id || `portfolio-${String(i + 1).padStart(3, '0')}`;
insertPortfolio.run(pid, p.slug, p.data.name, p.data.url, p.data.category, p.data.category_label, p.data.thumbnail, p.data.description, now, now, now);
});
console.log('Portfolio seeded:', db.prepare('SELECT COUNT(*) as c FROM ec_portfolio').get().c);
// 3. Seed Blog
const insertBlog = db.prepare(`
INSERT OR REPLACE INTO ec_blog (id, slug, status, locale, title, excerpt, image, date, category, content, created_at, updated_at, published_at)
VALUES (?, ?, 'published', 'th', ?, ?, ?, ?, ?, ?, ?, ?, ?)
`);
(seed.content?.blog || []).forEach((p, i) => {
const bid = p.id || `blog-${String(i + 1).padStart(3, '0')}`;
insertBlog.run(bid, p.slug, p.data.title, p.data.excerpt, p.data.image, p.data.date, p.data.category, JSON.stringify(p.data.content), now, now, now);
});
console.log('Blog seeded:', db.prepare('SELECT COUNT(*) as c FROM ec_blog').get().c);
// 4. Seed FAQ
const insertFaq = db.prepare(`
INSERT OR REPLACE INTO ec_faq (id, slug, status, locale, category, question, answer, created_at, updated_at)
VALUES (?, ?, 'published', 'th', ?, ?, ?, ?, ?)
`);
(seed.content?.faq || []).forEach((p, i) => {
const fid = p.id || `faq-${String(i + 1).padStart(3, '0')}`;
insertFaq.run(fid, p.slug || fid, p.data.category, p.data.question, p.data.answer, now, now);
});
console.log('FAQ seeded:', db.prepare('SELECT COUNT(*) as c FROM ec_faq').get().c);
db.close();
console.log('All seeding complete!');