WalidMoovin
2 years ago
3 changed files with 68 additions and 33 deletions
@ -1,24 +1,43 @@ |
|||||
<script lang="ts"> |
<script> |
||||
export let matches: Match[] = []; |
export let matches = []; |
||||
interface Match { |
|
||||
winner: string; |
|
||||
loser: string; |
|
||||
time: Date; |
|
||||
} |
|
||||
</script> |
</script> |
||||
|
|
||||
<main> |
<div class="overlay"> |
||||
{#if matches.length > 0} |
<div class="history"> |
||||
<ul> |
<div> |
||||
|
{#if matches.length > 0} |
||||
{#each matches as match} |
{#each matches as match} |
||||
<li> |
<li> |
||||
<span>{match.winner} vs {match.loser}</span> |
<span>{match.winner} vs {match.loser}</span> |
||||
<span>{match.winner} won 1-0</span> |
<span>{match.winner} won 1-0</span> |
||||
<span>{match.time.toLocaleString()}</span> |
|
||||
</li> |
</li> |
||||
{/each} |
{/each} |
||||
</ul> |
{:else} |
||||
{:else} |
<p>No matches to display</p> |
||||
<p>No matches to display</p> |
{/if} |
||||
{/if} |
</div> |
||||
</main> |
</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