-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
65 lines (60 loc) · 2.56 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hianna Sabo 3D Card</title>
<script src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
const Card3D = () => {
const [tilt, setTilt] = React.useState({ x: 0, y: 0 });
const handleMouseMove = (e) => {
const card = e.currentTarget;
const rect = card.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
const centerX = rect.width / 2;
const centerY = rect.height / 2;
const tiltX = (y - centerY) / 10;
const tiltY = (centerX - x) / 10;
setTilt({ x: tiltX, y: tiltY });
};
const handleMouseLeave = () => {
setTilt({ x: 0, y: 0 });
};
return (
<div className="w-full h-full min-h-[400px] flex justify-center items-center bg-transparent">
<div
className="relative w-64 h-96 max-w-full max-h-full rounded-lg shadow-xl transition-transform duration-200 ease-out bg-cover bg-center"
style={{
transform: `perspective(1000px) rotateX(${tilt.x}deg) rotateY(${tilt.y}deg) scale3d(1, 1, 1)`,
backgroundImage: "url('/Hianna S_Final_edited.jpg')"
}}
onMouseMove={handleMouseMove}
onMouseLeave={handleMouseLeave}
>
<div className="absolute inset-0 bg-black bg-opacity-50 rounded-lg">
<div className="p-4 text-white">
<h2 className="text-2xl font-bold mb-2">Hianna Sabo</h2>
<p className="text-sm mb-2">Content & Product Marketing Specialist</p>
<ul className="text-xs">
<li>7+ years of experience</li>
<li>Bilingual: English/Spanish</li>
<li>Content Strategy Expert</li>
<li>Go-to-Market Strategist</li>
</ul>
</div>
</div>
</div>
</div>
);
};
ReactDOM.render(<Card3D />, document.getElementById('root'));
</script>
</body>
</html>