import { useEffect, useMemo, useRef, useState } from 'react' import clsx from 'clsx' import { motion, useAnimationFrame, useInView, useMotionValue, useSpring, useTransform, } from 'framer-motion' import { Container } from '@/components/Container' const reviews = [ { title: 'It really works.', body: 'I downloaded Pocket today and turned $5000 into $25,000 in half an hour.', author: 'CrazyInvestor', rating: 5, }, { title: 'You need this app.', body: 'I didn’t understand the stock market at all before Pocket. I still don’t, but at least I’m rich now.', author: 'CluelessButRich', rating: 5, }, { title: 'This shouldn’t be legal.', body: 'Pocket makes it so easy to win big in the stock market that I can’t believe it’s actually legal.', author: 'LivingDaDream', rating: 5, }, { title: 'Screw financial advisors.', body: 'I barely made any money investing in mutual funds. With Pocket, I’m doubling my net-worth every single month.', author: 'JordanBelfort1962', rating: 5, }, { title: 'I love it!', body: 'I started providing insider information myself and now I get new insider tips every 5 minutes. I don’t even have time to act on all of them. New Lamborghini is being delivered next week!', author: 'MrBurns', rating: 5, }, { title: 'Too good to be true.', body: 'I was making money so fast with Pocket that it felt like a scam. But I sold my shares and withdrew the money and it’s really there, right in my bank account. This app is crazy!', author: 'LazyRich99', rating: 5, }, { title: 'Wish I could give 6 stars', body: 'This is literally the most important app you will ever download in your life. Get on this before it’s so popular that everyone else is getting these tips too.', author: 'SarahLuvzCash', rating: 5, }, { title: 'Bought an island.', body: 'Yeah, you read that right. Want your own island too? Get Pocket.', author: 'ScroogeMcduck', rating: 5, }, { title: 'No more debt!', body: 'After 2 weeks of trading on Pocket I was debt-free. Why did I even go to school at all when Pocket exists?', author: 'BruceWayne', rating: 5, }, { title: 'I’m 13 and I’m rich.', body: 'I love that with Pocket’s transaction anonymization I could sign up and start trading when I was 12 years old. I had a million dollars before I had armpit hair!', author: 'RichieRich', rating: 5, }, { title: 'Started an investment firm.', body: 'I charge clients a 3% management fee and just throw all their investments into Pocket. Easy money!', author: 'TheCountOfMonteChristo', rating: 5, }, { title: 'It’s like a superpower.', body: 'Every tip Pocket has sent me has paid off. It’s like playing Blackjack but knowing exactly what card is coming next!', author: 'ClarkKent', rating: 5, }, { title: 'Quit my job.', body: 'I downloaded Pocket three days ago and quit my job today. I can’t believe no one else thought to build a stock trading app that works this way!', author: 'GeorgeCostanza', rating: 5, }, { title: 'Don’t download this app', body: 'Unless you want to have the best life ever! I am literally writing this from a yacht.', author: 'JeffBezos', rating: 5, }, ] function StarIcon(props) { return ( ) } function StarRating({ rating }) { return (
{[...Array(5).keys()].map((index) => ( index ? 'fill-cyan-500' : 'fill-gray-300' )} /> ))}
) } function Review({ title, body, author, rating, className, ...props }) { let animationDelay = useMemo(() => { let possibleAnimationDelays = ['0s', '0.1s', '0.2s', '0.3s', '0.4s', '0.5s'] return possibleAnimationDelays[ Math.floor(Math.random() * possibleAnimationDelays.length) ] }, []) return (

{title}

{body}

{author}
) } function splitArray(array, numParts) { let result = [] for (let i = 0; i < array.length; i++) { let index = i % numParts if (!result[index]) { result[index] = [] } result[index].push(array[i]) } return result } function ReviewColumn({ className, reviews, reviewClassName = () => {}, msPerPixel = 0, }) { let columnRef = useRef() let [columnHeight, setColumnHeight] = useState(0) let duration = `${columnHeight * msPerPixel}ms` useEffect(() => { let resizeObserver = new window.ResizeObserver(() => { setColumnHeight(columnRef.current.offsetHeight) }) resizeObserver.observe(columnRef.current) return () => { resizeObserver.disconnect() } }, []) return (
{reviews.concat(reviews).map((review, reviewIndex) => ( = reviews.length} className={reviewClassName(reviewIndex % reviews.length)} {...review} /> ))}
) } function ReviewGrid() { let containerRef = useRef() let isInView = useInView(containerRef, { once: true, amount: 0.4 }) let columns = splitArray(reviews, 3) columns = [columns[0], columns[1], splitArray(columns[2], 2)] return (
{isInView && ( <> clsx( reviewIndex >= columns[0].length + columns[2][0].length && 'md:hidden', reviewIndex >= columns[0].length && 'lg:hidden' ) } msPerPixel={10} /> reviewIndex >= columns[1].length && 'lg:hidden' } msPerPixel={15} /> )}
) } export function Reviews() { return (

Everyone is changing their life with Pocket.

Thousands of people have doubled their net-worth in the last 30 days.

) }