-
Notifications
You must be signed in to change notification settings - Fork 1
/
ind.html
328 lines (292 loc) · 11.7 KB
/
ind.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Centered Animation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Dosis:400,600 &display=swap">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.10.1/ScrollTrigger.min.js"></script>
<style>
body {
margin: 0;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: transparent;
position: relative; /* Add position relative to body */
z-index: 1; /* Add z-index to the body to make sure it's behind the animations */
}
.refill-container {
position: relative;
z-index: 1;
width: 200px;
height: 200px;
margin: 100px auto;
display: flex;
justify-content: center;
align-items: center;
}
.refill-circle {
width: 200px;
height: 200px;
border: 2px solid rgba(255, 255, 255, 0.6);
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
transform-origin: center;
}
#circle-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index:-1;
}
canvas {
position: absolute;
top: 0;
left: 0;
background-color: black;
height:100vh;
width:100vw;
z-index: -2;
}
#cube-container {
position: absolute;
z-index: 99;
}
.cube {
width: 5vw;
height: 5vw;
position: relative;
transform-style: preserve-3d;
animation: spin 10s infinite linear;
z-index: 4; /* Add z-index to bring the cube to the front */
margin: auto; /* Center the cube horizontally and vertically */
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.face {
position: absolute;
width: 5vw;
height: 5vw;
background: rgba(255, 255, 255, 0);
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
font-weight: bold;
}
.front {
transform: translateZ(2vw);
background-image: url('Logo.png');
background-size: cover;
}
.back {
transform: rotateY(180deg) translateZ(2vw);
background-image: url('Logo.png'); /* Use a relative path */
background-size: cover;
}
.top {
transform: rotateX(90deg) translateZ(2vw);
background-image: url('Logo.png'); /* Use a relative path */
background-size: cover;
}
.bottom {
transform: rotateX(-90deg) translateZ(2vw);
background-image: url('Logo.png'); /* Use a relative path */
background-size: cover;
}
.left {
transform: rotateY(-90deg) translateZ(2vw);
background-image: url('Logo.png'); /* Use a relative path */
background-size: cover;
}
.right {
transform: rotateY(90deg) translateZ(2vw);
background-image: url('Logo.png'); /* Use a relative path */
background-size: cover;
}
@keyframes spin {
0% { transform: rotateY(0deg) rotateX(0deg); }
100% { transform: rotateY(360deg) rotateX(360deg); }
}
</style>
</head>
<body style="background-color: transparent;">
<div class="refill-container">
<div class="refill-circle"></div>
<div class="refill-circle"></div>
<div class="refill-circle"></div>
<div class="refill-circle"></div>
<div class="refill-circle"></div>
</div>
<canvas id="c"></canvas>
<svg id="circle-mask" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<circle id="mask-circle" cx="50%" cy="50%" r="100" />
</svg>
<div id="cube-container">
<div class="cube">
<div class="face front"></div>
<div class="face back"></div>
<div class="face top"></div>
<div class="face bottom"></div>
<div class="face left"></div>
<div class="face right"></div>
</div>
</div>
<div class="cont">
<div class="preloader">
<div class="preloader__ring">
<div class="preloader__sector">L</div>
<div class="preloader__sector">o</div>
<div class="preloader__sector">a</div>
<div class="preloader__sector">d</div>
<div class="preloader__sector">i</div>
<div class="preloader__sector">n</div>
<div class="preloader__sector">g</div>
<div class="preloader__sector">.</div>
<div class="preloader__sector">.</div>
<div class="preloader__sector">.</div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
</div>
<div class="preloader__ring">
<div class="preloader__sector">L</div>
<div class="preloader__sector">o</div>
<div class="preloader__sector">a</div>
<div class="preloader__sector">d</div>
<div class="preloader__sector">i</div>
<div class="preloader__sector">n</div>
<div class="preloader__sector">g</div>
<div class="preloader__sector">.</div>
<div class="preloader__sector">.</div>
<div class="preloader__sector">.</div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
<div class="preloader__sector"></div>
</div>
</div>
</div>
<script>
const canvas = document.getElementById('c');
const ctx = canvas.getContext('2d');
const w = window.innerWidth;
const h = window.innerHeight;
canvas.width = w;
canvas.height = h;
const c = { x: w / 2, y: h / 2 };
function Point(vx, vy) {
this.pos = { x: c.x, y: c.y };
this.vel = { x: vx, y: vy };
this.frame = 1;
}
Point.prototype.update = function () {
this.frame += 0.0001;
this.vel.x *= this.frame;
this.vel.y *= this.frame;
this.pos.x += this.vel.x;
this.pos.y += this.vel.y;
ctx.fillStyle = pointColor;
ctx.fillRect(this.pos.x, this.pos.y, this.frame, this.frame);
};
const points = [];
const total = w / 2;
const bgColor = 'rgba(0, 0, 0, 0.04)';
const pointColor = 'white';
function anim() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
requestAnimationFrame(anim);
// Update and render points
for (let i = 0; i < points.length; ++i) {
points[i].update();
if (points[i].pos.y < 0 || points[i].pos.y > h || points[i].pos.x < 0 || points[i].pos.x > w) {
points.splice(i, 1);
}
}
if (points.length < total) {
points.push(new Point(Math.random() - 0.5, Math.random() - 0.5));
}
}
// Initialize GSAP timeline
const tl = gsap.timeline({ repeat: -1, yoyo: true });
// Define animation properties
tl.to(canvas, { duration: 2, scale: 1.1, ease: 'power2.out' })
.to(canvas, { duration: 2, scale: 1, ease: 'power2.in' }, "-=2");
anim();
const initialAnimationDuration = 10;
const animationRepeat = -1;
const tlGlow = gsap.timeline({ repeat: animationRepeat });
tlGlow.staggerTo('.refill-circle', initialAnimationDuration, { rotationY: 540, rotationX: 1080, ease: Power1.easeInOut }, 0.3);
function updateGlowEffect(glowRadius, glowOpacity) {
tlGlow.to('.refill-circle', {
boxShadow: `0 0 ${glowRadius}px rgba(0, 0, 255, ${glowOpacity})`,
ease: Power1.easeInOut,
});
}
const redirectURL = "index.html"; // Replace with your desired redirect URL
function animateAndRedirect() {
const cubeContainer = document.getElementById('cube-container');
const rings = document.querySelectorAll('.refill-circle');
const logoAnimation = gsap.fromTo(cubeContainer, { scale: 1 }, { duration: 2, scale: 2, ease: 'power2.out' });
const ringsAnimation = gsap.fromTo(
rings,
{ scale: 1, opacity: 1 }, // Initial scale and opacity values
{ duration: 2, scale: 20, opacity: 0, ease: 'power2.out' } // Target scale and opacity values
);
gsap.timeline()
.add(logoAnimation)
.add(ringsAnimation, "-=2") // Start rings animation 2 seconds after logo animation
.to(cubeContainer, { duration: 1, opacity: 0 }, "+=1") // Hide the cube container 1 second after the rings animation
.call(() => {
// Redirect after animations complete
window.location.href = "landing.html";
});
}
// Trigger the animation and redirect after a set timeout (e.g., 5000 milliseconds)
setTimeout(animateAndRedirect, 5000);
</script>
</body>
</html>