'use client'
import { H2, H3, H4, P, PS, PXS, PXXS } from '@/components/text'
import * as Headless from '@headlessui/react'
import { ArrowLongRightIcon } from '@heroicons/react/20/solid'
import { clsx } from 'clsx'
import {
motion,
useMotionValueEvent,
useScroll,
useSpring,
} from 'framer-motion'
import { useCallback, useLayoutEffect, useRef, useState } from 'react'
import useMeasure from 'react-use-measure'
import { Container } from './Container'
import { Link } from './link'
import { Heading, Subheading } from './text'
const testimonials = [
{
img: '/images/veda1.jpg',
subtitle: 'A beautiful 50-meter dahabiya offering a tranquil and organic platform for personalized cruises.',
quote: 'VEDA I',
href: '/phases/phase1',
},
{
img: '/images/veda2.jpg',
subtitle: 'An elegant 45-meter dahabiya, ideal for hosting larger groups, healing retreats, company getaways, and more.',
quote: 'VEDA II',
href: '/phases/phase2',
},
{
img: '/images/veda3.jpg',
subtitle: 'A cozy 18-meter dahabiya offering a serene floating home, perfect for private groups seeking tranquility and comfort on the Nile.',
quote: 'VEDA III',
href: '/phases/phase3',
},
{
img: '/images/veda4.jpg',
subtitle: 'A spaciou 55-meter dahabeya offering a serene retreat, perfect for bigger groups seeking tranquility and comfort on the Nile.',
quote: 'VEDA IV',
href: '/phases/phase4',
},
]
function TestimonialCard({
subtitle,
name,
title,
img,
href,
children,
bounds,
scrollX,
...props
}) {
let ref = useRef(null)
let computeOpacity = useCallback(() => {
let element = ref.current
if (!element || bounds.width === 0) return 1
let rect = element.getBoundingClientRect()
if (rect.left < bounds.left) {
let diff = bounds.left - rect.left
let percent = diff / rect.width
return Math.max(0.5, 1 - percent)
} else if (rect.right > bounds.right) {
let diff = rect.right - bounds.right
let percent = diff / rect.width
return Math.max(0.5, 1 - percent)
} else {
return 1
}
}, [ref, bounds.width, bounds.left, bounds.right])
let opacity = useSpring(computeOpacity(), {
stiffness: 154,
damping: 23,
})
useLayoutEffect(() => {
opacity.set(computeOpacity())
}, [computeOpacity, opacity])
useMotionValueEvent(scrollX, 'change', () => {
opacity.set(computeOpacity())
})
return (
{subtitle}
{children}
Discover peaceful platforms where every detail ensures a truly memorable stay. Our fleet of traditional dahabiyas combines authentic Nile heritage with modern comfort, offering intimate sailing experiences that connect you with Egypt's timeless river culture.