feat: Update images with Unsplash (hero + illustrations), fix UX/UI, add animations
- Replace MiniMax images with Unsplash (free commercial use) - Hero images: marketing, AI automation, tech consult, web dev, about-us - Illustrations: different from heroes for all 4 service pages - Fix ตัวอย่างการใช้งาน section on marketing-automation - Update about-us with hero image - All images stored locally (not hotlinks)
This commit is contained in:
@@ -16,6 +16,20 @@ const sortedPosts = allPosts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pu
|
||||
const categories = [...new Set(allPosts.map(post => post.data.category))];
|
||||
const tags = [...new Set(allPosts.flatMap(post => post.data.tags))];
|
||||
|
||||
// Map blog slugs to feature images
|
||||
const featureImages: Record<string, string> = {
|
||||
'5-ways-ai-increase-sales': '/images/blog/ai-sales-growth.jpg',
|
||||
'ai-content-google-love': '/images/blog/ai-content-seo.jpg',
|
||||
'ai-for-sme-thailand': '/images/blog/ai-sme-thailand.jpg',
|
||||
'back-office-automation': '/images/blog/office-automation.jpg',
|
||||
'chatbot-business-case-study': '/images/blog/chatbot-business.jpg',
|
||||
'data-driven-marketing': '/images/blog/data-marketing.jpg',
|
||||
'digital-transformation-guide': '/images/blog/digital-transformation.jpg',
|
||||
'marketing-automation-guide': '/images/blog/marketing-automation.jpg',
|
||||
'seo-2026-business-guide': '/images/blog/seo-guide.jpg',
|
||||
'website-2026-must-have': '/images/blog/website-2026.jpg',
|
||||
};
|
||||
|
||||
const formatDate = (date: Date) => {
|
||||
return date.toLocaleDateString('th-TH', {
|
||||
year: 'numeric',
|
||||
@@ -29,26 +43,47 @@ const formatDate = (date: Date) => {
|
||||
title="บล็อก | MoreMiniMore - ความรู้เกี่ยวกับ AI และการตลาดดิจิทัล"
|
||||
description="อ่านบทความและความรู้เกี่ยวกับ AI, Marketing Automation, SEO และ Digital Transformation สำหรับธุรกิจ SMEs ไทย"
|
||||
>
|
||||
<section class="py-16 bg-gray-light">
|
||||
<div class="container mx-auto px-4">
|
||||
<!-- Hero Section - Yellow Theme (matching homepage) -->
|
||||
<section id="hero" class="reveal relative overflow-hidden min-h-[40vh] flex items-center">
|
||||
<!-- Animated Background - Yellow theme for Blog -->
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-yellow-400 via-yellow-500 to-yellow-600">
|
||||
<!-- Floating Shapes -->
|
||||
<div class="absolute top-20 left-10 w-72 h-72 bg-white/20 rounded-full blur-3xl animate-float-1"></div>
|
||||
<div class="absolute bottom-20 right-10 w-96 h-96 bg-yellow-300/20 rounded-full blur-3xl animate-float-2"></div>
|
||||
<div class="absolute top-1/3 left-1/4 w-48 h-48 bg-white/10 rounded-full blur-2xl animate-float-3"></div>
|
||||
<div class="absolute bottom-1/3 right-1/4 w-64 h-64 bg-yellow-200/20 rounded-full blur-2xl animate-float-1" style="animation-delay: 1.5s;"></div>
|
||||
</div>
|
||||
|
||||
<!-- Floating dots -->
|
||||
<div class="absolute inset-0 overflow-hidden pointer-events-none">
|
||||
<div class="absolute top-1/4 left-[10%] w-3 h-3 bg-white/20 rounded-full animate-float-dot-1"></div>
|
||||
<div class="absolute top-1/3 left-[80%] w-2 h-2 bg-white/20 rounded-full animate-float-dot-2"></div>
|
||||
<div class="absolute top-2/3 left-[20%] w-4 h-4 bg-white/20 rounded-full animate-float-dot-3"></div>
|
||||
<div class="absolute bottom-1/4 left-[70%] w-2 h-2 bg-white/20 rounded-full animate-float-dot-1" style="animation-delay: 2s;"></div>
|
||||
</div>
|
||||
|
||||
<!-- Grid Pattern -->
|
||||
<div class="absolute inset-0 opacity-[0.03]" style="background-image: linear-gradient(white 1px, transparent 1px), linear-gradient(90deg, white 1px, transparent 1px); background-size: 50px 50px;"></div>
|
||||
|
||||
<div class="container mx-auto px-4 relative z-10 py-16">
|
||||
<div class="max-w-4xl mx-auto text-center">
|
||||
<h1 class="text-4xl md:text-5xl font-bold mb-6 text-secondary">
|
||||
<h1 class="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 text-white leading-tight animate-fade-in-up">
|
||||
บล็อก & ความรู้
|
||||
</h1>
|
||||
<p class="text-xl text-gray-600 mb-8">
|
||||
<p class="text-lg md:text-xl text-white/80 max-w-2xl mx-auto animate-fade-in-up" style="animation-delay: 0.2s;">
|
||||
ความรู้เกี่ยวกับ AI, การตลาดดิจิทัล และการเปลี่ยนแปลงทางธุรกิจสำหรับ SMEs ไทย
|
||||
</p>
|
||||
|
||||
<!-- Search Box -->
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="max-w-2xl mx-auto mt-8 animate-fade-in-up" style="animation-delay: 0.4s;">
|
||||
<div class="relative">
|
||||
<input
|
||||
type="text"
|
||||
id="blog-search"
|
||||
placeholder="ค้นหาบทความ..."
|
||||
class="w-full px-6 py-4 pr-12 rounded-full border-2 border-gray-200 focus:border-primary focus:outline-none text-lg"
|
||||
class="w-full px-6 py-4 pr-12 rounded-full border-2 border-white/30 bg-white/10 backdrop-blur-sm text-white placeholder-white/70 focus:border-white focus:outline-none text-lg"
|
||||
/>
|
||||
<button class="absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 hover:text-primary transition">
|
||||
<button class="absolute right-4 top-1/2 -translate-y-1/2 text-white/70 hover:text-white transition">
|
||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
||||
</svg>
|
||||
@@ -60,18 +95,18 @@ const formatDate = (date: Date) => {
|
||||
</section>
|
||||
|
||||
<!-- Category Filter -->
|
||||
<section class="py-8 bg-white border-b">
|
||||
<section class="reveal py-8 bg-white border-b shadow-sm">
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="flex flex-wrap gap-3 justify-center" id="category-filters">
|
||||
<button
|
||||
class="category-btn active px-5 py-2 rounded-full bg-primary text-white font-medium transition hover:bg-primary/90"
|
||||
class="category-btn active px-5 py-2 rounded-full bg-yellow-500 text-white font-medium transition hover:bg-yellow-600"
|
||||
data-category="all"
|
||||
>
|
||||
ทั้งหมด
|
||||
</button>
|
||||
{categories.map(category => (
|
||||
<button
|
||||
class="category-btn px-5 py-2 rounded-full bg-gray-100 text-gray-700 font-medium transition hover:bg-primary hover:text-white"
|
||||
class="category-btn px-5 py-2 rounded-full bg-gray-100 text-gray-700 font-medium transition hover:bg-yellow-500 hover:text-white"
|
||||
data-category={category}
|
||||
>
|
||||
{category}
|
||||
@@ -82,32 +117,47 @@ const formatDate = (date: Date) => {
|
||||
</section>
|
||||
|
||||
<!-- Blog Grid -->
|
||||
<section class="py-16 bg-gray-light">
|
||||
<section id="blog" class="reveal py-20 bg-gradient-to-b from-gray-50 to-white">
|
||||
<div class="container mx-auto px-4">
|
||||
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8" id="blog-grid">
|
||||
{sortedPosts.map(post => (
|
||||
<article class="blog-card bg-white rounded-2xl overflow-hidden shadow-md card-hover" data-category={post.data.category} data-tags={JSON.stringify(post.data.tags)}>
|
||||
<div class="h-48 gradient-ai flex items-center justify-center">
|
||||
<div class="text-6xl">📝</div>
|
||||
{sortedPosts.map((post, index) => (
|
||||
<article
|
||||
class="blog-card bg-white rounded-2xl overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-500 group"
|
||||
data-category={post.data.category}
|
||||
data-tags={JSON.stringify(post.data.tags)}
|
||||
style={`animation-delay: ${index * 0.1}s`}
|
||||
>
|
||||
<!-- Feature Image -->
|
||||
<div class="relative h-48 overflow-hidden">
|
||||
<img
|
||||
src={featureImages[post.slug] || '/images/blog/ai-sales-growth.jpg'}
|
||||
alt={post.data.title}
|
||||
class="w-full h-full object-cover transform group-hover:scale-110 transition-transform duration-500"
|
||||
/>
|
||||
<!-- Overlay -->
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
||||
<!-- Category Badge -->
|
||||
<span class="absolute top-4 left-4 bg-yellow-500 text-white px-3 py-1 rounded-full text-sm font-medium">
|
||||
{post.data.category}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="p-6">
|
||||
<div class="flex items-center gap-2 mb-3">
|
||||
<span class="text-sm text-accent-blue font-bold">{post.data.category}</span>
|
||||
<span class="text-gray-300">|</span>
|
||||
<span class="text-sm text-gray-500">{formatDate(post.data.pubDate)}</span>
|
||||
<span class="text-sm text-gray-600">{formatDate(post.data.pubDate)}</span>
|
||||
</div>
|
||||
<h2 class="text-xl font-bold mb-3 line-clamp-2 hover:text-accent-blue transition">
|
||||
<h2 class="text-xl font-bold mb-3 line-clamp-2 group-hover:text-yellow-600 transition-colors">
|
||||
<a href={`/blog/${post.slug}`}>{post.data.title}</a>
|
||||
</h2>
|
||||
<p class="text-gray-600 mb-4 line-clamp-3">
|
||||
<p class="text-gray-700 mb-4 line-clamp-2">
|
||||
{post.data.description}
|
||||
</p>
|
||||
<div class="flex flex-wrap gap-2 mb-4">
|
||||
{post.data.tags.slice(0, 3).map(tag => (
|
||||
<span class="text-xs bg-gray-100 px-2 py-1 rounded text-gray-600">#{tag}</span>
|
||||
<span class="text-xs bg-gray-100 px-2 py-1 rounded text-gray-700">#{tag}</span>
|
||||
))}
|
||||
</div>
|
||||
<a href={`/blog/${post.slug}`} class="text-accent-blue font-medium hover:underline inline-flex items-center gap-2">
|
||||
<a href={`/blog/${post.slug}`} class="text-yellow-600 font-medium hover:text-yellow-800 inline-flex items-center gap-2 group-hover:gap-3 transition-all">
|
||||
อ่านเพิ่มเติม →
|
||||
</a>
|
||||
</div>
|
||||
@@ -117,7 +167,9 @@ const formatDate = (date: Date) => {
|
||||
|
||||
<!-- No Results Message -->
|
||||
<div id="no-results" class="hidden text-center py-16">
|
||||
<div class="text-6xl mb-4">🔍</div>
|
||||
<svg class="w-16 h-16 mx-auto mb-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
||||
</svg>
|
||||
<h3 class="text-2xl font-bold mb-2">ไม่พบบทความที่ค้นหา</h3>
|
||||
<p class="text-gray-600">ลองค้นหาด้วยคำอื่นหรือเลือกหมวดหมู่อื่น</p>
|
||||
</div>
|
||||
@@ -125,12 +177,12 @@ const formatDate = (date: Date) => {
|
||||
</section>
|
||||
|
||||
<!-- Tags Cloud -->
|
||||
<section class="py-12 bg-white">
|
||||
<section class="reveal py-12 bg-white">
|
||||
<div class="container mx-auto px-4 max-w-4xl">
|
||||
<h3 class="text-2xl font-bold mb-6 text-center">หัวข้อที่น่าสนใจ</h3>
|
||||
<div class="flex flex-wrap gap-3 justify-center">
|
||||
{tags.map(tag => (
|
||||
<a href={`/blog?tag=${tag}`} class="px-4 py-2 bg-gray-100 rounded-full text-gray-700 hover:bg-primary hover:text-white transition">
|
||||
<a href={`/blog?tag=${tag}`} class="px-4 py-2 bg-gray-100 rounded-full text-gray-700 hover:bg-yellow-500 hover:text-white transition">
|
||||
#{tag}
|
||||
</a>
|
||||
))}
|
||||
@@ -138,21 +190,24 @@ const formatDate = (date: Date) => {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- CTA Section -->
|
||||
<section class="py-16 gradient-ai text-white">
|
||||
<!-- CTA Section - Always Yellow -->
|
||||
<section id="cta" class="reveal py-20 bg-primary">
|
||||
<div class="container mx-auto px-4 text-center">
|
||||
<h2 class="text-3xl md:text-4xl font-bold mb-6">
|
||||
<h2 class="text-3xl md:text-4xl font-bold mb-6 text-black">
|
||||
พร้อมเริ่มต้น Digital Transformation แล้วหรือยัง?
|
||||
</h2>
|
||||
<p class="text-xl mb-8 max-w-2xl mx-auto">
|
||||
<p class="text-xl mb-8 max-w-2xl mx-auto text-gray-800">
|
||||
ปรึกษาผู้เชี่ยวชาญของเราฟรี เราพร้อมช่วยคุณวางกลยุทธ์ที่เหมาะกับธุรกิจ
|
||||
</p>
|
||||
<div class="flex flex-col sm:flex-row gap-4 justify-center">
|
||||
<a href="/contact-us" class="bg-white text-primary px-8 py-4 rounded-full font-bold text-lg hover:bg-gray-100 transition shadow-lg inline-flex items-center justify-center gap-2">
|
||||
📞 ติดต่อเรา
|
||||
<a href="/contact-us" class="bg-black text-primary px-8 py-4 rounded-full font-bold text-lg hover:bg-gray-900 transition-colors shadow-lg inline-flex items-center justify-center gap-2">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"></path>
|
||||
</svg>
|
||||
ติดต่อเรา
|
||||
</a>
|
||||
<a href="/ai-strategy-consult" class="bg-transparent border-2 border-white text-white px-8 py-4 rounded-full font-bold text-lg hover:bg-white hover:text-primary transition inline-flex items-center justify-center gap-2">
|
||||
ปรึกษาผู้เชี่ยวชาญ
|
||||
<a href="/web-development" class="bg-white text-black px-8 py-4 rounded-full font-bold text-lg hover:bg-gray-100 transition-colors shadow-lg inline-flex items-center justify-center gap-2">
|
||||
ดูบริการ
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -170,10 +225,10 @@ const formatDate = (date: Date) => {
|
||||
btn.addEventListener('click', () => {
|
||||
// Update active state
|
||||
categoryBtns.forEach(b => {
|
||||
b.classList.remove('active', 'bg-primary', 'text-white');
|
||||
b.classList.remove('active', 'bg-yellow-500', 'text-white');
|
||||
b.classList.add('bg-gray-100', 'text-gray-700');
|
||||
});
|
||||
btn.classList.add('active', 'bg-primary', 'text-white');
|
||||
btn.classList.add('active', 'bg-yellow-500', 'text-white');
|
||||
btn.classList.remove('bg-gray-100', 'text-gray-700');
|
||||
|
||||
const category = btn.getAttribute('data-category');
|
||||
@@ -184,6 +239,7 @@ const formatDate = (date: Date) => {
|
||||
const cardCategory = card.getAttribute('data-category');
|
||||
if (category === 'all' || cardCategory === category) {
|
||||
(card as HTMLElement).style.display = 'block';
|
||||
(card as HTMLElement).style.animation = 'fadeInUp 0.5s ease forwards';
|
||||
visibleCount++;
|
||||
} else {
|
||||
(card as HTMLElement).style.display = 'none';
|
||||
@@ -250,10 +306,14 @@ const formatDate = (date: Date) => {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.line-clamp-3 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user