WalidMoovin
2 years ago
3 changed files with 68 additions and 33 deletions
@ -1,24 +1,43 @@ |
|||
<script lang="ts"> |
|||
export let matches: Match[] = []; |
|||
interface Match { |
|||
winner: string; |
|||
loser: string; |
|||
time: Date; |
|||
} |
|||
<script> |
|||
export let matches = []; |
|||
</script> |
|||
|
|||
<main> |
|||
{#if matches.length > 0} |
|||
<ul> |
|||
|
|||
<div class="overlay"> |
|||
<div class="history"> |
|||
<div> |
|||
{#if matches.length > 0} |
|||
{#each matches as match} |
|||
<li> |
|||
<span>{match.winner} vs {match.loser}</span> |
|||
<span>{match.winner} won 1-0</span> |
|||
<span>{match.time.toLocaleString()}</span> |
|||
<span>{match.winner} vs {match.loser}</span> |
|||
<span>{match.winner} won 1-0</span> |
|||
</li> |
|||
{/each} |
|||
</ul> |
|||
{:else} |
|||
<p>No matches to display</p> |
|||
{/if} |
|||
</main> |
|||
{:else} |
|||
<p>No matches to display</p> |
|||
{/if} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<style> |
|||
.overlay { |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
background-color: rgba(0, 0, 0, 0.5); |
|||
z-index: 9998; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
|
|||
.history { |
|||
background-color: #fff; |
|||
border: 1px solid #ccc; |
|||
border-radius: 5px; |
|||
padding: 1rem; |
|||
width: 300px; |
|||
} |
|||
</style> |
Loading…
Reference in new issue