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:
@@ -1,147 +1,58 @@
|
||||
---
|
||||
import Base from '../../layouts/Base.astro';
|
||||
import Navigation from '../../components/Navigation.astro';
|
||||
import Hero from '../../components/Hero.astro';
|
||||
import Footer from '../../components/Footer.astro';
|
||||
import PageHero from '../../components/PageHero.astro';
|
||||
import BlogCard from '../../components/BlogCard.astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
const blogPosts = [
|
||||
{
|
||||
slug: "5-ways-ai-increase-sales",
|
||||
title: "5 วิธี AI เพิ่มยอดขาย",
|
||||
excerpt: "เรียนรู้ 5 วิธีที่ AI สามารถช่วยเพิ่มยอดขายของคุณได้อย่างมีประสิทธิภาพ",
|
||||
image: "/images/blog/5-ways-ai-increase-sales.jpg",
|
||||
date: "2026-01-15",
|
||||
category: "AI"
|
||||
},
|
||||
{
|
||||
slug: "ai-content-google-love",
|
||||
title: "AI Content ที่ Google รัก",
|
||||
excerpt: "วิธีสร้าง AI Content ที่ท z้ both user-friendly และ SEO-friendly",
|
||||
image: "/images/blog/ai-content-google-love.jpg",
|
||||
date: "2026-01-10",
|
||||
category: "AI"
|
||||
},
|
||||
{
|
||||
slug: "ai-for-sme-thailand",
|
||||
title: "AI สำหรับ SME ไทย",
|
||||
excerpt: "คู่มือการใช้ AI สำหรับธุรกิจ SME ไทยเพื่อเพิ่มขีดความสามารถในการแข่งขัน",
|
||||
image: "/images/blog/ai-for-sme-thailand.jpg",
|
||||
date: "2026-01-05",
|
||||
category: "AI"
|
||||
},
|
||||
{
|
||||
slug: "back-office-automation",
|
||||
title: "Back Office Automation",
|
||||
excerpt: "ลดต้นทุนและเพิ่มประสิทธิภาพด้วยระบบอัตโนมัติ",
|
||||
image: "/images/blog/back-office-automation.jpg",
|
||||
date: "2025-12-28",
|
||||
category: "Automation"
|
||||
},
|
||||
{
|
||||
slug: "chatbot-business-case-study",
|
||||
title: "Chatbot Business Case Study",
|
||||
excerpt: "กรณีศึกษาการใช้ Chatbot เพื่อเพิ่มยอดขายและลดต้นทุนการให้บริการ",
|
||||
image: "/images/blog/chatbot-business-case-study.jpg",
|
||||
date: "2025-12-20",
|
||||
category: "Chatbot"
|
||||
},
|
||||
{
|
||||
slug: "data-driven-marketing",
|
||||
title: "Data Driven Marketing",
|
||||
excerpt: "การตลาดที่ขับเคลื่อนด้วยข้อมูลเพื่อผลลัพธ์ที่ดีที่สุด",
|
||||
image: "/images/blog/data-driven-marketing.jpg",
|
||||
date: "2025-12-15",
|
||||
category: "Marketing"
|
||||
},
|
||||
{
|
||||
slug: "digital-transformation-guide",
|
||||
title: "Digital Transformation Guide",
|
||||
excerpt: "คู่มือฉบับสมบูรณ์สำหรับการ transform ธุรกิจของคุณสู่ดิจิทัล",
|
||||
image: "/images/blog/digital-transformation.jpg",
|
||||
date: "2025-12-10",
|
||||
category: "Business"
|
||||
},
|
||||
{
|
||||
slug: "marketing-automation-guide",
|
||||
title: "Marketing Automation Guide",
|
||||
excerpt: "เรียนรู้พื้นฐานของ Marketing Automation และวิธีเริ่มต้น",
|
||||
image: "/images/blog/marketing-automation-guide.jpg",
|
||||
date: "2025-12-05",
|
||||
category: "Marketing"
|
||||
},
|
||||
{
|
||||
slug: "seo-2026-business-guide",
|
||||
title: "SEO 2026 Business Guide",
|
||||
excerpt: "การทำ SEO สำหรับธุรกิจในยุค 2026 ต้องรู้อะไรบ้าง",
|
||||
image: "/images/blog/seo-2026-business-guide.jpg",
|
||||
date: "2025-11-28",
|
||||
category: "SEO"
|
||||
},
|
||||
{
|
||||
slug: "website-2026-must-have",
|
||||
title: "Website 2026 Must Have",
|
||||
excerpt: "ฟีเจอร์ที่เว็บไซต์ต้องมีในปี 2026",
|
||||
image: "/images/blog/website-2026-must-have.jpg",
|
||||
date: "2025-11-20",
|
||||
category: "Web Dev"
|
||||
}
|
||||
];
|
||||
|
||||
const categories = ["ทั้งหมด", "AI", "Marketing", "Automation", "SEO", "Web Dev", "Business", "Chatbot"];
|
||||
|
||||
function formatDate(dateStr: string) {
|
||||
const date = new Date(dateStr);
|
||||
return date.toLocaleDateString('th-TH', { year: 'numeric', month: 'long', day: 'numeric' });
|
||||
}
|
||||
const blogPosts = await getCollection('blog');
|
||||
const sortedPosts = blogPosts.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
|
||||
---
|
||||
|
||||
<Base title="บทความ | MoreminiMore">
|
||||
<Base title="บทความ | MoreminiMore - รับทำเว็บไซต์ SEO AI Chatbot">
|
||||
<Navigation />
|
||||
|
||||
<!-- Hero Section -->
|
||||
<Hero
|
||||
title="ความรู้ด้านดิจิทัล"
|
||||
subtitle="อ่านบทความล่าสุดเกี่ยวกับ AI, Marketing และเทคโนโลยีสำหรับธุรกิจ"
|
||||
<PageHero
|
||||
badge="บทความ"
|
||||
image="/images/hero/blog-hero.jpg"
|
||||
theme="yellow"
|
||||
showCTA={false}
|
||||
variant="centered"
|
||||
size="compact"
|
||||
title="บทความ"
|
||||
subtitle="ความรู้ด้านดิจิทัลและเทคนิคใหม่ๆ สำหรับธุรกิจไทย"
|
||||
/>
|
||||
|
||||
<!-- Blog Section -->
|
||||
<section class="section blog-section">
|
||||
<div class="container">
|
||||
<!-- Featured Post -->
|
||||
<div class="featured-post">
|
||||
<a href={`/blog/${blogPosts[0].slug}`} class="featured-card">
|
||||
<!-- Featured Post -->
|
||||
{sortedPosts.length > 0 && (
|
||||
<section class="section featured-section">
|
||||
<div class="container">
|
||||
<a href={`/blog/${sortedPosts[0].id}`} class="featured-card">
|
||||
<div class="featured-image">
|
||||
<img src={blogPosts[0].image} alt={blogPosts[0].title} />
|
||||
{sortedPosts[0].data.image && (
|
||||
<img src={sortedPosts[0].data.image} alt={sortedPosts[0].data.title} loading="eager" />
|
||||
)}
|
||||
</div>
|
||||
<div class="featured-content">
|
||||
<span class="category-badge">{blogPosts[0].category}</span>
|
||||
<h2 class="featured-title">{blogPosts[0].title}</h2>
|
||||
<p class="featured-excerpt">{blogPosts[0].excerpt}</p>
|
||||
<span class="category-badge">{sortedPosts[0].data.category}</span>
|
||||
<h2 class="featured-title">{sortedPosts[0].data.title}</h2>
|
||||
<p class="featured-excerpt">{sortedPosts[0].data.excerpt}</p>
|
||||
<span class="read-more">อ่านต่อ →</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<!-- Blog Grid -->
|
||||
<!-- Blog Grid -->
|
||||
<section class="section blog-section">
|
||||
<div class="container">
|
||||
<div class="blog-grid">
|
||||
{blogPosts.slice(1).map((post) => (
|
||||
<a href={`/blog/${post.slug}`} class="blog-card card">
|
||||
<div class="blog-image">
|
||||
<img src={post.image} alt={post.title} loading="lazy" />
|
||||
</div>
|
||||
<div class="blog-content">
|
||||
<span class="category-badge">{post.category}</span>
|
||||
<h3 class="blog-title">{post.title}</h3>
|
||||
<p class="blog-excerpt">{post.excerpt}</p>
|
||||
<span class="blog-date">{formatDate(post.date)}</span>
|
||||
</div>
|
||||
</a>
|
||||
{sortedPosts.slice(1).map((post, i) => (
|
||||
<BlogCard
|
||||
title={post.data.title}
|
||||
excerpt={post.data.excerpt}
|
||||
image={post.data.image}
|
||||
date={post.data.date}
|
||||
slug={post.id}
|
||||
category={post.data.category}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -162,182 +73,99 @@ function formatDate(dateStr: string) {
|
||||
</Base>
|
||||
|
||||
<style>
|
||||
|
||||
.blog-section {
|
||||
.featured-section {
|
||||
background: var(--color-white);
|
||||
padding-top: 80px;
|
||||
}
|
||||
|
||||
.featured-post {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.featured-card {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 1fr;
|
||||
gap: 48px;
|
||||
background: var(--color-light-gray);
|
||||
gap: 0;
|
||||
background: var(--color-dark);
|
||||
border-radius: 24px;
|
||||
overflow: hidden;
|
||||
transition: transform 0.4s ease;
|
||||
}
|
||||
|
||||
.featured-card:hover { transform: scale(1.01); }
|
||||
.featured-image {
|
||||
aspect-ratio: 16/10;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.featured-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s;
|
||||
transition: transform 0.5s ease;
|
||||
}
|
||||
|
||||
.featured-card:hover .featured-image img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.featured-card:hover .featured-image img { transform: scale(1.05); }
|
||||
.featured-content {
|
||||
padding: 48px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.category-badge {
|
||||
display: inline-block;
|
||||
background: var(--color-primary);
|
||||
color: var(--color-black);
|
||||
padding: 6px 16px;
|
||||
border-radius: 20px;
|
||||
padding: 6px 14px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
align-self: flex-start;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.featured-title {
|
||||
font-size: 32px;
|
||||
font-size: clamp(24px, 3vw, 32px);
|
||||
font-weight: 700;
|
||||
color: var(--color-white);
|
||||
margin-bottom: 16px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.featured-excerpt {
|
||||
font-size: 16px;
|
||||
color: var(--color-medium-gray);
|
||||
font-size: 15px;
|
||||
color: rgba(255,255,255,0.6);
|
||||
line-height: 1.7;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.read-more {
|
||||
color: var(--color-primary);
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.blog-section { background: var(--color-gray-100); }
|
||||
.blog-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 32px;
|
||||
}
|
||||
|
||||
.blog-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.blog-image {
|
||||
aspect-ratio: 16/10;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.blog-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s;
|
||||
}
|
||||
|
||||
.blog-card:hover .blog-image img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.blog-content {
|
||||
padding: 24px;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.blog-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.blog-excerpt {
|
||||
font-size: 14px;
|
||||
color: var(--color-medium-gray);
|
||||
line-height: 1.6;
|
||||
margin-bottom: 16px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.blog-date {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.cta-section {
|
||||
padding: 100px 0;
|
||||
}
|
||||
|
||||
.cta-content {
|
||||
text-align: center;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.section-primary { background: var(--color-primary); }
|
||||
.cta-content { text-align: center; }
|
||||
.cta-title {
|
||||
font-size: clamp(28px, 4vw, 40px);
|
||||
font-size: clamp(28px, 4vw, 42px);
|
||||
font-weight: 800;
|
||||
margin-bottom: 16px;
|
||||
color: var(--color-black);
|
||||
}
|
||||
|
||||
.cta-desc {
|
||||
font-size: 18px;
|
||||
color: rgba(0,0,0,0.7);
|
||||
margin-bottom: 32px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
padding: 18px 40px;
|
||||
font-size: 16px;
|
||||
max-width: 500px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.btn-lg { padding: 16px 36px; font-size: 16px; }
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.featured-card {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.blog-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.featured-card { grid-template-columns: 1fr; }
|
||||
.featured-image { aspect-ratio: 16/7; }
|
||||
.blog-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.blog-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.featured-content {
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
.featured-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
.blog-grid { grid-template-columns: 1fr; }
|
||||
.featured-content { padding: 32px; }
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user