-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagueEditorialModal.jsx
More file actions
127 lines (115 loc) · 5.07 KB
/
VagueEditorialModal.jsx
File metadata and controls
127 lines (115 loc) · 5.07 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
import React from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { XIcon, DownloadSimpleIcon } from '@phosphor-icons/react';
const VagueEditorialModal = ({ isOpen, onClose, item, isInvert = true }) => {
if (!item) return null;
const title = item.title;
const description = item.description;
const url = item.url;
const date = item.date;
return (
<AnimatePresence>
{isOpen && (
<div
className={`fixed inset-0 z-[3000] flex items-center justify-center p-4 md:p-8 ${isInvert ? 'is-invert' : ''}`}
>
{/* Backdrop */}
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
onClick={onClose}
className="absolute inset-0 bg-black/60 backdrop-blur-sm"
/>
{/* Modal Container */}
<motion.div
initial={{ opacity: 0, y: 50, scale: 0.98 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
exit={{ opacity: 0, y: 30, scale: 0.98 }}
className={`relative w-full max-w-3xl max-h-[90vh] md:max-h-[85vh] overflow-hidden flex flex-col shadow-2xl transition-colors duration-500
${isInvert ? 'bg-[#1a1a1a] text-[#f4f4f4]' : 'bg-[#f4f4f4] text-[#1a1a1a]'}`}
onClick={(e) => e.stopPropagation()}
>
{/* Header / Top Bar */}
<div
className={`flex items-center justify-between p-4 md:p-6 border-b ${isInvert ? 'border-[#f4f4f4]/25' : 'border-[#1a1a1a]/25'}`}
>
<div className="flex flex-col">
<span className="font-instr-sans text-[9px] md:text-[10px] uppercase tracking-[0.3em] opacity-50 mb-1">
Issue Details
</span>
<span className="font-instr-sans text-[10px] md:text-[11px] font-black uppercase tracking-widest">
{date}
</span>
</div>
<button
onClick={onClose}
className={`p-2 transition-transform hover:rotate-90 duration-300 ${isInvert ? 'text-[#f4f4f4]' : 'text-[#1a1a1a]'}`}
>
<XIcon weight="bold" size={20} className="md:w-6 md:h-6" />
</button>
</div>
{/* Content Area */}
<div className="p-6 md:p-16 flex-1 overflow-y-auto custom-scrollbar">
<div className="max-w-2xl mx-auto text-center">
{item.image && (
<div className="mb-8 md:mb-12 relative group">
<img
src={item.image}
alt={title}
className={`w-full max-w-[180px] md:max-w-sm mx-auto shadow-2xl transition-all duration-700
${
isInvert
? 'grayscale invert contrast-125'
: 'grayscale contrast-125'
}`}
/>
<div
className={`absolute inset-0 pointer-events-none border ${isInvert ? 'border-[#f4f4f4]/25' : 'border-[#1a1a1a]/25'}`}
/>
</div>
)}
<h2 className="text-4xl md:text-7xl font-instr-serif italic leading-tight md:leading-none mb-6 md:mb-12">
{title}
</h2>
<div
className={`w-12 h-px mx-auto mb-8 md:mb-12 ${isInvert ? 'bg-[#f4f4f4]/25' : 'bg-[#1a1a1a]/25'}`}
/>
<p className="text-lg md:text-2xl font-instr-serif leading-relaxed italic opacity-80 mb-10 md:mb-16">
{description}
</p>
{url && url !== '#' && (
<div className="mt-4 md:mt-8 flex flex-col items-center gap-4 md:gap-6">
<a
href={url}
target="_blank"
rel="noopener noreferrer"
className="c-button -whiteInvert !h-auto !py-3 md:!py-4 !px-8 md:!px-10 group"
>
<span className="c-button_label uppercase tracking-[0.3em] text-[10px] md:text-xs font-black flex items-center gap-3 md:gap-4">
Download PDF
<DownloadSimpleIcon
weight="bold"
size={18}
className="md:w-5 md:h-5 group-hover:translate-y-1 transition-transform"
/>
</span>
</a>
<p className="font-instr-sans text-[8px] md:text-[9px] uppercase tracking-[0.2em] opacity-40">
Format: PDF Document
</p>
</div>
)}
</div>
</div>
{/* Footer decoration */}
<div
className={`h-2 w-full ${isInvert ? 'bg-white/5' : 'bg-black/5'}`}
/>
</motion.div>
</div>
)}
</AnimatePresence>
);
};
export default VagueEditorialModal;