-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintropage.html
More file actions
342 lines (296 loc) · 10.7 KB
/
intropage.html
File metadata and controls
342 lines (296 loc) · 10.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XFUNCTIONAL - Online Shop</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
font-family: 'Arial', sans-serif;
}
.container {
width: 100%;
height: 100%;
background-image: url('IMG_2099.jpeg');
background-size: cover;
background-position: center;
position: fixed;
}
.balls-container {
position: absolute;
top: 50%;
left: 50%;
width: 80%; /* Limit the width of the movement area */
height: 80%; /* Limit the height of the movement area */
transform: translate(-50%, -50%);
pointer-events: none;
}
.ball {
position: absolute;
width: 30px;
height: 30px;
border-radius: 50%;
background-color: #8B5E3C;
animation: moveBall 6s ease-in-out infinite;
}
.lighting-ball {
position: absolute;
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #FFD700; /* Bright yellow color */
box-shadow: 0 0 15px 5px #FFD700; /* Glowing effect */
animation: lightingMove 4s ease-in-out infinite;
}
@keyframes moveBall {
0% { transform: translate(0, 0); }
25% { transform: translate(-100px, 50px); }
50% { transform: translate(80px, -100px); }
75% { transform: translate(50px, 80px); }
100% { transform: translate(0, 0); }
}
@keyframes lightingMove {
0% { transform: translate(0, 0); }
50% { transform: translate(-80px, -60px); }
100% { transform: translate(0, 0); }
}
nav, footer {
position: absolute;
padding: 8em;
height: 20px;
width: 100%;
display: flex;
justify-content: space-between;
background-color: rgba(48, 27, 3, 0.5);
color: rgba(237, 196, 143, 0.8);
}
footer {
bottom: 0;
}
nav > div, footer > div {
padding: 1.5em;
cursor: pointer;
border-radius: 20px 30px;
background-color: rgba(48, 27, 3, 0.5);
color: rgba(237, 196, 143, 0.8);
transition: all 0.3s ease;
display: flex;
align-items: center;
}
nav > div i, footer > div i {
margin-right: 0.5em;
font-size: 1.5em;
}
nav > div:hover, footer > div:hover {
background-color: rgba(237, 196, 143, 0.8);
transform: scale(1.1);
}
.placeholder {
font-size: 60px;
color: rgb(191, 142, 99);
font-weight: bold;
text-align: center;
text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}
.header {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
text-align: center;
}
p {
font-size: 16px;
color: black;
margin-top: 10px;
text-align: center;
}
body {
transition: all 0.3s ease;
}
</style>
</head>
<body>
<div class="container">
<div class="balls-container">
<!-- These are the moving brown balls centered -->
<div class="ball" style="top: 50%; left: 50%; animation-duration: 5s;"></div>
<div class="ball" style="top: 40%; left: 60%; animation-duration: 4s;"></div>
<div class="ball" style="top: 60%; left: 40%; animation-duration: 6s;"></div>
<div class="ball" style="top: 45%; left: 35%; animation-duration: 3s;"></div>
<div class="ball" style="top: 55%; left: 70%; animation-duration: 7s;"></div>
<!-- These are the smaller glowing lighting balls -->
<div class="lighting-ball" style="top: 60%; left: 30%; animation-duration: 3s;"></div>
<div class="lighting-ball" style="top: 50%; left: 80%; animation-duration: 4s;"></div>
<div class="lighting-ball" style="top: 45%; left: 40%; animation-duration: 5s;"></div>
<div class="lighting-ball" style="top: 35%; left: 60%; animation-duration: 6s;"></div>
<div class="lighting-ball" style="top: 65%; left: 50%; animation-duration: 7s;"></div>
<!-- Add more glowing balls as needed -->
</div>
<nav>
<div id="item-1"><i class="fas fa-info-circle"></i> About</div>
<div id="item-2"><i class="fas fa-lightbulb"></i> Ideas</div>
</nav>
<footer>
<div id="item-3"><i class="fas fa-truck"></i> Delivery</div>
<div id="item-4"><i class="fas fa-book"></i> Impact</div>
</footer>
<div class="header">
<div class="placeholder">WELCOME</div>
<p id="subheader">to the XFUNCTIONAL tools shop © 2025</p>
</div>
<div style="height: 2000px;"></div>
<div id="load-trigger"></div>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Set up an IntersectionObserver to load sec.html when the user scrolls near the bottom
const loadTrigger = document.getElementById('load-trigger');
const observer = new IntersectionObserver(entries => {
if (entries[0].isIntersecting) {
loadSecContent();
observer.disconnect(); // Stop observing after content is loaded
}
}, { threshold: 1.0 }); // When 100% of the trigger is in view
observer.observe(loadTrigger);
function loadSecContent() {
// Check if sec content is already loaded
if (document.getElementById('sec-content')) return;
// Create a new div to hold the sec.html content
fetch('sec.html')
.then(response => response.text())
.then(data => {
// Append the fetched content at the bottom of the page
const secContent = document.createElement('div');
secContent.innerHTML = data;
secContent.classList.add('sec-content');
secContent.id = 'sec-content';
document.body.appendChild(secContent);
})
.catch(error => console.error('Error loading sec.html:', error));
}
});
// JavaScript remains the same as before
const subHeaders = [
"Inspire trust by providing useful info.",
"Innovation through endless possibilities.",
"Fast and reliable service, every time.",
"Empowering decisions with expertise."
];
const items = document.querySelectorAll('#item-1, #item-2, #item-3, #item-4');
items.forEach((item, index) => {
item.addEventListener('click', () => {
switch (index) {
case 0:
window.location.href = 'about.html';
break;
case 1:
window.location.href = 'ideas.html';
break;
case 2:
window.location.href = 'deliveryc.html';
break;
case 3:
window.location.href = 'impact.html';
break;
default:
break;
}
});
});
const placeholder = document.querySelector('.placeholder');
const subheader = document.querySelector('#subheader');
function changeColors() {
gsap.to('.container', { backgroundColor: '#000', duration: 0.5 });
gsap.to('.container, nav, footer, p', { color: '#000', duration: 0.5 });
}
function revertColors() {
gsap.to('.container', { backgroundColor: '#000', duration: 0.5 });
gsap.to('.container, nav, footer, p', { color: '#000', duration: 0.5 });
}
items.forEach((item) => {
item.addEventListener('mouseover', changeColors);
item.addEventListener('mouseout', revertColors);
});
function animateScale(element, scaleValue) {
gsap.fromTo(element, { scale: 1 }, { scale: scaleValue, duration: 2, ease: "power1.out" });
}
function wrapLetters(text) {
placeholder.innerHTML = ''; // Clear the placeholder
[...text].forEach(letter => {
const span = document.createElement('span');
span.style.filter = 'blur(8px)';
span.textContent = letter;
placeholder.appendChild(span);
});
}
function animateBlurEffect() {
const letters = placeholder.children;
let index = 0;
function clearNextLetter() {
if (index < letters.length) {
gsap.to(letters[index], { filter: 'blur(0px)', duration: 0.5 });
index++;
setTimeout(clearNextLetter, 100);
}
}
clearNextLetter();
}
function shuffleLetters(finalText) {
wrapLetters(finalText.replace(/./g, ' '));
let textArray = finalText.split('');
let shufflingCounter = 0;
let intervalHandles = [];
function shuffle(index) {
if (shufflingCounter < 30) {
textArray[index] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[Math.floor(Math.random() * 26)];
placeholder.children[index].textContent = textArray[index];
} else {
placeholder.children[index].textContent = finalText.charAt(index);
clearInterval(intervalHandles[index]);
}
}
for (let i = 0; i < finalText.length; i++) {
intervalHandles[i] = setInterval(shuffle, 80, i);
}
setTimeout(() => {
shufflingCounter = 30;
for (let i = 0; i < finalText.length; i++) {
placeholder.children[i].textContent = finalText.charAt(i);
clearInterval(intervalHandles[i]);
}
animateBlurEffect();
}, 1000);
}
function updatePlaceholderText(event) {
const newText = event.target.textContent.toUpperCase();
const itemIndex = Array.from(items).indexOf(event.target);
const newSubHeaderText = subHeaders[itemIndex] || '...';
subheader.textContent = newSubHeaderText.toUpperCase();
animateScale(placeholder, 1.25);
shuffleLetters(newText);
}
function resetPlaceholderText() {
const defaultText = 'WELCOME';
const defaultSubHeaderText = 'to the XFUNCTIONAL tools shop © 2025';
subheader.textContent = defaultSubHeaderText;
animateScale(placeholder, 1.25);
shuffleLetters(defaultText);
}
items.forEach((item) => {
item.addEventListener('mouseover', updatePlaceholderText);
item.addEventListener('mouseout', resetPlaceholderText);
});
</script>
</body>
</html>