Browse Source

revert back fade-in logic

master
azri 5 months ago
parent
commit
5d354a189c

+ 6
- 0
resources/css/app.css View File

@@ -44,6 +44,12 @@ body.no-scroll {
44 44
     overflow: hidden;
45 45
 }
46 46
 
47
+.fade-element {
48
+    opacity: 0;
49
+    transform: translateY(20px);
50
+    transition: opacity 3s ease-in-out, transform 3s ease-in-out;
51
+}
52
+
47 53
 .fade-in {
48 54
     opacity: 1;
49 55
 }

+ 20
- 0
resources/js/app.js View File

@@ -224,3 +224,23 @@ function eventCountdown() {
224 224
         }
225 225
     }, 1000); // Update every second (1000 milliseconds)
226 226
 }
227
+
228
+
229
+const observerOptions = {
230
+    root: null,
231
+    rootMargin: '0px',
232
+    threshold: 0.1
233
+};
234
+
235
+const observer = new IntersectionObserver((entries, observer) => {
236
+    entries.forEach(entry => {
237
+        if (entry.isIntersecting) {
238
+            entry.target.classList.add('fade-in');
239
+            observer.unobserve(entry.target);
240
+        }
241
+    });
242
+}, observerOptions);
243
+
244
+document.querySelectorAll('.fade-element').forEach(element => {
245
+    observer.observe(element);
246
+});

+ 1
- 1
resources/views/components/countdown.blade.php View File

@@ -1,4 +1,4 @@
1
-<div class="flex flex-col gap-5 w-4/5 py-3">
1
+<div class="flex flex-col gap-5 w-4/5 py-3 fade-element">
2 2
     <hr class="border-t-1 border-gray-300 mt-3 mb-5 w-4/5 self-center">
3 3
     <h1 class="font-medium text-gray-600 self-center">Majlis Bermula</h1>
4 4
     <div class="flex justify-center" id="countdown"></div>

+ 9
- 9
resources/views/components/event-info.blade.php View File

@@ -1,19 +1,19 @@
1 1
 <div class="flex flex-col gap-5 w-4/5 mt-10">
2
-    <div class="flex justify-center ">
2
+    <div class="flex justify-center fade-element">
3 3
         <img src="{{ asset('assets/bismillah.png') }}" alt="Logo">
4 4
     </div>
5
-    <div class="text-center ">
5
+    <div class="text-center fade-element">
6 6
         <p class="font-medium text-sm text-gray-500 pb-3">Dengan penuh rasa kesyukuran, kami</p>
7 7
         <p class="font-medium text-gray-600">DATO' HAJI AMIRUDDIN BIN MOHD SAID</p>
8 8
         <p class="font-medium text-gray-600">&</p>
9 9
         <p class="font-medium text-gray-600">DATIN HAJAH NOR ALINA BINTI ALIAS</p>
10 10
     </div>
11
-    <div class="text-center ">
11
+    <div class="text-center fade-element">
12 12
         <p class="font-medium text-sm text-gray-500">ingin mempersilakan</p>
13 13
         <p class="font-medium text-sm text-gray-500">Tan Sri/Dato' Sri/Datin Sri/Dato'/</p>
14 14
         <p class="font-medium text-sm text-gray-500">Datin/Tuan/Puan/Encik/Cik</p>
15 15
     </div>
16
-    <div class="text-center ">
16
+    <div class="text-center fade-element">
17 17
         <p class="font-medium text-sm text-gray-500 pb-3">Ke Majlis Resepsi Perkahwinan Putera Kami</p>
18 18
         <p class="font-medium text-gray-600">ALIFF BIN DATO' HAJI AMIRUDDIN</p>
19 19
         <p class="font-medium text-gray-600">&</p>
@@ -25,11 +25,11 @@
25 25
         <p class="font-medium text-sm text-gray-500">Sabtu, 17 Ogos 2024</p>
26 26
         <p class="font-medium text-sm text-gray-500">(12 Safar 1446H)</p>
27 27
     </div>
28
-    <div class="text-center ">
28
+    <div class="text-center fade-element">
29 29
         <p class="font-medium text-gray-600 pb-2">Masa</p>
30 30
         <p class="font-medium text-sm text-gray-500">11.00 Pagi - 4.00 Petang</p>
31 31
     </div>
32
-    <div class="text-center ">
32
+    <div class="text-center fade-element">
33 33
         <p class="font-medium text-gray-600 pb-2">Tempat</p>
34 34
         <p class="font-medium text-sm text-gray-500">Dewan Jubli Perak</p>
35 35
         <p class="font-medium text-sm text-gray-500">Sultan Haji Ahmad Shah,</p>
