-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
64 lines (54 loc) · 2.27 KB
/
scripts.js
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
document.addEventListener('DOMContentLoaded', () => {
const typingEffectElement = document.getElementById('typing-effect');
const giftButton = document.getElementById('gift-button');
const surpriseText = document.getElementById('surprise-text');
const secondButton = document.getElementById('second-button');
const messages = ['Bienvenue à Epitech cher Tek 0', 'Clique ici pour télécharger les dépendances de ton pc '];
let messageIndex = 0;
let charIndex = 0;
function typeEffect() {
if (charIndex < messages[messageIndex].length) {
typingEffectElement.textContent += messages[messageIndex].charAt(charIndex);
charIndex++;
setTimeout(typeEffect, 100);
} else {
if (messageIndex < messages.length - 1) {
messageIndex++;
charIndex = 0;
setTimeout(() => {
typingEffectElement.textContent = '';
typeEffect();
}, 2000);
}
}
}
typeEffect();
giftButton.addEventListener('click', () => {
surpriseText.style.display = 'block';190
secondButton.style.display = 'block';
openGift();
});
secondButton.addEventListener('click', () => {
window.location.href = 'https://github.com/nogebeat/deb-ubuntu-epitech/archive/refs/heads/main.zip';
});
function openGift() {
const container = document.getElementById('3d-container');
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, container.clientWidth / container.clientHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(container.clientWidth, container.clientHeight);
container.appendChild(renderer.domElement);
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
const giftBox = new THREE.Mesh(geometry, material);
scene.add(giftBox);
camera.position.z = 5;
function animate() {
requestAnimationFrame(animate);
giftBox.rotation.x += 0.01;
giftBox.rotation.y += 0.01;
renderer.render(scene, camera);
}
animate();
}
});