Here's the fixed code with proper click boundaries for the desktop icons:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>TrackSite – Vista Desktop</title>
<link rel="icon" href="images/TrackSite.png" type="image/png">
<style>
/*-------------- PAGE --------------*/
*{box-sizing:border-box;margin:0;padding:0}
body{
font-family:"Segoe UI",Tahoma,Arial,sans-serif;
height:100vh;overflow:hidden;display:flex;flex-direction:column;
background:url("https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.wallpapersafari.com%2F37%2F57%2FKZIRPy.jpg&f=1&nofb=1&ipt=c2cc7852e05aeba481e69a3654ecff06dbe5ad0758f330e03ae44fb36a35b5a7") center/cover fixed no-repeat;
}
/*-------------- TASKBAR --------------*/
.taskbar{
position:fixed;bottom:0;left:0;width:100%;height:44px;
display:flex;align-items:center;padding:0 14px;
background:rgba(30,60,115,.55);backdrop-filter:blur(10px) saturate(160%);
border-top:1px solid rgba(255,255,255,.35);
box-shadow:0 -2px 8px rgba(0,0,0,.45);
border-radius:10px 10px 0 0;z-index:90;
}
@supports not (backdrop-filter:blur(10px)){
.taskbar{background:linear-gradient(to bottom,#4d7ed1 0%,#356bc9 60%,#2b5fb9 100%)}
}
/*-------------- START BUTTON --------------*/
.start-button{
position:relative;display:flex;align-items:center;gap:6px;
cursor:pointer;font-weight:600;color:#fff;font-size:14px;
padding:5px 14px 5px 10px;border-radius:6px;border:1px solid #043d8c;
background:linear-gradient(to bottom,#1c7aff 0%,#0d60e3 50%,#084dbf 100%);
box-shadow:inset 0 1px 1px rgba(255,255,255,.25),0 2px 3px rgba(0,0,0,.4);
transition:filter .2s,transform .15s;
}
.start-button:hover{filter:brightness(1.15);transform:scale(1.05)}
.start-button:before{
content:"";width:20px;height:20px;flex:0 0 20px;
background:url("images/TrackSite.png") center/contain no-repeat;
filter:drop-shadow(0 1px 1px rgba(0,0,0,.6));
}
/*-------------- DESKTOP ICONS (FIXED CLICK BOUNDARIES) --------------*/
.desktop{
flex:1;padding:24px;
display:grid;
grid-template-columns:repeat(auto-fill, 90px);
gap:24px;
justify-content:start;
overflow-y:auto;
scrollbar-width:none;
}
.desktop::-webkit-scrollbar{display:none}
.icon{
width:72px;
height:80px; /* Fixed height to contain click area */
text-align:center;
cursor:pointer;
user-select:none;
transition:transform .2s;
justify-self:start;
display:flex;
flex-direction:column;
align-items:center;
justify-content:flex-start;
}
.icon:hover{transform:translateY(-4px)}
.icon img{
width:48px;height:48px;transition:transform .18s;
filter:drop-shadow(0 2px 4px rgba(0,0,0,.4));
flex-shrink:0;
}
.icon:hover img{transform:scale(1.12)}
.icon-label{
margin-top:6px;font-size:12.5px;color:#fff;padding:3px 6px;border-radius:4px;
background:rgba(0,102,204,.8);text-shadow:0 0 3px #000;
flex-shrink:0;
}
/*-------------- GLASS WINDOW --------------*/
.window{
position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
width:340px;border-radius:10px;overflow:hidden;z-index:120;
background:rgba(255,255,255,.35);backdrop-filter:blur(18px) saturate(160%);
border:1px solid rgba(255,255,255,.55);box-shadow:0 18px 40px rgba(0,0,0,.45);
display:none;
}
.window-header{
padding:8px 12px;font-weight:600;font-size:15px;color:#fff;
background:linear-gradient(90deg,#004a9c 0%,#0d7cf4 100%);
display:flex;justify-content:space-between;align-items:center;
}
.close-btn{
width:24px;height:24px;border:none;border-radius:4px;font-size:16px;
background:linear-gradient(#ff7474,#da2121);color:#fff;cursor:pointer;
box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 0 2px rgba(0,0,0,.5);
}
.close-btn:hover{filter:brightness(1.15)}
.window-body{padding:24px 18px;font-size:14px;color:#000;text-align:center}
.time-msg{
font-size:18px;font-weight:700;color:#fff;margin-bottom:10px;
text-shadow:0 0 6px rgba(255,255,255,.9),0 0 12px rgba(30,150,255,.9);
}
@keyframes shimmer{0%{opacity:.9}50%{opacity:1}100%{opacity:.9}}
.time-msg{animation:shimmer 2s infinite}
.message{
background:rgba(255,255,255,.55);border:1px solid #7ab1ff;border-radius:6px;
padding:16px;margin-bottom:16px;box-shadow:inset 0 0 6px rgba(255,255,255,.6)
}
</style>
</head>
<body>
<!-- ===== DESKTOP ICONS ===== -->
<div class="desktop">
<!-- Existing Icons -->
<div class="icon" onclick="location.href='index.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Home</div>
</div>
<div class="icon" onclick="location.href='gaming.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Gaming</div>
</div>
<div class="icon" onclick="location.href='extensions.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Extensions</div>
</div>
<div class="icon" onclick="location.href='streaming.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Streaming</div>
</div>
<div class="icon" onclick="location.href='windows.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Windows</div>
</div>
<!-- NEW ICONS -->
<div class="icon" onclick="location.href='android.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Android</div>
</div>
<div class="icon" onclick="location.href='literature.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Literature</div>
</div>
<div class="icon" onclick="location.href='other.html'">
<img src="https://vectorified.com/images/windows-xp-my-computer-icon-24.png" alt="">
<div class="icon-label">Other</div>
</div>
</div>
<!-- ===== TASKBAR ===== -->
<div class="taskbar">
<button class="start-button" onclick="togglePopup()">Start</button>
</div>
<!-- ===== POP-UP WINDOW ===== -->
<div class="window" id="popup">
<div class="window-header">
TrackSite Portal
<button class="close-btn" onclick="togglePopup()">×</button>
</div>
<div class="window-body">
<div class="message">
<div class="time-msg">OoOoOo, you've just traveled back in time!</div>
<p>This is just a fun Easter egg I wanted to do, where the home page looks like Vista/XP.</p>
</div>
<p style="font-style:italic;color:#333">Click on the icons to navigate through the site</p>
</div>
</div>
<script>
function togglePopup(){
const w=document.getElementById('popup');
w.style.display = w.style.display==='block' ? 'none' : 'block';
}
document.addEventListener('click',e=>{
const w=document.getElementById('popup');
if(w.style.display==='block' && !w.contains(e.target) && !e.target.closest('.start-button')){
w.style.display='none';
}
});
</script>
</body>
</html>
🔧 Key Fixes:
-
Fixed Grid Columns: Changed from minmax(90px, 1fr) to just 90px to prevent grid cells from expanding beyond the icon size.
-
Defined Icon Height: Added height: 80px to .icon to create a proper clickable boundary that contains both the image and label.
-
Flexbox Layout: Changed icons to use display: flex; flex-direction: column to properly contain all elements within the defined boundaries.
-
Prevented Flex Shrinking: Added flex-shrink: 0 to the image and label to maintain their sizes.
Now the click area is properly constrained to just the icon and its label, eliminating the bug where you could click in empty space and still trigger the icon action.