Spaces:
Sleeping
Sleeping
Download components/ProblemSolution/ProblemSolution.tsx from Keep-Triangle/PratikWebsite: direct link, hf CLI and curl.
- Browser
- Download file 4.52 kB
-
https://huggingface.co/spaces/Keep-Triangle/PratikWebsite/resolve/main/components/ProblemSolution/ProblemSolution.tsx
- Command line
-
hf download hf://spaces/Keep-Triangle/PratikWebsite/components/ProblemSolution/ProblemSolution.tsx
-
curl -L -o ProblemSolution.tsx https://huggingface.co/spaces/Keep-Triangle/PratikWebsite/resolve/main/components/ProblemSolution/ProblemSolution.tsx
4.52 kB
| import React from 'react'; | |
| import { motion, Variants } from 'framer-motion'; | |
| import { COMPARISON_DATA } from '../../data/mockData'; | |
| import { ComparisonItem } from '../../types'; | |
| const ProblemSolution: React.FC = () => { | |
| // Jitter animation for "Problem" items | |
| const jitter: Variants = { | |
| animate: { | |
| x: [0, -2, 2, -1, 1, 0], | |
| y: [0, 1, -1, 0, 1, 0], | |
| opacity: [0.6, 0.8, 0.5, 0.7], | |
| transition: { | |
| duration: 2, // Slower, persistent unease | |
| repeat: Infinity, | |
| repeatType: "mirror", | |
| ease: "linear" | |
| } | |
| } | |
| }; | |
| // Smooth entry for "Solution" items | |
| const smoothEntry: Variants = { | |
| hidden: { opacity: 0, x: 20 }, | |
| visible: (i: number) => ({ | |
| opacity: 1, | |
| x: 0, | |
| transition: { | |
| delay: i * 0.1, | |
| duration: 0.8, | |
| ease: [0.22, 1, 0.36, 1] as [number, number, number, number] | |
| } | |
| }) | |
| }; | |
| return ( | |
| <section className="relative w-full min-h-[80vh] flex flex-col md:flex-row bg-transparent"> | |
| {/* LEFT SIDE: The Problem (Chaos) */} | |
| <div className="w-full md:w-1/2 bg-[#0e0303] relative overflow-hidden flex flex-col justify-center px-8 py-16 md:px-16 lg:px-24 border-y border-white/5 md:border-y-0 md:border-r border-white/5"> | |
| <motion.div | |
| initial={{ opacity: 0 }} | |
| whileInView={{ opacity: 1 }} | |
| className="relative z-20" | |
| > | |
| <h3 className="font-serif text-3xl md:text-4xl text-white/40 mb-12 tracking-wide"> | |
| The Uncertainty | |
| </h3> | |
| <div className="space-y-8"> | |
| {COMPARISON_DATA.map((item: ComparisonItem) => ( | |
| <motion.div | |
| key={`prob-${item.id}`} | |
| className="flex items-center gap-4" | |
| variants={jitter} | |
| animate="animate" | |
| > | |
| <div className="w-1.5 h-1.5 bg-red-900/50 rounded-full" /> | |
| <p className="font-sans text-xl md:text-2xl text-red-100/30 line-through decoration-red-900/50 decoration-2"> | |
| {item.problem} | |
| </p> | |
| </motion.div> | |
| ))} | |
| </div> | |
| </motion.div> | |
| </div> | |
| {/* RIGHT SIDE: The Solution (Control) */} | |
| <div className="w-full md:w-1/2 relative bg-[#140404] flex flex-col justify-center px-8 py-16 md:px-16 lg:px-24 border-l border-white/5"> | |
| <motion.div | |
| initial="hidden" | |
| whileInView="visible" | |
| viewport={{ once: true, margin: "-20%" }} | |
| className="relative z-20" | |
| > | |
| <h3 className="font-serif text-3xl md:text-4xl text-brand-gold mb-12 tracking-wide"> | |
| The Standard | |
| </h3> | |
| <div className="space-y-8"> | |
| {COMPARISON_DATA.map((item: ComparisonItem, index: number) => ( | |
| <motion.div | |
| key={`sol-${item.id}`} | |
| custom={index} | |
| variants={smoothEntry} | |
| className="flex items-center gap-6" | |
| > | |
| <div className="w-8 h-[1px] bg-brand-red" /> | |
| <p className="font-sans text-xl md:text-2xl text-white font-medium tracking-tight"> | |
| {item.solution} | |
| </p> | |
| </motion.div> | |
| ))} | |
| </div> | |
| </motion.div> | |
| {/* Subtle sheen effect on right side */} | |
| <div className="absolute top-0 right-0 w-full h-full bg-gradient-to-b from-white/7 to-transparent pointer-events-none" /> | |
| </div> | |
| </section> | |
| ); | |
| }; | |
| export default ProblemSolution; |