124 lines
3.0 KiB
HTML
124 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Hover Responsiveness Test</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: sans-serif;
|
|
background: #1a1a2e;
|
|
color: #eee;
|
|
padding: 40px;
|
|
}
|
|
h1 { margin-bottom: 10px; }
|
|
p { margin-bottom: 30px; color: #aaa; }
|
|
|
|
.grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
gap: 16px;
|
|
max-width: 1000px;
|
|
}
|
|
|
|
.card {
|
|
background: #16213e;
|
|
border: 2px solid #0f3460;
|
|
border-radius: 12px;
|
|
padding: 24px 16px;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
transition: background 0.05s, border-color 0.05s, transform 0.05s, box-shadow 0.05s;
|
|
user-select: none;
|
|
}
|
|
|
|
/* Hover effect: quick background + border + shadow change */
|
|
.card:hover {
|
|
background: #e94560;
|
|
border-color: #e94560;
|
|
transform: scale(1.05);
|
|
box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
|
|
}
|
|
|
|
.card:active {
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
.card .icon {
|
|
font-size: 32px;
|
|
margin-bottom: 8px;
|
|
}
|
|
.card .label {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
#fps-display {
|
|
position: fixed;
|
|
top: 12px;
|
|
right: 12px;
|
|
background: rgba(0,0,0,0.7);
|
|
color: #0f0;
|
|
font-family: monospace;
|
|
font-size: 18px;
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
z-index: 999;
|
|
}
|
|
|
|
#instructions {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background: rgba(0,0,0,0.8);
|
|
color: #ff0;
|
|
padding: 10px 20px;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
z-index: 999;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="fps-display">FPS: --</div>
|
|
<div id="instructions">Move mouse rapidly across the cards — watch hover highlight latency</div>
|
|
|
|
<h1>🖱️ Hover Responsiveness Test</h1>
|
|
<p>Each card has a <code>transition: 0.05s</code> on background, border, transform, and box-shadow.
|
|
Compare how quickly the hover highlight appears vs Brave/Chrome.</p>
|
|
|
|
<div class="grid" id="grid"></div>
|
|
|
|
<script>
|
|
// Generate 60 cards
|
|
var grid = document.getElementById('grid');
|
|
var icons = ['🌟','🔥','💎','⚡','🎯','🚀','🌈','🍀','🎨','🦋','🌺','⭐','💫','✨','🎪','🏆','🥇','💡','🔮','🎭'];
|
|
for (var i = 0; i < 60; i++) {
|
|
var card = document.createElement('div');
|
|
card.className = 'card';
|
|
card.innerHTML = '<div class="icon">' + icons[i % icons.length] + '</div><div class="label">Card ' + (i+1) + '</div>';
|
|
grid.appendChild(card);
|
|
}
|
|
|
|
// Simple FPS counter
|
|
var fpsEl = document.getElementById('fps-display');
|
|
var frameCount = 0;
|
|
var lastFpsTime = performance.now();
|
|
function rafLoop() {
|
|
frameCount++;
|
|
var now = performance.now();
|
|
if (now - lastFpsTime >= 1000) {
|
|
fpsEl.textContent = 'FPS: ' + frameCount;
|
|
frameCount = 0;
|
|
lastFpsTime = now;
|
|
}
|
|
requestAnimationFrame(rafLoop);
|
|
}
|
|
requestAnimationFrame(rafLoop);
|
|
</script>
|
|
</body>
|
|
</html>
|