-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-html.html
executable file
·94 lines (88 loc) · 3.03 KB
/
index-html.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Personal Website Assignment</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- <link rel="stylesheet" href="home/style.css"> -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
</head>
<body>
<div class="main-box">
<button class="tech" onclick="location.href='portfolio.html'">
<p class="tech-p">
PORTFOLIO
</p>
</button>
<button class="qualifications" onclick="location.href='qualifications.html'">
<p class="qualifications-p">
QUALIFICATIONS
</p>
</button>
<button class="service" onclick="location.href='service.html'">
<p class="service-p">
SERVICE
</p>
</button>
<button class="AI" onclick="location.href='chat.html'">
<p class="AI-p">
CHATGPT
</p>
</button>
<div class="home">
<p class="home-p">
JAVI BETANCOURT
</p>
</div>
<label class="switch">
<input type="checkbox" id="toggle-css">
<span class="slider round"></span>
</label>
<script>
document.getElementById('toggle-css').addEventListener('change', function() {
document.body.classList.toggle('disable-css', this.checked);
});
</script>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const homeElement = document.querySelector('.home');
const mainBox = document.querySelector('.main-box');
const buttons = document.querySelectorAll('.tech, .qualifications, .service, .AI');
let timeoutId;
function showElements() {
mainBox.classList.add('show-elements');
mainBox.classList.remove('hide-elements');
buttons.forEach(button => {
button.style.animation = '';
});
if (timeoutId) {
clearTimeout(timeoutId);
}
}
function hideElements() {
timeoutId = setTimeout(() => {
let delay = 0;
buttons.forEach((button, index) => {
setTimeout(() => {
button.style.animation = `hide-${button.className} 1s forwards`;
}, delay);
});
}, 2000);
}
homeElement.addEventListener('mouseenter', showElements);
homeElement.addEventListener('mouseleave', hideElements);
homeElement.addEventListener('touchstart', showElements);
homeElement.addEventListener('touchend', hideElements);
document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'visible' && homeElement.matches(':hover')) {
showElements();
} else if (document.visibilityState === 'hidden') {
hideElements();
}
});
});
</script>
</body>
</html>