-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
91 lines (83 loc) · 2.95 KB
/
index.html
File metadata and controls
91 lines (83 loc) · 2.95 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Boyue Du | Personal Website</title>
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Orbitron', sans-serif;
text-align: center;
background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
padding: 2em;
color: white;
}
img {
width: 960px;
height: 560px;
object-fit: cover;
border: 2px solid #ccc;
border-radius: 10px;
}
h1 {
font-weight: 700;
letter-spacing: 1px;
margin-bottom: 1em;
}
area {
cursor: pointer;
}
.highlight {
position: absolute;
pointer-events: none;
border: 2px solid #00ffff;
border-radius: 8px;
box-shadow: 0 0 8px #00ffff;
display: none;
}
</style>
</head>
<body>
<h1>Boyue Du</h1>
<p style="font-family: Arial, sans-serif; font-weight: 400; font-size: 1.1em; color: #e0e0e0;">
This circuit board powers my story — tap a labeled component to discover more!
</p>
<img src="pcb_navigation.png" usemap="#pcblinks" alt="PCB Schematic Navigation" />
<map name="pcblinks">
<area shape="rect" coords="322,110,448,163" href="index.html" alt="Home" onclick="return showHomeMessage()" />
<area shape="rect" coords="566,109,687,161" href="about.html" alt="About" />
<area shape="rect" coords="86,254,257,307" href="education.html" alt="Education" />
<area shape="rect" coords="690,256,849,305" href="experience.html" alt="Experience" />
<area shape="rect" coords="168,406,310,458" href="projects.html" alt="Projects" />
<area shape="rect" coords="519,405,635,456" href="gallery.html" alt="Gallery" />
<area shape="rect" coords="746,406,880,455" href="contact.html" alt="Contact" />
</map>
<div id="hoverHighlight" class="highlight"></div>
<script>
function showHomeMessage() {
alert("You’re already on the homepage. Try another button?");
return true; // Allow the link to continue navigating to index.html
}
const map = document.querySelector("map");
const highlight = document.getElementById("hoverHighlight");
const image = document.querySelector("img");
map.querySelectorAll("area").forEach(area => {
area.addEventListener("mouseenter", () => {
const coords = area.coords.split(',').map(Number);
const [x1, y1, x2, y2] = coords;
const imgRect = image.getBoundingClientRect();
const width = x2 - x1;
const height = y2 - y1;
highlight.style.left = `${imgRect.left + x1}px`;
highlight.style.top = `${imgRect.top + y1 + window.scrollY}px`;
highlight.style.width = `${width}px`;
highlight.style.height = `${height}px`;
highlight.style.display = "block";
});
area.addEventListener("mouseleave", () => {
highlight.style.display = "none";
});
});
</script>
</body>
</html>