diff --git a/src/App.svelte b/src/App.svelte index 61e987c..2a83e77 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3,6 +3,7 @@ import Profile from './components/Profile.svelte'; import MatchHistory from './components/MatchHistory.svelte'; import Friends from './components/Friends.svelte'; + import Spectate from './components/Spectate.svelte'; let isProfileOpen = false; function clickProfile() { isProfileOpen = true; @@ -31,10 +32,27 @@ {username : "Eve", status : "online"}, {username : "Frank", status : "online"}, ] + let isSpectateOpen = false; + function clickSpectate() { + isSpectateOpen = true; + } + let spectate = [ + {player1 : "Alice", player2 : "Bob", id : "1"}, + {player1 : "Alice", player2 : "Bob", id : "4"}, + {player1 : "Alice", player2 : "Bob", id : "6"}, + {player1 : "Alice", player2 : "Bob", id : "8"}, + {player1 : "Alice", player2 : "Bob", id : "2"}, + {player1 : "Alice", player2 : "Bob", id : "3"}, + ]
- + + {#if isSpectateOpen} +
isSpectateOpen = false} on:keydown={() => isSpectateOpen = false}> + +
+ {/if} {#if isFriendOpen}
isFriendOpen = false} on:keydown={() => isFriendOpen = false}> @@ -47,7 +65,7 @@ {/if} {#if isProfileOpen}
isProfileOpen = false} on:keydown={() => isProfileOpen = false}> - +
{/if}
diff --git a/src/components/Friends.svelte b/src/components/Friends.svelte index 857836f..87aa821 100644 --- a/src/components/Friends.svelte +++ b/src/components/Friends.svelte @@ -3,7 +3,7 @@
-
+
{#if friends.length > 0} {#each friends.slice(0, 10) as friends} @@ -32,7 +32,7 @@ align-items: center; } - .history { + .friends { background-color: #fff; border: 1px solid #ccc; border-radius: 5px; diff --git a/src/components/NavBar.svelte b/src/components/NavBar.svelte index 9564b86..6d5f90d 100644 --- a/src/components/NavBar.svelte +++ b/src/components/NavBar.svelte @@ -11,12 +11,20 @@ export let clickProfile = () => {}; export let clickHistory = () => {}; export let clickFriends = () => {}; + export let clickSpectate = () => {};

Wins: {wins}

Losses: {losses}

+

Winrate: {wins / (wins + losses) * 100}%

+

Elo : {elo}

+

Rank: {rank}

- - +
diff --git a/src/components/Spectate.svelte b/src/components/Spectate.svelte new file mode 100644 index 0000000..5094dde --- /dev/null +++ b/src/components/Spectate.svelte @@ -0,0 +1,44 @@ + + +
+
+
+ {#if spectate.length > 0} + {#each spectate.slice(0, 10) as spectate} +
  • + {spectate.player1} VS {spectate.player2} + +
  • + {/each} + {:else} +

    No matches to spectate

    + {/if} +
    +
    +
    + + \ No newline at end of file