@@ -38,7 +38,7 @@
38 38
     </div>
39 39
     <hr class="border-t-1 border-gray-300 my-5 w-4/5 self-center ">
40 40
     @if ($host == 'aliffayuna.com')
41
-    <div class="text-center ">
41
+    <div class="text-center fade-element">
42 42
         <p class="font-medium text-gray-600 pb-2">Aturcara Majlis</p>
43 43
         <p class="font-medium text-sm text-gray-600">11.00 Pagi :</p>
44 44
         <p class="font-medium text-sm text-gray-500 pb-4">Majlis Bermula</p>
@@ -67,8 +67,8 @@
67 67
             <p class="font-medium text-sm text-gray-500 pb-4">Majlis Tamat</p>
68 68
         </div> --}}
69 69
     @endif
70
-    
71
-    
70
+
71
+
72 72
     {{-- <div class="flex justify-center space-x-4 py-10">
73 73
         <a href="https://wa.me/01133133619" target="_blank" class="flex items-center space-x-2 font-medium text-green-600">
74 74
             <i class="fa-brands fa-whatsapp"></i>

+ 2
- 2
resources/views/components/guestbook.blade.php View File

@@ -10,14 +10,14 @@
10 10
             @endfor
11 11
         </div>
12 12
     </div>
13
-    <div class="text-center pb-2 ">
13
+    <div class="text-center pb-2 fade-element">
14 14
         <a onclick="guestbook.showModal()" class="rounded-full border-solid border-2 border-navbarcolor py-1 px-3 font-medium text-gray-600">
15 15
             <i class="fa-solid fa-pen-fancy"></i>
16 16
             <span>Ucapan</span>
17 17
         </a>
18 18
 
19 19
     </div>
20
-    <div class="text-center pb-2 ">
20
+    <div class="text-center pb-2 fade-element">
21 21
         <a onclick="rsvp.showModal()" class="rounded-full border-solid border-2 border-navbarcolor py-1 px-3 font-medium text-gray-600">
22 22
             <i class="fa-solid fa-clipboard"></i>
23 23
             <span>Sahkan Kehadiran</span>

+ 4
- 4
resources/views/components/main-event.blade.php View File

@@ -1,8 +1,8 @@
1 1
 <div class="flex flex-col gap-5 w-4/5 mt-44 mb-40 text-navbarcolor">
2
-    <div class="flex justify-center ">
2
+    <div class="flex justify-center fade-element">
3 3
         <p class="font-semibold text-sm">WALIMATULURUS</p>
4 4
     </div>
5
-    <div class="flex flex-col gap-8 pt-8 pb-8 justify-center ">
5
+    <div class="flex flex-col gap-8 pt-8 pb-8 justify-center fade-element">
6 6
         <div class="flex justify-center">
7 7
             <p class="font-tan-pearl font-semibold text-5xl"><span class="text-6xl">A</span>liff</p>
8 8
         </div>
@@ -13,7 +13,7 @@
13 13
             <p class="font-tan-pearl font-semibold text-5xl"><span class="text-6xl">A</span>yuna</p>
14 14
         </div>
15 15
     </div>
16
-    <div class="flex flex-col justify-center">
16
+    <div class="flex flex-col justify-center fade-element">
17 17
         <div class="flex justify-center">
18 18
             <p class="font-bold text-base">SABTU</p>
19 19
         </div>
@@ -21,7 +21,7 @@
21 21
             <p class="font-bold text-base">17 OGOS 2024</p>
22 22
         </div>
23 23
     </div>
24
-    <div class="flex flex-col justify-center ">
24
+    <div class="flex flex-col justify-center fade-element">
25 25
         <div class="flex justify-center">
26 26
             <p class="font-semibold text-sm">DEWAN JUBLI PERAK</p>
27 27
         </div>

+ 2
- 2
resources/views/components/prayer.blade.php View File

@@ -1,8 +1,8 @@
1 1
 <div class="flex flex-col gap-5 w-4/5">
2
-    <div class="flex justify-center ">
2
+    <div class="flex justify-center fade-element">
3 3
         <img src="{{ asset('assets/bismillah.png') }}" alt="Logo">
4 4
     </div>
5
-    <div class="text-center ">
5
+    <div class="text-center fade-element">
6 6
         <p class="font-medium text-sm text-gray-500 pb-1">Ya Allah, Ya Tuhan kami. Kami memohon restuMu</p>
7 7
         <p class="font-medium text-sm text-gray-500 pb-1">berkatilah majlis kami ini dengan keberkatan dari</p>
8 8
         <p class="font-medium text-sm text-gray-500 pb-1">permulaan hingga pengakhirannya. Sesungguhnya</p>

Loading…
Cancel
Save