-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1972 lines (1766 loc) · 116 KB
/
Copy pathindex.html
File metadata and controls
1972 lines (1766 loc) · 116 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>Drini Park Resort – Private Coastal Luxury Retreat</title>
<meta name="description" content="Drini Park Resort — private coastal luxury retreat di pesisir selatan Yogyakarta. Luxury rooms, signature experiences, meeting packages.">
<!-- Critical: Preload fonts to avoid FOIT -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=Cormorant+Garamond:wght@300;400;500&family=Inter:wght@300;400;500&display=optional">
<!-- Tailwind -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- React 18 -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<!-- Lucide React icons (UMD) -->
<script src="https://unpkg.com/lucide-react@latest/dist/umd/lucide-react.js"></script>
<!-- Swiper 11 — preloaded so SwiperCarousel mounts instantly -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<!-- Lenis smooth scroll — preloaded -->
<script src="https://unpkg.com/lenis@1.1.13/dist/lenis.min.js"></script>
<!-- Babel (JSX transpiler) -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
* { box-sizing: border-box; }
body { margin: 0; padding: 0; }
/* Prevent invisible content flash */
#root { min-height: 100vh; }
</style>
</head>
<body>
<div id="root"></div>
<script type="text/babel" data-presets="react">
// === React hooks ===
const { useState, useEffect, useRef, useCallback } = React;
// === Lucide icons (from CDN UMD) ===
const {
Menu, X, Calendar, Users, MapPin, Phone, Mail,
ChevronRight, ChevronLeft, Anchor, Coffee, Utensils,
BedDouble, Maximize, Eye, ArrowRight, Plus, Minus, ChevronDown,
PlayCircle, Check, ExternalLink,
Wifi, Waves, Car, Store, CreditCard, Sun, Bath, Home, Trees, ArrowUpRight
} = LucideReact;
const ImageIcon = LucideReact.Image;
const MapIcon = LucideReact.Map;
const Instagram = ({ size = 24, className = '', ...props }) => (
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className} {...props}>
<rect x="2" y="2" width="20" height="20" rx="5" ry="5"/>
<path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/>
<line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/>
</svg>
);
const Facebook = ({ size = 24, className = '', ...props }) => (
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="currentColor" className={className} {...props}>
<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/>
</svg>
);
// === 1. NATIVE SMOOTH SCROLL HOOK (LENIS INTEGRATION DYNAMIC LOAD) ===
function useLenis() {
useEffect(() => {
let lenis;
let rafId;
const initLenis = () => {
if (!window.Lenis) return;
// Disable Lenis on mobile devices to prevent jank and preserve native momentum scrolling
if (window.innerWidth < 768) return;
lenis = new window.Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
smoothWheel: true,
wrapper: window,
content: document.documentElement,
});
function raf(time) {
lenis.raf(time);
rafId = requestAnimationFrame(raf);
}
rafId = requestAnimationFrame(raf);
};
// Load Lenis script dynamically to bypass bundler resolution issues
if (window.Lenis) {
initLenis();
} else {
const script = document.createElement('script');
script.src = 'https://unpkg.com/lenis@1.1.13/dist/lenis.min.js';
script.async = true;
script.onload = initLenis;
document.head.appendChild(script);
}
// Cleanup untuk mencegah memory leak
return () => {
if (lenis) lenis.destroy();
if (rafId) cancelAnimationFrame(rafId);
};
}, []);
}
// === 2. NATIVE SCROLL REVEAL COMPONENT (FRAMER MOTION FALLBACK) ===
const revealVariants = {
fadeUp: { hidden: { opacity: 0, transform: 'translateY(50px)' }, visible: { opacity: 1, transform: 'translateY(0)' } },
fadeIn: { hidden: { opacity: 0 }, visible: { opacity: 1 } },
zoomIn: { hidden: { opacity: 0, transform: 'scale(0.85)' }, visible: { opacity: 1, transform: 'scale(1)' } },
slideLeft: { hidden: { opacity: 0, transform: 'translateX(-60px)' }, visible: { opacity: 1, transform: 'translateX(0)' } },
slideRight: { hidden: { opacity: 0, transform: 'translateX(60px)' }, visible: { opacity: 1, transform: 'translateX(0)' } },
blur: { hidden: { opacity: 0, transform: 'translateY(20px)' }, visible: { opacity: 1, transform: 'translateY(0)' } },
};
function ScrollReveal({ children, variant = "fadeUp", delay = 0, duration = 0.8, once = true, className = "", as = "div", id }) {
const Tag = as;
const ref = useRef(null);
const [isVisible, setIsVisible] = useState(false);
useEffect(() => {
const currentRef = ref.current;
const observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
setIsVisible(true);
if (once && currentRef) observer.unobserve(currentRef);
} else if (!once) {
setIsVisible(false);
}
}, { margin: "-10% 0px" });
if (currentRef) observer.observe(currentRef);
return () => {
if (currentRef) observer.unobserve(currentRef);
};
}, [once]);
const style = {
...revealVariants[variant][isVisible ? 'visible' : 'hidden'],
transition: `all ${duration}s cubic-bezier(0.25, 0.46, 0.45, 0.94) ${delay}s`,
};
return <Tag id={id} ref={ref} className={className} style={style}>{children}</Tag>;
}
// === 3. NATIVE WORD REVEAL COMPONENT ===
function WordReveal({ text, className = "", delay = 0, duration = 0.6, stagger = 0.08, as = "h2" }) {
const Tag = as;
const ref = useRef(null);
const [isVisible, setIsVisible] = useState(false);
const words = text.split(" ");
useEffect(() => {
const currentRef = ref.current;
const observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
setIsVisible(true);
observer.disconnect();
}
}, { margin: "-5% 0px" });
if (currentRef) observer.observe(currentRef);
return () => observer.disconnect();
}, []);
return (
<Tag ref={ref} className={className} style={{ display: "flex", flexWrap: "wrap", gap: "0.25em" }}>
{words.map((word, i) => (
<span key={i} style={{ overflow: "hidden", display: "inline-block" }}>
<span
style={{
display: "inline-block",
opacity: isVisible ? 1 : 0,
transform: isVisible ? 'translateY(0%)' : 'translateY(100%)',
transition: `opacity ${duration}s ease, transform ${duration}s cubic-bezier(0.22, 1, 0.36, 1) ${delay + (i * stagger)}s`
}}
>
{word}
</span>
</span>
))}
</Tag>
);
}
// === HELPER OPTIMASI IMGUR ===
// Menyisipkan "l" (Large Thumbnail) pada URL imgur untuk menghemat bandwidth hingga 80% pada mode grid
const getThumbUrl = (url) => url ? url.replace(/\.(jpeg|jpg|png)$/i, 'l.$1') : url;
// === 4. SWIPER.JS CAROUSEL DINAMIS (ROOM, EXP, GALLERY) ===
function SwiperCarousel({ items, onOpenDetail, sliderId, itemType = 'experience' }) {
const sliderRef = useRef(null);
const swiperInstanceRef = useRef(null);
useEffect(() => {
const initSwiper = () => {
if (!sliderRef.current || !window.Swiper) return;
const swiper = new window.Swiper(sliderRef.current, {
slidesPerView: 'auto',
spaceBetween: 24,
loop: true,
grabCursor: true,
speed: 900,
freeMode: {
enabled: true,
momentum: true,
momentumRatio: 0.55,
momentumVelocityRatio: 0.9,
momentumBounce: false,
sticky: false,
},
touchRatio: 1.2,
longSwipesRatio: 0.15,
mousewheel: { forceToAxis: true, sensitivity: 0.8 },
keyboard: { enabled: true, onlyInViewport: true },
scrollbar: { el: sliderRef.current.querySelector('.luxury-scrollbar'), draggable: true, hide: false },
breakpoints: {
0: { spaceBetween: 16, freeMode: { momentumRatio: 0.7, momentumBounce: false } },
768: { spaceBetween: 24 }
},
// Override easing default Swiper & Handle Click React
on: {
init: function () {
this.el.style.setProperty(
'--swiper-transition-timing-function',
'var(--easing-luxury)'
);
},
click: function (s, e) {
// Memastikan klik pada slide yang merender halaman detail atau geser viewport
if (s.clickedSlide && s.clickedSlide.classList.contains('swiper-slide-active')) {
const realIndex = s.clickedSlide.getAttribute('data-swiper-slide-index');
const identifier = items[realIndex]?.id || items[realIndex]?.name;
if (identifier && onOpenDetail) onOpenDetail(identifier);
} else if (s.clickedIndex !== undefined) {
s.slideTo(s.clickedIndex);
}
}
}
});
swiperInstanceRef.current = swiper;
};
// Swiper preloaded in <head> — poll until available (avoids duplicate injection)
if (window.Swiper) {
initSwiper();
} else {
let attempts = 0;
const wait = setInterval(() => {
attempts++;
if (window.Swiper) { clearInterval(wait); initSwiper(); }
else if (attempts > 100) clearInterval(wait); // 5s max
}, 50);
return () => clearInterval(wait);
}
return () => {
if (swiperInstanceRef.current) {
swiperInstanceRef.current.destroy(true, true);
swiperInstanceRef.current = null;
}
};
}, [items, onOpenDetail]);
return (
<div className="swiper luxury-swiper" id={sliderId} ref={sliderRef} data-lenis-prevent>
<div className="swiper-wrapper">
{items.map((item, idx) => (
<div className={`swiper-slide luxury-slide ${itemType === 'room' ? 'room-slide' : ''}`} key={`${item.id || item.name}-${idx}`} data-swiper-slide-index={idx}>
<div className="slide-frame">
<div className="slide-image-wrap">
<img
src={item.img || getThumbUrl(item.image)}
alt={item.title || item.name || item.category || 'Drini Park Resort'}
loading={idx < 3 ? 'eager' : 'lazy'}
decoding="async"
/>
</div>
<div className="slide-gradient"></div>
</div>
<div className="slide-info-below">
<span className="tag-label">
{itemType === 'room' ? 'DRINI PARK RESORT' : (item.badge || (itemType === 'gallery' ? 'VISUAL JOURNEY' : 'SIGNATURE EXPERIENCE'))}
</span>
<h3 className="slide-title">{item.title || item.name || item.category}</h3>
{itemType === 'room' && (
<div className="slide-specs">
<span>2 ADULTS</span>
<span>1 BEDROOM</span>
<span>{item.bed ? item.bed.toUpperCase().split('/')[0].trim() : 'KING-SIZE BED'}</span>
</div>
)}
</div>
</div>
))}
</div>
<div className="swiper-scrollbar luxury-scrollbar"></div>
</div>
);
}
// === 5. KOMPONEN GALERI KHUSUS (GALLERY CARD & LIGHTBOX) ===
function GalleryCard({ item, onClick }) {
return (
<div
className="relative overflow-hidden rounded-lg cursor-pointer group shadow-md break-inside-avoid mb-6"
onClick={() => onClick(item)}
>
<img
src={getThumbUrl(item.image)}
alt={`Drini Park Resort - ${item.category}`}
loading="lazy"
decoding="async"
className="w-full h-auto object-cover transition-transform duration-700 group-hover:scale-110"
/>
{/* Overlay tipis saat hover tanpa teks */}
<div className="absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-500" />
</div>
);
}
function GalleryLightbox({ item, onClose, onPrev, onNext }) {
if (!item) return null;
return (
<div className="fixed inset-0 z-[200] bg-black/95 backdrop-blur-md flex items-center justify-center p-4 animate-in fade-in duration-300" onClick={onClose}>
<div className="relative max-w-6xl w-full flex items-center justify-center" onClick={(e) => e.stopPropagation()}>
<img
src={item.image}
alt={`Drini Park Resort - ${item.category}`}
className="max-w-full max-h-[85vh] object-contain shadow-2xl rounded-sm"
/>
{/* Kontrol Navigasi yang Aman untuk Mobile Portrait */}
<button onClick={onClose} className="absolute -top-14 right-0 md:-top-6 md:-right-6 w-10 h-10 bg-white/10 text-white rounded-full flex items-center justify-center hover:bg-black transition-colors text-xl focus-ring z-10">✕</button>
<button onClick={onPrev} className="absolute left-2 md:-left-12 top-1/2 -translate-y-1/2 w-10 h-10 bg-white/10 text-white rounded-full flex items-center justify-center hover:bg-black transition-colors text-lg focus-ring z-10">‹</button>
<button onClick={onNext} className="absolute right-2 md:-right-12 top-1/2 -translate-y-1/2 w-10 h-10 bg-white/10 text-white rounded-full flex items-center justify-center hover:bg-black transition-colors text-lg focus-ring z-10">›</button>
</div>
</div>
);
}
// === COMPONENT UTILS ===
const TiktokIcon = ({ size = 24, className = "" }) => (
<svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
<path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5" />
</svg>
);
// === DATA STATIS ===
const navItems = ['Home', 'Rooms', 'Signature Experiences', 'Meetings', 'Gallery'];
const roomTypes = [
"Superior Sea View", "Superior Garden View", "Deluxe Sea View", "Deluxe Garden View", "Suite Sea View"
];
const requestOptions = [
"Extra Bed", "Romantic Towel", "Slice of Cake", "Romantic Dinner", "Floating Breakfast", "Rooftop BBQ", "Jeep Adventure", "Bajaj Fun Trip", "Other"
];
const aboutImages = [
"https://i.imgur.com/Bu0l9Oi.jpeg", "https://i.imgur.com/oxMN5GC.jpeg", "https://i.imgur.com/aIT0IdB.jpg"
];
const roomsData = [
{ name: "Superior Sea View", image: "https://i.imgur.com/ht7F0zP.jpeg", size: "32 m²", bed: "1 King Bed / Twin Bed (Upon request)", tagline: "Where the horizon becomes your most faithful companion.", desc: "Suara ombak adalah satu-satunya alarm yang diizinkan di sini. Cahaya pagi menyebar perlahan di atas permukaan laut — lembut, tanpa tergesa, seperti hari yang mengerti bahwa Anda butuh waktu. Sanctuary ini bukan sekadar kamar dengan sea view. Ia adalah percakapan pribadi antara Anda dan samudra selatan." },
{ name: "Superior Garden View", image: "https://i.imgur.com/2H30ktC.jpeg", size: "32 m²", bed: "1 King Bed / Twin Bed (Upon request)", tagline: "A private world softened by green and shadow.", desc: "Di balik kanopi tropis yang menaungi, dunia terasa lebih kecil — dan justru di situ, ia terasa lebih utuh. Cahaya menyaring lembut melalui dedaunan di pagi hari; angin membawa aroma tanah basah saat sore menjelang. Untuk mereka yang menemukan kedalaman bukan dalam pemandangan yang luas, melainkan dalam keheningan yang dekat." },
{ name: "Deluxe Sea View", image: "https://i.imgur.com/ocljqF0.jpeg", size: "42 m²", bed: "1 King Bed / Twin Bed (Upon request)", tagline: "An uninterrupted dialogue with the southern sea.", desc: "Ruang yang lebih lapang bukan berarti lebih banyak furnitur — melainkan lebih banyak laut. Panorama pesisir selatan terbentang tanpa hambatan dari setiap sudut sanctuary ini, membiarkan suara ombak, kualitas cahaya, dan pergerakan air menjadi bagian dari ritme harian Anda. Ini bukan sekadar view. Ini adalah immersion." },
{ name: "Deluxe Garden View", image: "https://i.imgur.com/4rS8xBv.jpeg", size: "42 m²", bed: "1 King Bed / Twin Bed (Upon request)", tagline: "Depth, shadow, and an uncommon stillness.", desc: "Ada kemewahan yang tidak perlu panorama luas untuk membuktikan diri. Di sanctuary ini, privasi terasa seperti arsitektur itu sendiri — terbangun dari hijau yang mengelilingi, bayangan yang meneduhkan, dan kesunyian yang tidak pernah terasa kosong. Ruang yang melindungi, bukan sekadar mewadahi." },
{ name: "Suite Sea View", image: "https://i.imgur.com/SKBkcRN.jpeg", size: "65 m²", bed: "1 Super King Bed", tagline: "The most considered space we offer. Nothing left to chance.", desc: "Enam puluh lima meter persegi yang dirancang dengan obsesi terhadap detail — di mana setiap proporsi, setiap sightline, setiap material telah melalui pertimbangan yang panjang. Suite Sea View menguasai panorama pesisir terluas di resort ini — bukan sebagai pamer, melainkan sebagai pernyataan tentang apa yang Anda layak rasakan. Untuk mereka yang tahu perbedaannya." }
];
const packageDetailsData = {
jeep: { title: "Drini Jeep Adventure", subtitle: "Signature Experience", heroImg: "https://i.imgur.com/MNq2vF7.jpeg", description: "Pesisir selatan punya rute yang hanya dikenal oleh mereka yang mau melambat cukup lama untuk menemukannya. Perjalanan eksploratif menyusuri lanskap Drini — bukan untuk tergesa-gesa, melainkan untuk benar-benar melihat.", includes: ["Sewa armada Jeep eksklusif", "Pengemudi profesional / guide", "Pilihan Rute A: Drini - Puncak Krakal - Sarangan - Slili", "Pilihan Rute B: Drini - Watu Kodok - Sepanjang - Nglolang", "Kapasitas 4 orang per Jeep (4 Pax)"], price: "Rp 350.000 / 4 Pax" },
bajaj: { title: "Coastal Bajaj Fun Trip", subtitle: "Signature Experience", heroImg: "https://i.imgur.com/6NqMxmV.jpeg", description: "Cara paling estetik untuk mengenal kawasan Drini dari perspektif yang berbeda. Sebuah perjalanan santai yang dirancang sebagai cara menikmati waktu — bukan sebagai itinerary yang harus diselesaikan.", includes: ["Armada Bajaj eksklusif", "Pengemudi lokal yang berpengalaman", "Rute perjalanan: Drini - Slili - Sadranan", "Kapasitas ideal untuk menikmati perjalanan santai"], price: "Rp 350.000" },
bbq: { title: "Rooftop BBQ Experience", subtitle: "Signature Experience", heroImg: "https://i.imgur.com/l7TWFGd.png", description: "Angin laut, langit terbuka, dan bara yang menyala perlahan — private BBQ di rooftop ini dirancang untuk mereka yang mengerti bahwa perayaan terbaik tidak membutuhkan kebisingan.", includes: ["Main Course: French Fries / Steamed Rice, Satay Skewers, Smoked Beef, Chicken Slices, Dumplings, Sausages, Whole Corn, Onion, Chinese Cabbage", "Condiments: BBQ Sauce, Black Pepper Sauce, Garlic Butter, Tom Yam Soup", "Dessert: Sliced Fruits", "Beverages: Infused Water, Orange Juice", "Setup meja privat di area Rooftop (Kapasitas 4 Pax)"], price: "Rp 350.000 / 4 Pax" },
floating: { title: "Floating Breakfast", subtitle: "Signature Experience", heroImg: "https://i.imgur.com/GhFJvq5.jpeg", description: "Kolam privat. Nampan apung. Waktu yang sepenuhnya milik Anda. Tidak ada jadwal. Tidak ada tergesa. Hanya ketenangan yang mengapung bersama Anda.", includes: ["Pilihan menu sarapan atau kudapan ringan", "Nampan apung eksklusif", "Setup privat di kolam renang tamu", "Layanan terpersonalisasi tanpa disrupsi"], price: "Rp 350.000" },
dinner: { title: "Romantic Dinner", subtitle: "Signature Experience", heroImg: "https://i.imgur.com/HpmYccs.jpeg", description: "Meja yang disiapkan hanya untuk berdua — dengan suasana yang hangat, cahaya yang tepat, dan sajian yang diracik dengan penuh perhatian. Untuk momen yang layak diingat lama setelah malam itu berakhir.", includes: ["Appetizer: Shrimp Salad", "Soup: Chicken Cream Soup", "Main Course: Tenderloin Steak", "Dessert: Banana Split", "Beverage: Virgin Mojito & Mineral Water", "Dekorasi meja tematik elegan dan privat"], price: "Rp 500.000 / Couple" },
towel: { title: "Romantic Towel", subtitle: "Special Occasions", heroImg: "https://i.imgur.com/A7p4LM2.jpeg", description: "Sebuah detail kecil yang mengubah kamar menjadi ruang perayaan — disiapkan diam-diam sebelum Anda tiba, menunggu tanpa bersuara.", includes: ["Swan towel art arrangement", "Taburan kelopak bunga segar", "Setup rapi sebelum kedatangan", "Sentuhan personal sesuai permintaan"], price: "Rp 150.000 / Setup" },
cake: { title: "Slice of Cake", subtitle: "Special Occasions", heroImg: "https://i.imgur.com/oxMN5GC.jpeg", description: "Dari tangan Pastry Chef kami, untuk satu momen yang layak dirayakan — sekecil atau sebesar apa pun alasannya.", includes: ["Potongan kue premium dari Pastry Chef", "Plating dekoratif elegan", "Layanan pengantaran ke kamar yang tepat waktu"], price: "Rp 100.000 / Slice" }
};
const allPackages = [
{ id: 'jeep', title: "Drini Jeep Adventure", img: "https://i.imgur.com/MNq2vF7.jpeg", desc: "Pesisir selatan punya rute yang hanya dikenal oleh mereka yang mau melambat cukup lama untuk menemukannya. Perjalanan eksploratif menyusuri lanskap Drini — bukan untuk tergesa-gesa, melainkan untuk benar-benar melihat." },
{ id: 'bajaj', title: "Coastal Bajaj Fun Trip", img: "https://i.imgur.com/6NqMxmV.jpeg", desc: "Cara paling estetik untuk mengenal kawasan Drini dari perspektif yang berbeda. Sebuah perjalanan santai yang dirancang sebagai cara menikmati waktu — bukan sebagai itinerary yang harus diselesaikan." },
{ id: 'bbq', title: "Rooftop BBQ Experience", img: "https://i.imgur.com/l7TWFGd.png", desc: "Angin laut, langit terbuka, dan bara yang menyala perlahan — private BBQ di rooftop ini dirancang untuk mereka yang mengerti bahwa perayaan terbaik tidak membutuhkan kebisingan." },
{ id: 'floating', title: "Floating Breakfast", img: "https://i.imgur.com/GhFJvq5.jpeg", desc: "Kolam privat. Nampan apung. Waktu yang sepenuhnya milik Anda. Tidak ada jadwal. Tidak ada tergesa. Hanya ketenangan yang mengapung bersama Anda." },
{ id: 'dinner', title: "Romantic Dinner", img: "https://i.imgur.com/HpmYccs.jpeg", desc: "Meja yang disiapkan hanya untuk berdua — dengan suasana yang hangat, cahaya yang tepat, dan sajian yang diracik dengan penuh perhatian. Untuk momen yang layak diingat lama setelah malam itu berakhir." },
{ id: 'towel', title: "Romantic Towel", img: "https://i.imgur.com/A7p4LM2.jpeg", desc: "Sebuah detail kecil yang mengubah kamar menjadi ruang perayaan — disiapkan diam-diam sebelum Anda tiba, menunggu tanpa bersuara." },
{ id: 'cake', title: "Slice of Cake", img: "https://i.imgur.com/oxMN5GC.jpeg", desc: "Dari tangan Pastry Chef kami, untuk satu momen yang layak dirayakan — sekecil atau sebesar apa pun alasannya." }
];
const meetingPackages = [
{ id: 'halfday', title: "HALF DAY MEETING EXPERIENCE", img: "https://i.imgur.com/t5TdB8L.jpeg", desc: "Untuk pertemuan hingga 4 jam. Akses ruang eksklusif, coffee break, makan siang/malam, dan dukungan profesional." },
{ id: 'fullday', title: "FULL DAY MEETING EXPERIENCE", img: "https://i.imgur.com/SDnmGz9.jpeg", desc: "Untuk pertemuan hingga 8 jam. Dua sesi coffee break, sajian makan siang, dan amenities yang disiapkan seamless." },
{ id: 'fullboard', title: "FULLBOARD MEETING EXPERIENCE", img: "https://i.imgur.com/OLQ6ZLg.jpeg", desc: "Untuk pertemuan intensif hingga 12 jam. Tiga sesi coffee break, sajian makan lengkap, dan elemen acara pendukung." }
];
// Data Baru: Detail Lengkap Paket Meeting
const detailedMeetingPackages = [
{
id: 'halfday',
title: "HALF DAY MEETING",
price: "Rp 350.000",
unit: "/ PAX",
includes: [
"Usage of Meeting Room for 4 hours",
"1x Coffee Break (2 snack items)",
"1x Buffet Lunch or Dinner",
"Notepads, pens, mints & mineral water for participants",
"Flipchart & standard meeting amenities",
"Standard sound system & microphones",
"LCD Projector (5000 Lumens) & Screen",
"High-speed Wi-Fi access",
"Includes 1x Attraction Ticket",
"Inclusive of Tax & Service Charge"
]
},
{
id: 'fullday',
title: "FULL DAY MEETING",
price: "Rp 550.000",
unit: "/ PAX",
includes: [
"Usage of Meeting Room for 8 hours",
"2x Coffee Breaks (2 snack items)",
"1x Buffet Lunch",
"Notepads, pens, mints & mineral water for participants",
"Flipchart & standard meeting amenities",
"Standard sound system & microphones",
"LCD Projector (5000 Lumens) & Screen",
"Includes Drini Park Entrance Ticket",
"Includes 1x Attraction Ticket",
"Inclusive of Tax & Service Charge"
]
},
{
id: 'fullboard',
title: "FULLBOARD MEETING",
price: "Rp 750.000",
unit: "/ PAX",
includes: [
"Usage of Function Room for 12 hours",
"3x Coffee Breaks, 1x Lunch, 1x Dinner",
"LCD Projector & Screen",
"Standard Sound System with Microphones",
"Standing Flipchart & Markers | Direction Signs",
"Notepads, pens, candies & mineral water",
"Receptionist Desk Setup",
"Standard Table & Chair Arrangements",
"Includes Drini Park Entrance Ticket",
"Includes 1x Attraction Ticket",
"Inclusive of Tax & Service Charge"
]
}
];
// Data Global Gallery dari User
const categories = ["All", "Rooms", "Meeting Room", "Experiences", "Aerial Photos", "Others"];
const galleryItems = [
// === ROOMS ===
{ id: 1, category: "Rooms", image: "https://i.imgur.com/KWyQzpt.jpeg" },
{ id: 2, category: "Rooms", image: "https://i.imgur.com/fJbsbLh.jpeg" },
{ id: 3, category: "Rooms", image: "https://i.imgur.com/HGXuSix.jpeg" },
{ id: 4, category: "Rooms", image: "https://i.imgur.com/Z1Xp37r.jpeg" },
{ id: 5, category: "Rooms", image: "https://i.imgur.com/PLPVZF3.jpeg" },
{ id: 6, category: "Rooms", image: "https://i.imgur.com/jjaZAFD.jpeg" },
{ id: 7, category: "Rooms", image: "https://i.imgur.com/e25gINs.jpeg" },
{ id: 8, category: "Rooms", image: "https://i.imgur.com/2aYxXpg.jpeg" },
{ id: 9, category: "Rooms", image: "https://i.imgur.com/ZVOMFGE.jpeg" },
{ id: 10, category: "Rooms", image: "https://i.imgur.com/Fz7a2kd.jpeg" },
{ id: 11, category: "Rooms", image: "https://i.imgur.com/mcfcWab.jpeg" },
{ id: 12, category: "Rooms", image: "https://i.imgur.com/EL8DRXn.jpeg" },
{ id: 13, category: "Rooms", image: "https://i.imgur.com/BtZvBlx.jpeg" },
{ id: 14, category: "Rooms", image: "https://i.imgur.com/ZoCw0Cg.jpeg" },
{ id: 15, category: "Rooms", image: "https://i.imgur.com/1xr7sDC.jpeg" },
{ id: 16, category: "Rooms", image: "https://i.imgur.com/leiEj38.jpeg" },
{ id: 17, category: "Rooms", image: "https://i.imgur.com/gKtlTYI.jpeg" },
{ id: 18, category: "Rooms", image: "https://i.imgur.com/aK9uH7A.jpeg" },
{ id: 19, category: "Rooms", image: "https://i.imgur.com/Rf8Li6E.jpeg" },
{ id: 20, category: "Rooms", image: "https://i.imgur.com/mk1v0Cw.jpeg" },
{ id: 21, category: "Rooms", image: "https://i.imgur.com/fOGdyXq.jpeg" },
{ id: 22, category: "Rooms", image: "https://i.imgur.com/hTyUQEg.jpeg" },
{ id: 23, category: "Rooms", image: "https://i.imgur.com/mLrUBq3.jpeg" },
{ id: 24, category: "Rooms", image: "https://i.imgur.com/uoCBAnj.jpeg" },
{ id: 25, category: "Rooms", image: "https://i.imgur.com/jIJ60Ru.jpeg" },
{ id: 26, category: "Rooms", image: "https://i.imgur.com/mvQGKfQ.jpeg" },
// === EXPERIENCES ===
{ id: 27, category: "Experiences", image: "https://i.imgur.com/EcX09Cn.jpeg" },
{ id: 28, category: "Experiences", image: "https://i.imgur.com/AmVVv3T.jpeg" },
{ id: 29, category: "Experiences", image: "https://i.imgur.com/rGT5e2m.jpeg" },
{ id: 30, category: "Experiences", image: "https://i.imgur.com/VYv1wfV.jpeg" },
{ id: 31, category: "Experiences", image: "https://i.imgur.com/rnabH61.jpeg" },
{ id: 32, category: "Experiences", image: "https://i.imgur.com/mCul9s9.jpeg" },
{ id: 33, category: "Experiences", image: "https://i.imgur.com/a7cLtWK.jpeg" },
{ id: 34, category: "Experiences", image: "https://i.imgur.com/M5VORW0.jpeg" },
{ id: 35, category: "Experiences", image: "https://i.imgur.com/aXWDnyn.jpeg" },
{ id: 36, category: "Experiences", image: "https://i.imgur.com/OGrQkPq.jpeg" },
{ id: 37, category: "Experiences", image: "https://i.imgur.com/0CGN3aR.jpeg" },
{ id: 38, category: "Experiences", image: "https://i.imgur.com/LkIOU7M.jpeg" },
{ id: 39, category: "Experiences", image: "https://i.imgur.com/RkpBLvH.jpeg" },
{ id: 40, category: "Experiences", image: "https://i.imgur.com/Xw2VgX0.jpeg" },
{ id: 41, category: "Experiences", image: "https://i.imgur.com/uS4jQUq.jpeg" },
{ id: 42, category: "Experiences", image: "https://i.imgur.com/FXjvnZ3.jpeg" },
{ id: 43, category: "Experiences", image: "https://i.imgur.com/QBmn9RB.jpeg" },
{ id: 44, category: "Experiences", image: "https://i.imgur.com/8Awk8yA.jpeg" },
{ id: 45, category: "Experiences", image: "https://i.imgur.com/iJzmVRx.jpeg" },
{ id: 46, category: "Experiences", image: "https://i.imgur.com/mk4Wj8S.jpeg" },
{ id: 47, category: "Experiences", image: "https://i.imgur.com/rIcpl5J.jpeg" },
{ id: 48, category: "Experiences", image: "https://i.imgur.com/HQEAZbj.jpeg" },
{ id: 49, category: "Experiences", image: "https://i.imgur.com/IO9E8ig.jpeg" },
{ id: 50, category: "Experiences", image: "https://i.imgur.com/rjHNcP7.jpeg" },
{ id: 51, category: "Experiences", image: "https://i.imgur.com/fPTramt.jpeg" },
{ id: 52, category: "Experiences", image: "https://i.imgur.com/loT889x.jpeg" },
{ id: 53, category: "Experiences", image: "https://i.imgur.com/uSSmjwn.jpeg" },
{ id: 54, category: "Experiences", image: "https://i.imgur.com/kl7F1FU.jpeg" },
{ id: 55, category: "Experiences", image: "https://i.imgur.com/oIsaVmM.jpeg" },
{ id: 56, category: "Experiences", image: "https://i.imgur.com/T3nWuWg.jpeg" },
{ id: 57, category: "Experiences", image: "https://i.imgur.com/yu9OoZU.jpeg" },
{ id: 58, category: "Experiences", image: "https://i.imgur.com/xaNSDq8.jpeg" },
{ id: 59, category: "Experiences", image: "https://i.imgur.com/hbfyoXs.jpeg" },
{ id: 60, category: "Experiences", image: "https://i.imgur.com/V8pP5Fx.jpeg" },
{ id: 61, category: "Experiences", image: "https://i.imgur.com/NjQ5z2G.jpeg" },
{ id: 62, category: "Experiences", image: "https://i.imgur.com/3BIr8HG.jpeg" },
{ id: 63, category: "Experiences", image: "https://i.imgur.com/m48ycL8.jpeg" },
{ id: 64, category: "Experiences", image: "https://i.imgur.com/DNz1xNG.jpeg" },
{ id: 65, category: "Experiences", image: "https://i.imgur.com/akbGXSM.jpeg" },
{ id: 66, category: "Experiences", image: "https://i.imgur.com/7w2Ni2P.jpeg" },
{ id: 67, category: "Experiences", image: "https://i.imgur.com/XxxONNo.jpeg" },
{ id: 68, category: "Experiences", image: "https://i.imgur.com/sFN6tgH.jpeg" },
{ id: 69, category: "Experiences", image: "https://i.imgur.com/UjahRnQ.jpeg" },
{ id: 70, category: "Experiences", image: "https://i.imgur.com/IzF1IxP.jpeg" },
{ id: 71, category: "Experiences", image: "https://i.imgur.com/ONO4gXP.jpeg" },
{ id: 72, category: "Experiences", image: "https://i.imgur.com/lAmWvVk.jpeg" },
{ id: 73, category: "Experiences", image: "https://i.imgur.com/9vVKDgJ.jpeg" },
{ id: 74, category: "Experiences", image: "https://i.imgur.com/D3bwdlv.jpeg" },
{ id: 75, category: "Experiences", image: "https://i.imgur.com/fk8QzGT.jpeg" },
{ id: 76, category: "Experiences", image: "https://i.imgur.com/UXpRPzY.jpeg" },
{ id: 77, category: "Experiences", image: "https://i.imgur.com/N1u7ftQ.jpeg" },
{ id: 78, category: "Experiences", image: "https://i.imgur.com/ZBJEgJT.jpeg" },
{ id: 79, category: "Experiences", image: "https://i.imgur.com/z5v8spE.jpeg" },
// === MEETING ROOM ===
{ id: 80, category: "Meeting Room", image: "https://i.imgur.com/8gIQqtQ.jpeg" },
{ id: 81, category: "Meeting Room", image: "https://i.imgur.com/TSg9VVM.jpeg" },
{ id: 82, category: "Meeting Room", image: "https://i.imgur.com/im2Sef5.jpeg" },
{ id: 83, category: "Meeting Room", image: "https://i.imgur.com/gPd8pkg.jpeg" },
{ id: 84, category: "Meeting Room", image: "https://i.imgur.com/5PPadbJ.jpeg" },
{ id: 85, category: "Meeting Room", image: "https://i.imgur.com/rveW3Cj.jpeg" },
{ id: 86, category: "Meeting Room", image: "https://i.imgur.com/WUq6AWe.jpeg" },
// === OTHERS ===
{ id: 87, category: "Others", image: "https://i.imgur.com/BszsjcD.jpeg" },
{ id: 88, category: "Others", image: "https://i.imgur.com/kzpoJvl.jpeg" },
{ id: 89, category: "Others", image: "https://i.imgur.com/qP56GLP.jpeg" },
{ id: 90, category: "Others", image: "https://i.imgur.com/6pe2I3O.jpeg" },
{ id: 91, category: "Others", image: "https://i.imgur.com/dNYmLLr.jpeg" },
{ id: 92, category: "Others", image: "https://i.imgur.com/6pR7MIx.jpeg" },
{ id: 93, category: "Others", image: "https://i.imgur.com/xsTeks5.jpeg" },
{ id: 94, category: "Others", image: "https://i.imgur.com/2CMvjTi.jpeg" },
{ id: 95, category: "Others", image: "https://i.imgur.com/BY4gc8A.jpeg" },
{ id: 96, category: "Others", image: "https://i.imgur.com/tLNT9yh.jpeg" },
{ id: 97, category: "Others", image: "https://i.imgur.com/uePPel1.jpeg" },
{ id: 98, category: "Others", image: "https://i.imgur.com/qaicu1L.jpeg" },
// === AERIAL PHOTOS ===
{ id: 99, category: "Aerial Photos", image: "https://i.imgur.com/SH5GRiO.jpeg" },
{ id: 100, category: "Aerial Photos", image: "https://i.imgur.com/TU7gxzT.jpeg" },
{ id: 101, category: "Aerial Photos", image: "https://i.imgur.com/TkU4iWD.jpeg" },
{ id: 102, category: "Aerial Photos", image: "https://i.imgur.com/33rcJSZ.jpeg" },
{ id: 103, category: "Aerial Photos", image: "https://i.imgur.com/A8WBdRk.jpeg" },
{ id: 104, category: "Aerial Photos", image: "https://i.imgur.com/tXvNv4T.jpeg" },
{ id: 105, category: "Aerial Photos", image: "https://i.imgur.com/NVIu8FG.jpeg" },
{ id: 106, category: "Aerial Photos", image: "https://i.imgur.com/aFb0Geo.jpeg" },
{ id: 107, category: "Aerial Photos", image: "https://i.imgur.com/7r9Qzyq.jpeg" },
{ id: 108, category: "Aerial Photos", image: "https://i.imgur.com/Q3qCyJP.jpeg" }
];
// Data Subset Khusus untuk Home Page Carousel
const homeGalleryItems = [
galleryItems.find(i => i.id === 1), // 1. Room
galleryItems.find(i => i.id === 80), // 2. Meeting Room
galleryItems.find(i => i.id === 27), // 3. Experience
galleryItems.find(i => i.id === 99), // 4. Aerial Photos
galleryItems.find(i => i.id === 87), // 5. Others
galleryItems.find(i => i.id === 2), // 6. Rooms
galleryItems.find(i => i.id === 81), // 7. Meeting Room
galleryItems.find(i => i.id === 28), // 8. Experience
galleryItems.find(i => i.id === 100), // 9. Aerial Photos
galleryItems.find(i => i.id === 88), // 10. Others
].filter(Boolean);
// === APP COMPONENT ===
export default function App() {
useLenis(); // Aktivasi Lenis Native Fallback Global Smooth Scroll
const [isScrolled, setIsScrolled] = useState(false);
const [navbarVisible, setNavbarVisible] = useState(true);
const [menuOpen, setMenuOpen] = useState(false);
const [floatingBarVisible, setFloatingBarVisible] = useState(false);
const [activePage, setActivePage] = useState('home');
const [selectedPackageId, setSelectedPackageId] = useState(null);
const [aboutImageIndex, setAboutImageIndex] = useState(0);
// Gallery state
const [activeCategory, setActiveCategory] = useState("All");
const [selectedGalleryItem, setSelectedGalleryItem] = useState(null);
const [visibleCount, setVisibleCount] = useState(24);
const [mapLoaded, setMapLoaded] = useState(false);
const mapRef = useRef(null);
const [showGuestPopup, setShowGuestPopup] = useState(false);
const [bookingDetails, setBookingDetails] = useState({ rooms: 1, adults: 2, children: 1 });
const [showRequestPopup, setShowRequestPopup] = useState(false);
const [showRoomTypePopup, setShowRoomTypePopup] = useState(false);
const [selectedRoomType, setSelectedRoomType] = useState("");
const [selectedRequests, setSelectedRequests] = useState([]);
const [otherRequestText, setOtherRequestText] = useState("");
const [isSubmitting, setIsSubmitting] = useState(false);
const [waNumber, setWaNumber] = useState("");
const [name, setName] = useState("");
const [checkInDate, setCheckInDate] = useState("");
const [checkOutDate, setCheckOutDate] = useState("");
const [toastMessage, setToastMessage] = useState("");
const guestPopupRef = useRef(null);
const requestPopupRef = useRef(null);
const roomTypePopupRef = useRef(null);
const lastScrollY = useRef(0);
const scrollTimeoutRef = useRef(null);
const isFabHoveredRef = useRef(false);
const todayDate = new Date().toISOString().split('T')[0];
useEffect(() => {
if (toastMessage) {
const timer = setTimeout(() => setToastMessage(""), 4000);
return () => clearTimeout(timer);
}
}, [toastMessage]);
useEffect(() => {
[
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossOrigin: 'anonymous' }
].forEach(attrs => {
const link = document.createElement('link');
Object.assign(link, attrs);
document.head.appendChild(link);
});
const fontLink = document.createElement('link');
fontLink.rel = 'stylesheet';
fontLink.href = 'https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400&display=optional';
document.head.appendChild(fontLink);
const editorialFontLink = document.createElement('link');
editorialFontLink.rel = 'stylesheet';
editorialFontLink.href = 'https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=Inter:wght@300;400;500&display=swap';
document.head.appendChild(editorialFontLink);
}, []);
useEffect(() => {
const observer = new IntersectionObserver(
([entry]) => { if (entry.isIntersecting) setMapLoaded(true); },
{ rootMargin: '200px', threshold: 0.1 }
);
if (mapRef.current) observer.observe(mapRef.current);
return () => observer.disconnect();
}, []);
useEffect(() => {
const nextIdx = (aboutImageIndex + 1) % aboutImages.length;
const img = new Image();
img.src = aboutImages[nextIdx];
}, [aboutImageIndex]);
useEffect(() => {
function handleClickOutside(event) {
if (guestPopupRef.current && !guestPopupRef.current.contains(event.target)) setShowGuestPopup(false);
if (requestPopupRef.current && !requestPopupRef.current.contains(event.target)) setShowRequestPopup(false);
if (roomTypePopupRef.current && !roomTypePopupRef.current.contains(event.target)) setShowRoomTypePopup(false);
}
document.addEventListener("mousedown", handleClickOutside);
return () => document.removeEventListener("mousedown", handleClickOutside);
}, []);
useEffect(() => {
let ticking = false;
const handleScroll = () => {
if (!ticking) {
window.requestAnimationFrame(() => {
const currentScrollY = window.scrollY;
setIsScrolled(currentScrollY > 50);
// Logika Hide/Show Navbar dengan Threshold (Pencegah Blink)
if (currentScrollY <= 150) {
setNavbarVisible(true);
} else {
const delta = currentScrollY - lastScrollY.current;
if (delta > 8) { // User scroll turun lebih dari 8px
setNavbarVisible(false);
} else if (delta < -8) { // User scroll naik lebih dari 8px
setNavbarVisible(true);
}
}
const maxScroll = document.documentElement.scrollHeight - window.innerHeight;
const isValidRange = currentScrollY > 400 && currentScrollY < maxScroll - 150;
if (isValidRange) setFloatingBarVisible(true);
else setFloatingBarVisible(false);
if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);
scrollTimeoutRef.current = setTimeout(() => {
if (!isFabHoveredRef.current) setFloatingBarVisible(false);
}, 2500);
lastScrollY.current = currentScrollY;
ticking = false;
});
ticking = true;
}
};
window.addEventListener('scroll', handleScroll, { passive: true });
return () => {
window.removeEventListener('scroll', handleScroll);
if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);
};
}, []);
// === CUSTOM CURSOR (DESKTOP ONLY) EVENT BINDING ===
useEffect(() => {
if (!window.matchMedia('(hover: hover)').matches) return;
const cursor = document.querySelector('.luxury-cursor');
const zones = document.querySelectorAll('.experiences-section');
if (!cursor || zones.length === 0) return;
let mx = 0, my = 0, cx = 0, cy = 0;
let rafId;
const animate = () => {
cx += (mx - cx) * 0.18;
cy += (my - cy) * 0.18;
if (cursor) {
cursor.style.transform = `translate(${cx}px, ${cy}px) translate(-50%, -50%) scale(${cursor.classList.contains('is-visible') ? (cursor.classList.contains('is-dragging') ? 0.85 : 1) : 0})`;
}
rafId = requestAnimationFrame(animate);
};
animate();
const onMouseMove = e => { mx = e.clientX; my = e.clientY; };
const onMouseEnter = () => cursor.classList.add('is-visible');
const onMouseLeave = () => cursor.classList.remove('is-visible','is-dragging');
const onMouseDown = () => cursor.classList.add('is-dragging');
const onMouseUp = () => cursor.classList.remove('is-dragging');
document.addEventListener('mousemove', onMouseMove);
// Bind ke semua area slider yang ada
zones.forEach(z => {
z.addEventListener('mouseenter', onMouseEnter);
z.addEventListener('mouseleave', onMouseLeave);
z.addEventListener('mousedown', onMouseDown);
z.addEventListener('mouseup', onMouseUp);
});
return () => {
cancelAnimationFrame(rafId);
document.removeEventListener('mousemove', onMouseMove);
zones.forEach(z => {
z.removeEventListener('mouseenter', onMouseEnter);
z.removeEventListener('mouseleave', onMouseLeave);
z.removeEventListener('mousedown', onMouseDown);
z.removeEventListener('mouseup', onMouseUp);
});
};
}, [activePage]);
// === FADE-IN SECTION & SCROLL FINAL TOUCH ===
useEffect(() => {
// Timeout ringan agar komponen lain selesai render sebelum di-observe
const timer = setTimeout(() => {
document.querySelectorAll('section:not(.experiences-section)').forEach(el => {
el.classList.add('fade-in-section');
});
const io = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('is-visible');
io.unobserve(entry.target);
}
});
}, { threshold: 0.1, rootMargin: '0px 0px -80px 0px' });
document.querySelectorAll('.fade-in-section').forEach(el => io.observe(el));
}, 150);
return () => clearTimeout(timer);
}, [activePage]);
// Reset pagination saat mengganti kategori
useEffect(() => {
setVisibleCount(24);
}, [activeCategory]);
const scrollToBooking = (e) => {
if (e) e.preventDefault();
const targetAction = () => {
const el = document.getElementById('booking-widget-section');
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' });
};
if (activePage !== 'home') {
setActivePage('home');
setTimeout(targetAction, 100);
} else {
targetAction();
}
setMenuOpen(false);
};
const handleNavClick = (item, e) => {
if (e) e.preventDefault();
if (item === 'Meetings') {
setActivePage('meetings');
window.scrollTo({ top: 0, behavior: 'smooth' });
setMenuOpen(false);
return;
}
// Pastikan kita berada di beranda terlebih dahulu untuk menu lainnya
setActivePage('home');
let targetId = 'home';
if (item === 'Rooms') targetId = 'rooms';
else if (item === 'Gallery') targetId = 'home-gallery';
else if (item === 'Signature Experiences') targetId = 'package';
// Beri jeda 100ms agar DOM Beranda selesai di-render jika sebelumnya berada di halaman detail
setTimeout(() => {
if (targetId === 'home') {
window.scrollTo({ top: 0, behavior: 'smooth' });
} else {
const el = document.getElementById(targetId);
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}, 100);
setMenuOpen(false);
};
const openPackageDetail = (pkgId) => {
setSelectedPackageId(pkgId);
setActivePage('package-detail');
window.scrollTo({ top: 0, behavior: 'smooth' });
};
const updateBooking = (field, delta) => {
setBookingDetails(prev => {
const newValue = prev[field] + delta;
if (field === 'rooms' && (newValue < 1 || newValue > 5)) return prev;
if (field === 'adults' && (newValue < 1 || newValue > 20)) return prev;
if (field === 'children' && (newValue < 0 || newValue > 10)) return prev;
return { ...prev, [field]: newValue };
});
};
const handleWaChange = (e) => {
const value = e.target.value;
const numericValue = value.replace(/[^0-9+]/g, '');
setWaNumber(numericValue);
};
const toggleRequest = (option) => {
setSelectedRequests(prev => prev.includes(option) ? prev.filter(item => item !== option) : [...prev, option]);
};
const formatDisplayDate = (dateStr) => {
if (!dateStr) return "Pilih Tanggal";
const [y, m, d] = dateStr.split('-');
const months = ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des"];
return `${d} ${months[parseInt(m, 10) - 1]} ${y}`;
};
const handleBookNowSubmit = () => {
if (!name.trim()) return setToastMessage("Please enter your full name.");
if (!waNumber.trim() || waNumber.length < 10) return setToastMessage("Please enter a valid WhatsApp number.");
if (!selectedRoomType) return setToastMessage("Please select a room type.");
if (!checkInDate) return setToastMessage("Please select a check-in date.");
if (!checkOutDate) return setToastMessage("Please select a check-out date.");
if (checkOutDate <= checkInDate) return setToastMessage("Check-out date must be after check-in date.");
const targetNumber = "6281325553007";
let requestStr = selectedRequests.join(", ");
if (selectedRequests.includes("Other") && otherRequestText.trim() !== "") {
requestStr = requestStr.replace("Other", `Other (${otherRequestText})`);
}
if (requestStr === "") requestStr = "-";
const totalGuests = `${bookingDetails.rooms} Kamar, ${bookingDetails.adults} Dewasa, ${bookingDetails.children} Anak`;
const message = `Halo Tim Reservasi Drini Park Resort, saya ingin melakukan reservasi dengan detail berikut:\n\nNama Lengkap: ${name || "-"}\nWhatsApp Number: ${waNumber || "-"}\nRoom Type: ${selectedRoomType || "-"}\nRequest: ${requestStr}\nCheck In: ${formatDisplayDate(checkInDate)}\nCheck Out: ${formatDisplayDate(checkOutDate)}\nJumlah tamu: ${totalGuests}\n\nMohon info ketersediaannya. Terima kasih!`;
const encodedMessage = encodeURIComponent(message);
const waUrl = `https://wa.me/${targetNumber}?text=${encodedMessage}`;
setIsSubmitting(true);
window.open(waUrl, '_blank');
setTimeout(() => setIsSubmitting(false), 2000);
};
const handleGeneralInquiry = (packageName) => {
const targetNumber = "6281325553007";
const message = `Halo Tim Reservasi Drini Park Resort, saya ingin menanyakan informasi lebih lanjut mengenai: *${packageName}*.`;
const encodedMessage = encodeURIComponent(message);
const waUrl = `https://wa.me/${targetNumber}?text=${encodedMessage}`;
window.open(waUrl, '_blank');
};
// Gallery Logics
const filteredGallery = activeCategory === "All"
? galleryItems
: galleryItems.filter((item) => item.category === activeCategory);
const currentGalleryIndex = filteredGallery.findIndex((i) => i.id === selectedGalleryItem?.id);
const handleGalleryPrev = () => {
const prevIndex = (currentGalleryIndex - 1 + filteredGallery.length) % filteredGallery.length;
setSelectedGalleryItem(filteredGallery[prevIndex]);
};
const handleGalleryNext = () => {
const nextIndex = (currentGalleryIndex + 1) % filteredGallery.length;
setSelectedGalleryItem(filteredGallery[nextIndex]);
};
const isNavSolid = isScrolled || !['home', 'gallery'].includes(activePage);
return (
<div className="min-h-screen bg-neutral-50 font-sans text-neutral-800 scroll-smooth overflow-x-hidden">
{/* TOAST NOTIFICATION */}
{toastMessage && (
<div className="fixed top-6 md:top-10 left-1/2 -translate-x-1/2 z-[300] bg-[#1c1c1c]/95 backdrop-blur-md text-[#D4AF37] px-6 py-4 rounded-[8px] md:rounded-full shadow-2xl flex items-center gap-6 animate-in slide-in-from-top-4 border border-[#D4AF37]/30">
<span className="text-[10px] md:text-[11px] font-bold uppercase tracking-widest leading-snug whitespace-nowrap">{toastMessage}</span>
<button onClick={() => setToastMessage("")} className="hover:text-white transition-colors touch-action-manipulation p-1"><X size={16}/></button>
</div>
)}
{/* GLOBAL STYLES WITH ANIMATION FALLBACK & MOBILE OVERSCROLL FIX */}
<style dangerouslySetInnerHTML={{__html: `
@media (min-width: 768px) {
body { overscroll-behavior-y: none; }
}
/* ── Swiper Luxury Carousel ─────────────────────────────── */
.experiences-section {
padding: 100px 0 80px;
background: #faf8f4; /* warna cream lembut Drini */
overflow: hidden;
position: relative;
}
.section-header {
padding: 0 max(80px, 5vw);
margin-bottom: 60px;
}
.section-header .tag-label {
color: #8a7a5e;
display: block;
margin-bottom: 16px;