-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
137 lines (127 loc) · 4.08 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
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
<!<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="assets/images/logo/monogram.png" type="image/x-icon">
<link rel="icon" href="assets/images/logo/monogram.png" type="image/x-icon">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Code by Sonia</title>
<style type="text/css">
body {
background: #2c2c2c;
cursor: none;
overflow: hidden;
font-family: "Roboto", sans-serif;
}
.custom-cursor {
width: 60px;
height: 60px;
background-color: #fff;
opacity: 0.3;
border-radius: 50%;
}
.title {
font-weight: 300;
text-align: center;
letter-spacing: 10px;
font-size: 18px;
margin-bottomn: 100px;
}
.title span {
background: radial-gradient(circle, #fff 30%, #c2c2c2 100%);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
}
.holder {
transform-style: preserve-3d;
width: 80vw;
height: 450px;
margin: 0 auto;
perspective: 1000px;
}
.cylinder {
position: relative;
height: 100%;
width: 100%;
transform-style: preserve-3d;
animation: spin 30s infinite linear;
}
.face {
background: radial-gradient(circle, #fff 30%, #c2c2c2 100%);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
font-size: 62px;
letter-spacing: 4px;
line-height: 50px;
font-weight: 900;
text-align: center;
position: absolute;
width: auto;
height: 50px;
top: 50%;
left: 50%;
transform: rotateX(calc(18deg * var(--index))) translateZ(calc(159.1549430919px)) translateX(-50%);
}
@keyframes spin {
to {
transform: rotateX(-360deg);
}
}
</style>
</head>
<body>
<div class="coming-soon-wrapper">
<div class="custom-cursor"></div>
<div class="title"> <span>WE ARE CREATING SOMETING BEST</span></div>
<div class="holder">
<div class="cylinder">
<div class="face" style="--index: 0;">COMING SOON</div>
<div class="face" style="--index: 1;">COMING SOON</div>
<div class="face" style="--index: 2;">COMING SOON</div>
<div class="face" style="--index: 3;">COMING SOON</div>
<div class="face" style="--index: 4;">COMING SOON</div>
<div class="face" style="--index: 5;">COMING SOON</div>
<div class="face" style="--index: 6;">COMING SOON</div>
<div class="face" style="--index: 7;">COMING SOON</div>
<div class="face" style="--index: 8;">COMING SOON</div>
<div class="face" style="--index: 9;">COMING SOON</div>
<div class="face" style="--index: 10;">COMING SOON</div>
<div class="face" style="--index: 11;">COMING SOON</div>
<div class="face" style="--index: 12;">COMING SOON</div>
<div class="face" style="--index: 13;">COMING SOON</div>
<div class="face" style="--index: 14;">COMING SOON</div>
<div class="face" style="--index: 15;">COMING SOON</div>
<div class="face" style="--index: 16;">COMING SOON</div>
<div class="face" style="--index: 17;">COMING SOON</div>
<div class="face" style="--index: 18;">COMING SOON</div>
<div class="face" style="--index: 19;">COMING SOON</div>
</div>
</div>
</div>
<script type="text/javascript">
const cursor = document.querySelector('.custom-cursor');
const positionElement = (e) => {
const mouseY = e.clientY;
const mouseX = e.clientX;
cursor.style.transform = `translate3d(${mouseX}px, ${mouseY}px, 0)`;
}
window.addEventListener('mousemove', positionElement);
const barrel = document.querySelector(".cylinder");
const barrelDimensions = barrel.getBoundingClientRect();
document.addEventListener("mousemove", e => animateBarrel(e));
function animateBarrel(e) {
const cursor = {
x: e.clientX - Math.round(barrelDimensions.left),
y: e.clientY - Math.round(barrelDimensions.top)
};
const angle = {
y: 30 * ((cursor.y / barrelDimensions.height) * 2 - 1),
x: 30 * ((cursor.x / barrelDimensions.width) * 2 - 1)
};
barrel.style.transform = `rotateX(${-angle.y}deg) rotateY(${angle.x}deg)`;
}
</script>
</body>
</html>