106 lines
3.1 KiB
HTML
106 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Match Info</title>
|
|
<style>
|
|
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
|
|
html, body {
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
|
background: transparent;
|
|
color: #fff;
|
|
user-select: none;
|
|
}
|
|
|
|
.widget {
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.match-info {
|
|
background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(20,20,30,0.85));
|
|
backdrop-filter: blur(8px);
|
|
border: 1px solid rgba(255,255,255,0.12);
|
|
border-radius: calc(min(12px, 0.8vw));
|
|
padding: 0.6em 1.6em;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 1em;
|
|
font-size: clamp(12px, 1.4vw, 20px);
|
|
letter-spacing: 0.5px;
|
|
white-space: nowrap;
|
|
box-shadow: 0 4px 20px rgba(0,0,0,0.5);
|
|
}
|
|
.match-info .tournament {
|
|
font-weight: 700;
|
|
color: #facc15;
|
|
text-transform: uppercase;
|
|
}
|
|
.match-info .separator {
|
|
width: 1px;
|
|
height: 1.2em;
|
|
background: rgba(255,255,255,0.2);
|
|
flex-shrink: 0;
|
|
}
|
|
.match-info .round {
|
|
font-weight: 400;
|
|
color: rgba(255,255,255,0.7);
|
|
}
|
|
.match-info .status {
|
|
font-weight: 600;
|
|
color: rgba(255,255,255,0.9);
|
|
}
|
|
.match-info .status.winner {
|
|
color: #4ade80;
|
|
}
|
|
|
|
@keyframes fadeInUp {
|
|
from { opacity: 0; transform: translateY(8px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
.match-info { animation: fadeInUp 0.5s ease-out; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="widget">
|
|
<div class="match-info">
|
|
<span class="tournament" id="tournament">🎾 Wimbledon</span>
|
|
<span class="separator"></span>
|
|
<span class="round" id="round">Finale · Uomini · Singolare</span>
|
|
<span class="separator" id="statusSep"></span>
|
|
<span class="status" id="status">🎾 In corso · Set 1</span>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="common.js"></script>
|
|
<script>
|
|
function updateMatchInfo(state) {
|
|
document.getElementById('tournament').textContent = state.tournament || '🎾 Torneo';
|
|
document.getElementById('round').textContent = state.round || '';
|
|
|
|
const statusEl = document.getElementById('status');
|
|
if (state.matchOver) {
|
|
const winner = state.sets.reduce((a, s) => a + (s[0] > s[1] ? 1 : 0), 0) >= 2
|
|
? state.player1 : state.player2;
|
|
statusEl.textContent = '🏆 ' + winner + ' vince!';
|
|
statusEl.classList.add('winner');
|
|
document.getElementById('statusSep').style.display = '';
|
|
} else {
|
|
statusEl.textContent = state.matchStatus || '🎾 In corso · Set ' + (state.currentSet + 1);
|
|
statusEl.classList.remove('winner');
|
|
document.getElementById('statusSep').style.display = '';
|
|
}
|
|
}
|
|
|
|
const unsub = onStateUpdate(updateMatchInfo);
|
|
</script>
|
|
</body>
|
|
</html>
|