Repository navigation
Expand file tree
/
Copy pathHowItWorks.jsx
More file actions
387 lines (370 loc) · 13.3 KB
/
Copy pathHowItWorks.jsx
File metadata and controls
387 lines (370 loc) · 13.3 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
import React, { useState } from 'react';
import { Shield, Eye, Zap, Lock, ChevronRight } from 'lucide-react';
const HowItWorks = () => {
const [activeStep, setActiveStep] = useState(0);
const steps = [
{
number: "01",
title: "Upload Your Image",
description: "You select a JPEG image you want to protect from deepfake algorithms.",
technical: "FastAPI receives the image file and validates it's a proper JPEG format.",
icon: Shield
},
{
number: "02",
title: "Gaussian Noise Application",
description: "We apply carefully calibrated Gaussian noise to your image - tiny, imperceptible changes to pixel values.",
technical: "The apply_gauss() function from our Masks module adds mathematically-computed noise that disrupts AI model feature extraction.",
icon: Zap
},
{
number: "03",
title: "Adversarial Masking",
description: "These subtle changes are invisible to human eyes but create 'adversarial examples' that confuse deepfake neural networks.",
technical: "The noise pattern targets the specific features that deepfake models rely on, causing them to misclassify or fail during training.",
icon: Eye
},
{
number: "04",
title: "Protected Image Download",
description: "You receive a high-quality JPEG (95% quality) that looks identical to your original but is protected from deepfake misuse.",
technical: "The processed image is streamed back as a download with preserved visual quality while maintaining adversarial properties.",
icon: Lock
}
];
return (
<div style={{
minHeight: '100vh',
background: 'linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #2a1f3a 100%)',
color: '#e8e9f3',
fontFamily: '"Space Mono", "Courier New", monospace',
padding: '80px 20px',
position: 'relative',
overflow: 'hidden'
}}>
{/* Animated background grid */}
<div style={{
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundImage: `
linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px)
`,
backgroundSize: '50px 50px',
opacity: 0.4,
animation: 'gridMove 20s linear infinite'
}} />
{/* Floating orbs */}
<div style={{
position: 'absolute',
top: '10%',
left: '10%',
width: '300px',
height: '300px',
background: 'radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%)',
borderRadius: '50%',
filter: 'blur(60px)',
animation: 'float 8s ease-in-out infinite'
}} />
<div style={{
position: 'absolute',
bottom: '20%',
right: '15%',
width: '250px',
height: '250px',
background: 'radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%)',
borderRadius: '50%',
filter: 'blur(60px)',
animation: 'float 10s ease-in-out infinite reverse'
}} />
<style>{`
@keyframes float {
0%, 100% { transform: translate(0, 0); }
50% { transform: translate(30px, -30px); }
}
@keyframes gridMove {
0% { transform: translate(0, 0); }
100% { transform: translate(50px, 50px); }
}
@keyframes pulse {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
`}</style>
<div style={{ maxWidth: '1200px', margin: '0 auto', position: 'relative', zIndex: 1 }}>
{/* Header */}
<div style={{ textAlign: 'center', marginBottom: '80px' }}>
<div style={{
display: 'inline-block',
padding: '8px 20px',
background: 'rgba(139, 92, 246, 0.2)',
border: '1px solid rgba(139, 92, 246, 0.3)',
borderRadius: '20px',
fontSize: '12px',
letterSpacing: '2px',
textTransform: 'uppercase',
marginBottom: '24px',
color: '#a78bfa'
}}>
Technical Overview
</div>
<h1 style={{
fontSize: '64px',
fontWeight: '700',
margin: '0 0 24px 0',
lineHeight: 1.1,
background: 'linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%)',
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
backgroundClip: 'text'
}}>
How It Works
</h1>
<p style={{
fontSize: '20px',
color: '#94a3b8',
maxWidth: '700px',
margin: '0 auto',
lineHeight: 1.6
}}>
Gaussian noise masking creates adversarial examples that protect your images from deepfake algorithms
</p>
</div>
{/* Process Steps */}
<div style={{ marginBottom: '80px' }}>
{steps.map((step, index) => {
const Icon = step.icon;
const isActive = activeStep === index;
return (
<div
key={index}
onMouseEnter={() => setActiveStep(index)}
style={{
display: 'grid',
gridTemplateColumns: '80px 1fr',
gap: '40px',
marginBottom: '60px',
cursor: 'pointer',
transition: 'all 0.3s ease',
animation: `slideIn 0.6s ease ${index * 0.1}s backwards`
}}
>
{/* Step Number */}
<div style={{ textAlign: 'right', paddingTop: '8px' }}>
<div style={{
fontSize: '48px',
fontWeight: '700',
background: isActive
? 'linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%)'
: 'rgba(148, 163, 184, 0.3)',
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
backgroundClip: 'text',
transition: 'all 0.3s ease'
}}>
{step.number}
</div>
</div>
{/* Step Content */}
<div style={{
background: isActive
? 'rgba(139, 92, 246, 0.1)'
: 'rgba(255, 255, 255, 0.02)',
border: isActive
? '1px solid rgba(139, 92, 246, 0.3)'
: '1px solid rgba(255, 255, 255, 0.05)',
borderRadius: '16px',
padding: '32px',
transition: 'all 0.3s ease',
transform: isActive ? 'translateX(10px)' : 'translateX(0)',
boxShadow: isActive
? '0 8px 32px rgba(139, 92, 246, 0.2)'
: 'none'
}}>
<div style={{ display: 'flex', alignItems: 'center', gap: '16px', marginBottom: '16px' }}>
<div style={{
width: '48px',
height: '48px',
background: isActive
? 'linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%)'
: 'rgba(148, 163, 184, 0.1)',
borderRadius: '12px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
transition: 'all 0.3s ease'
}}>
<Icon size={24} color={isActive ? '#ffffff' : '#94a3b8'} />
</div>
<h3 style={{
fontSize: '24px',
fontWeight: '600',
margin: 0,
color: isActive ? '#e8e9f3' : '#94a3b8',
transition: 'all 0.3s ease'
}}>
{step.title}
</h3>
</div>
<p style={{
fontSize: '16px',
lineHeight: 1.8,
color: '#cbd5e1',
marginBottom: '16px'
}}>
{step.description}
</p>
<div style={{
background: 'rgba(0, 0, 0, 0.3)',
border: '1px solid rgba(139, 92, 246, 0.2)',
borderRadius: '8px',
padding: '16px',
fontFamily: '"Fira Code", "Courier New", monospace',
fontSize: '13px',
color: '#a78bfa',
lineHeight: 1.6
}}>
<div style={{
fontSize: '10px',
textTransform: 'uppercase',
letterSpacing: '1px',
color: '#64748b',
marginBottom: '8px'
}}>
Technical Detail
</div>
{step.technical}
</div>
</div>
</div>
);
})}
</div>
{/* Key Concepts */}
<div style={{
background: 'rgba(255, 255, 255, 0.02)',
border: '1px solid rgba(255, 255, 255, 0.05)',
borderRadius: '16px',
padding: '48px',
marginBottom: '80px'
}}>
<h2 style={{
fontSize: '32px',
fontWeight: '600',
marginBottom: '32px',
display: 'flex',
alignItems: 'center',
gap: '12px'
}}>
<ChevronRight size={32} color="#8b5cf6" />
Key Concepts
</h2>
<div style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
gap: '24px'
}}>
<div>
<h4 style={{
color: '#8b5cf6',
fontSize: '16px',
marginBottom: '12px',
fontWeight: '600'
}}>
Gaussian Noise
</h4>
<p style={{ fontSize: '14px', color: '#94a3b8', lineHeight: 1.6, margin: 0 }}>
Random variations added to pixel values following a bell curve distribution. Imperceptible to humans but disruptive to AI models.
</p>
</div>
<div>
<h4 style={{
color: '#3b82f6',
fontSize: '16px',
marginBottom: '12px',
fontWeight: '600'
}}>
Adversarial Examples
</h4>
<p style={{ fontSize: '14px', color: '#94a3b8', lineHeight: 1.6, margin: 0 }}>
Modified inputs designed to fool machine learning models while appearing unchanged to humans.
</p>
</div>
<div>
<h4 style={{
color: '#8b5cf6',
fontSize: '16px',
marginBottom: '12px',
fontWeight: '600'
}}>
Feature Extraction Disruption
</h4>
<p style={{ fontSize: '14px', color: '#94a3b8', lineHeight: 1.6, margin: 0 }}>
Deepfake models rely on extracting facial features. Our noise targets these features, causing model confusion and failure.
</p>
</div>
</div>
</div>
{/* Technical Stack */}
<div style={{ textAlign: 'center' }}>
<h3 style={{
fontSize: '20px',
color: '#64748b',
marginBottom: '24px',
fontWeight: '400',
letterSpacing: '1px'
}}>
Powered By
</h3>
<div style={{
display: 'flex',
justifyContent: 'center',
gap: '32px',
flexWrap: 'wrap'
}}>
{['FastAPI', 'PyTorch', 'Python', 'React'].map((tech, i) => (
<div
key={i}
style={{
padding: '12px 24px',
background: 'rgba(139, 92, 246, 0.1)',
border: '1px solid rgba(139, 92, 246, 0.2)',
borderRadius: '8px',
fontSize: '14px',
fontWeight: '600',
color: '#a78bfa',
transition: 'all 0.3s ease',
cursor: 'default'
}}
onMouseEnter={(e) => {
e.currentTarget.style.background = 'rgba(139, 92, 246, 0.2)';
e.currentTarget.style.transform = 'translateY(-2px)';
}}
onMouseLeave={(e) => {
e.currentTarget.style.background = 'rgba(139, 92, 246, 0.1)';
e.currentTarget.style.transform = 'translateY(0)';
}}
>
{tech}
</div>
))}
</div>
</div>
</div>
</div>
);
};
export default HowItWorks;