Files
moreminimore-astroreal/src/pages/portfolio.astro
Kunthawat Greethong b7787cc403 Add animated background to all hero sections
- Homepage: 3 animated orbs, 8 floating particles, 3 moving lines
- Service pages: 2 animated orbs, 4 particles, 2 moving lines
- About page: 2 animated orbs, 3 particles, 2 moving lines
- Portfolio page: 2 animated orbs, 4 particles, 2 moving lines
- Blog page: 2 animated orbs, 4 particles, 2 moving lines

All animations use yellow (#fed400) glow effects on dark background
2026-05-22 12:40:57 +07:00

500 lines
12 KiB
Plaintext

---
import Base from '../layouts/Base.astro';
import Navigation from '../components/Navigation.astro';
import Footer from '../components/Footer.astro';
import { portfolioItems } from '../data/portfolio';
---
<Base title="ผลงาน | MoreminiMore - รับทำเว็บไซต์ SEO AI Chatbot">
<Navigation />
<!-- =============================================
HERO SECTION - DARK THEME
============================================= -->
<section class="portfolio-hero">
<div class="hero-bg">
<div class="hero-grid"></div>
<div class="orb orb-1"></div>
<div class="orb orb-2"></div>
<div class="particles">
<div class="particle p-1"></div>
<div class="particle p-2"></div>
<div class="particle p-3"></div>
<div class="particle p-4"></div>
</div>
<div class="lines">
<div class="line line-1"></div>
<div class="line line-2"></div>
</div>
</div>
<div class="container">
<div class="hero-content">
<div class="hero-badge">
<span class="badge-dot"></span>
<span class="badge-text">ผลงานของเรา</span>
</div>
<h1 class="hero-title">
<span class="title-line">โปรเจกต์ที่</span>
<span class="title-accent">เราภาคภูมิใจ</span>
</h1>
<p class="hero-desc">
รวมผลงานพัฒนาเว็บไซต์และโปรเจกต์ที่เราภาคภูมิใจ
</p>
</div>
</div>
<div class="hero-wave">
<svg viewBox="0 0 1440 100" fill="none" preserveAspectRatio="none">
<path d="M0 50C240 100 480 0 720 50C960 100 1200 0 1440 50V100H0V50Z" fill="#ffffff"/>
</svg>
</div>
</section>
<!-- =============================================
PORTFOLIO GRID
============================================= -->
<section class="section portfolio-section">
<div class="container">
<div class="portfolio-grid">
{portfolioItems.map((item, index) => (
<article
class="portfolio-card"
data-category={item.category}
style={`--delay: ${index * 0.05}s`}
>
<div class="portfolio-image">
<img src={item.thumbnail} alt={item.name} loading="lazy" />
<div class="portfolio-overlay">
<a href={item.url || '#'} target="_blank" rel="noopener noreferrer" class="visit-btn">
เยี่ยมชมเว็บไซต์
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
</svg>
</a>
</div>
</div>
<div class="portfolio-content">
<span class="portfolio-category">{item.category_label}</span>
<h3 class="portfolio-name">{item.name}</h3>
{item.description && <p class="portfolio-desc">{item.description}</p>}
</div>
</article>
))}
</div>
</div>
</section>
<!-- =============================================
CTA SECTION
============================================= -->
<section class="section cta-section">
<div class="container">
<div class="cta-content">
<h2 class="cta-title">อยากได้เว็บไซต์แบบนี้บ้าง?</h2>
<p class="cta-desc">ปรึกษาฟรี! เราพร้อมช่วยวิเคราะห์และออกแบบโซลูชันที่เหมาะกับคุณ</p>
<div class="cta-actions">
<a href="/contact" class="btn btn-primary btn-lg">ปรึกษาฟรี</a>
<a href="tel:0809955945" class="btn btn-outline-dark btn-lg">080-995-5945</a>
</div>
</div>
</div>
</section>
<Footer />
</Base>
<style>
/* =============================================
PORTFOLIO HERO
============================================= */
.portfolio-hero {
position: relative;
min-height: 50vh;
display: flex;
align-items: center;
background: #0F172A;
overflow: hidden;
}
.hero-bg {
position: absolute;
inset: 0;
overflow: hidden;
}
.hero-grid {
position: absolute;
inset: 0;
background-image:
linear-gradient(rgba(254, 212, 0, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(254, 212, 0, 0.03) 1px, transparent 1px);
background-size: 60px 60px;
}
.orb {
position: absolute;
border-radius: 50%;
filter: blur(60px);
opacity: 0.4;
}
.orb-1 {
width: 300px;
height: 300px;
background: rgba(254, 212, 0, 0.3);
top: -50px;
right: 10%;
animation: orbFloat1 8s ease-in-out infinite;
}
.orb-2 {
width: 200px;
height: 200px;
background: rgba(254, 212, 0, 0.2);
bottom: 20%;
left: 5%;
animation: orbFloat2 10s ease-in-out infinite;
}
@keyframes orbFloat1 {
0%, 100% { transform: translate(0, 0) scale(1); }
50% { transform: translate(-40px, 30px) scale(1.1); }
}
@keyframes orbFloat2 {
0%, 100% { transform: translate(0, 0) scale(1); }
50% { transform: translate(50px, -30px) scale(1.15); }
}
.particles { position: absolute; inset: 0; overflow: hidden; }
.particle {
position: absolute;
width: 4px;
height: 4px;
background: #fed400;
border-radius: 50%;
opacity: 0;
}
.p-1 { top: 30%; left: 15%; animation: particleFloat 7s ease-in-out infinite; }
.p-2 { top: 50%; left: 75%; animation: particleFloat 8s ease-in-out infinite; animation-delay: 2s; }
.p-3 { top: 70%; left: 30%; animation: particleFloat 6s ease-in-out infinite; animation-delay: 1s; }
.p-4 { top: 20%; left: 60%; animation: particleFloat 9s ease-in-out infinite; animation-delay: 3s; }
@keyframes particleFloat {
0% { opacity: 0; transform: translateY(50px) scale(0); }
20% { opacity: 0.8; }
80% { opacity: 0.8; }
100% { opacity: 0; transform: translateY(-50px) scale(1); }
}
.lines { position: absolute; inset: 0; overflow: hidden; }
.line {
position: absolute;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(254, 212, 0, 0.3), transparent);
animation: lineMove 12s linear infinite;
}
.line-1 { width: 50%; top: 35%; left: -50%; animation-delay: 0s; }
.line-2 { width: 40%; top: 65%; left: -40%; animation-delay: 6s; }
@keyframes lineMove {
0% { left: -50%; }
100% { left: 110%; }
}
.hero-content {
position: relative;
z-index: 2;
text-align: center;
padding: 80px 0 60px;
}
.hero-badge {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 10px 20px;
background: rgba(254, 212, 0, 0.15);
border: 1px solid rgba(254, 212, 0, 0.3);
border-radius: 100px;
margin-bottom: 24px;
}
.badge-dot {
width: 8px;
height: 8px;
background: #fed400;
border-radius: 50%;
}
.badge-text {
font-family: var(--font-display);
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 2px;
color: #fed400;
}
.hero-title {
font-family: var(--font-display);
font-size: clamp(32px, 5vw, 52px);
font-weight: 900;
line-height: 1.1;
color: #ffffff;
margin-bottom: 16px;
}
.title-line {
display: block;
color: #ffffff;
}
.title-accent {
color: #fed400;
}
.hero-desc {
font-size: 18px;
color: rgba(255, 255, 255, 0.7);
max-width: 500px;
margin: 0 auto;
}
.hero-wave {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 80px;
z-index: 3;
}
.hero-wave svg {
width: 100%;
height: 100%;
}
/* =============================================
PORTFOLIO SECTION
============================================= */
.portfolio-section {
background: #ffffff;
padding: 80px 0;
}
.portfolio-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 32px;
}
.portfolio-card {
background: #ffffff;
border: 2px solid #E2E8F0;
border-radius: 20px;
overflow: hidden;
transition: all 0.4s ease;
animation: fadeUp 0.6s ease backwards;
animation-delay: var(--delay);
}
.portfolio-card:hover {
border-color: #fed400;
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}
.portfolio-image {
position: relative;
aspect-ratio: 16/10;
overflow: hidden;
}
.portfolio-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s ease;
}
.portfolio-card:hover .portfolio-image img {
transform: scale(1.08);
}
.portfolio-overlay {
position: absolute;
inset: 0;
background: rgba(254, 212, 0, 0.95);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.3s ease;
}
.portfolio-card:hover .portfolio-overlay {
opacity: 1;
}
.visit-btn {
display: inline-flex;
align-items: center;
gap: 10px;
background: #000000;
color: #ffffff;
padding: 14px 28px;
border-radius: 100px;
font-family: var(--font-display);
font-weight: 700;
font-size: 14px;
transition: transform 0.2s ease;
}
.visit-btn:hover {
transform: scale(1.05);
}
.visit-btn svg {
width: 18px;
height: 18px;
}
.portfolio-content {
padding: 24px;
}
.portfolio-category {
display: inline-block;
background: #F1F5F9;
color: #64748B;
padding: 4px 12px;
border-radius: 8px;
font-size: 11px;
font-weight: 700;
margin-bottom: 12px;
}
.portfolio-name {
font-family: var(--font-display);
font-size: 18px;
font-weight: 800;
color: #0F172A;
margin-bottom: 8px;
}
.portfolio-desc {
font-size: 14px;
color: #64748B;
line-height: 1.6;
}
/* =============================================
CTA SECTION
============================================= */
.cta-section {
background: #fed400;
padding: 80px 0;
}
.cta-content {
text-align: center;
}
.cta-title {
font-family: var(--font-display);
font-size: clamp(28px, 4vw, 36px);
font-weight: 800;
color: #000000;
margin-bottom: 12px;
}
.cta-desc {
font-size: 16px;
color: rgba(0, 0, 0, 0.7);
margin-bottom: 28px;
}
.cta-actions {
display: flex;
gap: 16px;
justify-content: center;
flex-wrap: wrap;
}
/* =============================================
BUTTONS
============================================= */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
padding: 14px 28px;
font-family: var(--font-display);
font-size: 13px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1.5px;
border: none;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
}
.btn-primary {
background: #0F172A;
color: #ffffff;
}
.btn-primary:hover {
background: #1E293B;
}
.btn-outline-dark {
background: transparent;
color: #000000;
border: 2px solid #000000;
}
.btn-outline-dark:hover {
background: #000000;
color: #ffffff;
}
.btn-lg {
padding: 16px 32px;
font-size: 14px;
}
@keyframes fadeUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
/* =============================================
RESPONSIVE
============================================= */
@media (max-width: 1024px) {
.portfolio-grid {
grid-template-columns: repeat(2, 1fr);
gap: 24px;
}
}
@media (max-width: 640px) {
.portfolio-grid {
grid-template-columns: 1fr;
}
.cta-actions {
flex-direction: column;
}
.btn-lg {
width: 100%;
}
}
</style>