|
| 1 | +import React from 'react'; |
| 2 | +import { motion, AnimatePresence } from 'framer-motion'; |
| 3 | +import { XIcon, DownloadSimpleIcon } from '@phosphor-icons/react'; |
| 4 | + |
| 5 | +const VagueEditorialModal = ({ |
| 6 | + isOpen, |
| 7 | + onClose, |
| 8 | + item, |
| 9 | + isInvert = true |
| 10 | +}) => { |
| 11 | + if (!item) return null; |
| 12 | + |
| 13 | + const title = item.title; |
| 14 | + const description = item.description; |
| 15 | + const url = item.url; |
| 16 | + const date = item.date; |
| 17 | + |
| 18 | + return ( |
| 19 | + <AnimatePresence> |
| 20 | + {isOpen && ( |
| 21 | + <div className={`fixed inset-0 z-[3000] flex items-center justify-center p-4 md:p-8 ${isInvert ? 'is-invert' : ''}`}> |
| 22 | + {/* Backdrop */} |
| 23 | + <motion.div |
| 24 | + initial={{ opacity: 0 }} |
| 25 | + animate={{ opacity: 1 }} |
| 26 | + exit={{ opacity: 0 }} |
| 27 | + onClick={onClose} |
| 28 | + className="absolute inset-0 bg-black/60 backdrop-blur-sm" |
| 29 | + /> |
| 30 | + |
| 31 | + {/* Modal Container */} |
| 32 | + <motion.div |
| 33 | + initial={{ opacity: 0, y: 50, scale: 0.98 }} |
| 34 | + animate={{ opacity: 1, y: 0, scale: 1 }} |
| 35 | + exit={{ opacity: 0, y: 30, scale: 0.98 }} |
| 36 | + className={`relative w-full max-w-3xl overflow-hidden flex flex-col shadow-2xl transition-colors duration-500 |
| 37 | + ${isInvert ? 'bg-[#1a1a1a] text-[#f4f4f4]' : 'bg-[#f4f4f4] text-[#1a1a1a]'}`} |
| 38 | + onClick={(e) => e.stopPropagation()} |
| 39 | + > |
| 40 | + {/* Header / Top Bar */} |
| 41 | + <div className={`flex items-center justify-between p-6 border-b ${isInvert ? 'border-white/10' : 'border-black/10'}`}> |
| 42 | + <div className="flex flex-col"> |
| 43 | + <span className="font-instr-sans text-[10px] uppercase tracking-[0.3em] opacity-50 mb-1">Archive Record</span> |
| 44 | + <span className="font-instr-sans text-[11px] font-black uppercase tracking-widest">{date}</span> |
| 45 | + </div> |
| 46 | + <button |
| 47 | + onClick={onClose} |
| 48 | + className={`p-2 transition-transform hover:rotate-90 duration-300 ${isInvert ? 'text-white' : 'text-black'}`} |
| 49 | + > |
| 50 | + <XIcon weight="bold" size={24} /> |
| 51 | + </button> |
| 52 | + </div> |
| 53 | + |
| 54 | + {/* Content Area */} |
| 55 | + <div className="p-8 md:p-16 flex-1 overflow-y-auto custom-scrollbar"> |
| 56 | + <div className="max-w-2xl mx-auto text-center"> |
| 57 | + <h2 className="text-5xl md:text-7xl font-instr-serif italic leading-none mb-12"> |
| 58 | + {title} |
| 59 | + </h2> |
| 60 | + |
| 61 | + <div className={`w-12 h-px mx-auto mb-12 ${isInvert ? 'bg-white/20' : 'bg-black/20'}`} /> |
| 62 | + |
| 63 | + <p className="text-xl md:text-2xl font-instr-serif leading-relaxed italic opacity-80 mb-16"> |
| 64 | + {description} |
| 65 | + </p> |
| 66 | + |
| 67 | + {url && url !== '#' && ( |
| 68 | + <div className="mt-8 flex flex-col items-center gap-6"> |
| 69 | + <a |
| 70 | + href={url} |
| 71 | + target="_blank" |
| 72 | + rel="noopener noreferrer" |
| 73 | + className={`group flex items-center gap-4 px-10 py-5 transition-all duration-300 border-2 |
| 74 | + ${isInvert |
| 75 | + ? 'bg-white text-black border-white hover:bg-transparent hover:text-white' |
| 76 | + : 'bg-black text-white border-black hover:bg-transparent hover:text-black'}`} |
| 77 | + > |
| 78 | + <span className="font-instr-sans font-black text-xs uppercase tracking-[0.3em]"> |
| 79 | + {item.actionLabel || "Download Artifact"} |
| 80 | + </span> |
| 81 | + <DownloadSimpleIcon weight="bold" size={20} className="group-hover:translate-y-1 transition-transform" /> |
| 82 | + </a> |
| 83 | + |
| 84 | + <p className="font-instr-sans text-[9px] uppercase tracking-[0.2em] opacity-40"> |
| 85 | + Format: Portable Document Format (PDF) |
| 86 | + </p> |
| 87 | + </div> |
| 88 | + )} |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + {/* Footer decoration */} |
| 93 | + <div className={`h-2 w-full ${isInvert ? 'bg-white/5' : 'bg-black/5'}`} /> |
| 94 | + </motion.div> |
| 95 | + </div> |
| 96 | + )} |
| 97 | + </AnimatePresence> |
| 98 | + ); |
| 99 | +}; |
| 100 | + |
| 101 | +export default VagueEditorialModal; |
0 commit comments