Website undangan sekarang dilengkapi dengan sistem animasi modern yang responsif dan performa tinggi.
Tambahkan class animate-on-scroll ke elemen yang ingin diberi animasi saat scroll:
<div class="animate-on-scroll" data-animation="fade-in-up" data-delay="0">
<!-- Konten yang akan di-animasikan -->
</div>| Animation | Efek |
|---|---|
fade-in-up |
Muncul dari bawah dengan fade |
fade-in-down |
Muncul dari atas dengan fade |
fade-in-left |
Muncul dari kiri dengan fade |
fade-in-right |
Muncul dari kanan dengan fade |
zoom-in |
Muncul dengan efek zoom/scale |
data-animation: Tipe animasi yang digunakan (default:fade-in-up)data-delay: Delay dalam milliseconds sebelum animasi dimulai (default:0)
<!-- Heading dengan fade in dari atas -->
<h2 class="animate-on-scroll" data-animation="fade-in-down" data-delay="0">
Judul Section
</h2>
<!-- Paragraf dengan fade in dari bawah dan delay 100ms -->
<p class="animate-on-scroll" data-animation="fade-in-up" data-delay="100">
Deskripsi section
</p>
<!-- Card dengan zoom in dan delay 200ms -->
<div class="animate-on-scroll" data-animation="zoom-in" data-delay="200">
<!-- Card content -->
</div>Animasi bertahap untuk multiple child elements.
Tambahkan class stagger-animation ke parent container:
<div class="grid grid-cols-2 gap-8 stagger-animation">
<div>Card 1</div> <!-- Animasi delay: 0.1s -->
<div>Card 2</div> <!-- Animasi delay: 0.2s -->
<div>Card 3</div> <!-- Animasi delay: 0.3s -->
<div>Card 4</div> <!-- Animasi delay: 0.4s -->
</div>- Child 1: 0.1s
- Child 2: 0.2s
- Child 3: 0.3s
- Child 4: 0.4s
- Child 5: 0.5s
- Child 6: 0.6s
- Child 7+: 0.7s
<!-- Bride & Groom Cards dengan stagger -->
<div class="grid md:grid-cols-2 gap-8 stagger-animation">
<div class="card">Groom</div>
<div class="card">Bride</div>
</div>
<!-- Event Cards -->
<div class="grid md:grid-cols-2 gap-8 stagger-animation">
<div class="card">Akad Nikah</div>
<div class="card">Resepsi</div>
</div>Efek parallax pada background elements.
<div class="parallax" data-speed="0.5">
<!-- Element yang akan bergerak parallax -->
</div>data-speed: Kecepatan parallax (0.1 - 1.0)0.1: Very slow0.5: Medium (recommended)1.0: Fast
<div class="absolute top-0 left-0 parallax" data-speed="0.3">
<img src="decoration.png" alt="Decoration">
</div>Komponen animated-background sekarang mendukung background image dengan overlay.
<!-- Background dengan image -->
<x-animated-background
image="/images/hero-bg.jpg"
overlay="dark"
/>
<!-- Background dengan gradient (tanpa image) -->
<x-animated-background
variant="gold"
/>Path ke background image. Jika diisi, gradient background tidak akan digunakan.
<x-animated-background image="{{ asset('images/bg.jpg') }}" />Overlay untuk background image:
| Overlay | Class | Efek |
|---|---|---|
dark |
bg-black/40 |
Overlay hitam 40% (default) |
light |
bg-white/40 |
Overlay putih 40% |
primary |
bg-primary-900/40 |
Overlay biru 40% |
gold |
bg-gold-900/40 |
Overlay emas 40% |
none |
- | Tanpa overlay |
Untuk gradient background (jika image tidak diisi):
default- Primary blue gradientgold- Gold gradientrose- Rose/pink gradientpurple- Purple gradientlight- Light/white gradient
<!-- Hero dengan background image dan overlay dark -->
<section class="relative min-h-screen overflow-hidden">
<x-animated-background
image="{{ asset('images/hero-wedding.jpg') }}"
overlay="dark"
/>
<div class="relative z-10 container mx-auto">
<h1>Wedding Title</h1>
</div>
</section>
<!-- Section dengan gradient background -->
<section class="relative py-20 overflow-hidden">
<x-animated-background variant="gold" />
<div class="relative z-10 container mx-auto">
<h2>Section Title</h2>
</div>
</section>
<!-- Gallery dengan background image dan overlay terang -->
<section class="relative py-20 overflow-hidden">
<x-animated-background
image="{{ asset('images/gallery-bg.jpg') }}"
overlay="light"
/>
<div class="relative z-10 container mx-auto">
<!-- Gallery content -->
</div>
</section>Animasi zoom smooth pada background image (30 detik loop).
Otomatis diterapkan ketika menggunakan background image:
<x-animated-background image="/images/bg.jpg" />Image akan ter-animasi dengan:
- Zoom dari 100% → 110% → 100%
- Slight translate movement
- Duration: 30 detik
- Loop: infinite
<!-- Fade animations -->
<div class="animate-fade-in">...</div>
<div class="animate-fade-in-up">...</div>
<div class="animate-fade-in-down">...</div>
<div class="animate-fade-in-left">...</div>
<div class="animate-fade-in-right">...</div>
<!-- Other animations -->
<div class="animate-zoom-in">...</div>
<div class="animate-slide-up">...</div>
<div class="animate-slide-down">...</div>
<!-- Background animations -->
<div class="animate-gradient">...</div>
<div class="animate-ken-burns">...</div>
<div class="animate-blob">...</div>
<!-- Decorative animations -->
<div class="animate-float">...</div>
<div class="animate-float-slow">...</div>
<div class="animate-float-reverse">...</div>
<div class="animate-twinkle">...</div>
<div class="animate-pulse-soft">...</div>
<div class="animate-rotate-slow">...</div><div class="animate-blob animation-delay-2000">...</div>
<div class="animate-float animation-delay-4000">...</div>
<div class="animate-twinkle animation-delay-6000">...</div><section id="opening" class="relative min-h-screen overflow-hidden">
<x-animated-background variant="default" />
<div class="relative z-10 container mx-auto text-center text-white">
<div class="animate-fade-in-down">
<p>THE WEDDING OF</p>
</div>
<div class="animate-fade-in-up">
<h1>Bride & Groom</h1>
</div>
<div class="animate-zoom-in">
<p>Date & Time</p>
</div>
</div>
</section><section id="salam" class="py-20 bg-white">
<div class="container mx-auto">
<!-- Heading -->
<div class="animate-on-scroll" data-animation="fade-in-up" data-delay="100">
<h2>Assalamu'alaikum Wr. Wb.</h2>
</div>
<!-- Text -->
<div class="animate-on-scroll" data-animation="zoom-in" data-delay="200">
<p>Invitation text...</p>
</div>
<!-- Cards with stagger -->
<div class="grid md:grid-cols-2 gap-8 stagger-animation">
<div class="card">Groom</div>
<div class="card">Bride</div>
</div>
</div>
</section><section id="event" class="relative py-20 overflow-hidden">
<!-- Background -->
<x-animated-background variant="light" />
<!-- Decorations -->
<x-decorative-ornament position="top-left" type="floral" color="gold" />
<x-decorative-ornament position="bottom-right" type="geometric" color="primary" />
<div class="relative z-10 container mx-auto">
<!-- Content with animations -->
<div class="animate-on-scroll" data-animation="fade-in-up">
<h2>Section Title</h2>
</div>
<div class="grid grid-cols-2 gap-8 stagger-animation">
<div>Item 1</div>
<div>Item 2</div>
</div>
</div>
</section>Simpan images di:
public/images/backgrounds/
| Section | Recommended Size | Format |
|---|---|---|
| Hero | 1920x1080px | JPG/WebP |
| Gallery | 1920x1080px | JPG/WebP |
| Gift | 1920x1080px | JPG/WebP |
| Others | 1600x900px | JPG/WebP |
-
Compress images menggunakan tools seperti:
- TinyPNG
- ImageOptim
- Squoosh
-
Use WebP format untuk ukuran lebih kecil:
<x-animated-background image="{{ asset('images/bg.webp') }}" />
-
Lazy loading untuk images di bawah fold
# Upload ke public/images/backgrounds/
public/images/backgrounds/
├── hero.jpg
├── gallery.webp
├── gift.jpg
└── event.jpg<!-- Hero -->
<x-animated-background
image="{{ asset('images/backgrounds/hero.jpg') }}"
overlay="dark"
/>
<!-- Gallery -->
<x-animated-background
image="{{ asset('images/backgrounds/gallery.webp') }}"
overlay="light"
/>- Limit Animations: Jangan terlalu banyak animasi dalam 1 viewport
- Use CSS Animations: Lebih performa daripada JavaScript
- Optimize Images: Compress dan gunakan format modern (WebP)
- Lazy Load: Background images di bawah fold
Untuk disable animasi di mobile jika diperlukan:
@media (max-width: 768px) {
.animate-on-scroll {
opacity: 1 !important;
}
.animate-ken-burns {
animation: none !important;
}
}✅ Chrome 90+ ✅ Firefox 88+ ✅ Safari 14+ ✅ Edge 90+
Graceful degradation untuk browser lama (tampil tanpa animasi).
- Pastikan JavaScript sudah loaded
- Check console untuk errors
- Pastikan elemen visible di viewport
- Check path image benar
- Pastikan file exists di
public/images/ - Clear browser cache
- Reduce jumlah animasi
- Optimize background images
- Disable parallax di mobile
<section id="custom-section" class="relative py-20 overflow-hidden">
<!-- Background dengan image -->
<x-animated-background
image="{{ asset('images/backgrounds/section-bg.jpg') }}"
overlay="dark"
/>
<!-- Decorative ornaments -->
<x-decorative-ornament position="top-right" type="hearts" color="gold" />
<!-- Wave divider -->
<x-wave-divider position="top" color="white" />
<!-- Content -->
<div class="relative z-10 container mx-auto px-4">
<!-- Animated heading -->
<div class="text-center mb-12 animate-on-scroll" data-animation="fade-in-up">
<h2 class="text-4xl font-serif text-white mb-4">
Section Title
</h2>
<div class="w-24 h-1 bg-gradient-to-r from-transparent via-gold-500 to-transparent mx-auto"></div>
</div>
<!-- Animated content with delay -->
<div class="animate-on-scroll" data-animation="zoom-in" data-delay="200">
<p class="text-white text-center max-w-2xl mx-auto">
Section description text...
</p>
</div>
<!-- Stagger animated cards -->
<div class="grid md:grid-cols-3 gap-8 mt-12 stagger-animation">
<div class="card bg-white/90 backdrop-blur-sm p-6 rounded-xl">
Card 1
</div>
<div class="card bg-white/90 backdrop-blur-sm p-6 rounded-xl">
Card 2
</div>
<div class="card bg-white/90 backdrop-blur-sm p-6 rounded-xl">
Card 3
</div>
</div>
</div>
<!-- Wave divider bottom -->
<x-wave-divider position="bottom" color="gray-50" />
</section>Fitur Baru:
- ✅ Scroll-triggered animations dengan 5 tipe animasi
- ✅ Stagger animations untuk multiple children
- ✅ Parallax effect
- ✅ Background image support dengan overlay
- ✅ Ken Burns effect untuk background images
- ✅ 15+ CSS animation classes
- ✅ Intersection Observer API untuk performance
- ✅ Mobile responsive
- ✅ Graceful degradation untuk browser lama
Components:
<x-animated-background>- Support image & gradient<x-wave-divider>- Section transitions<x-decorative-ornament>- Decorative elements
Selamat menggunakan! Website undangan Anda sekarang lebih hidup dan engaging! 🎉