edge-ruedelasoif/src/lib/Tile.svelte

37 lines
1.0 KiB
Svelte
Raw Normal View History

2024-02-24 12:00:53 +01:00
<script>
export let size;
2024-02-24 15:05:23 +01:00
export let _id;
2024-02-24 12:00:53 +01:00
export let position;
export let img;
export let name;
2024-02-24 15:05:23 +01:00
export let price;
export let tiletype;
export let partyid;
export let playerposition;
2024-02-24 12:00:53 +01:00
var style="tile";
if(size=="big") style="bigtile";
2024-02-24 15:05:23 +01:00
var promise = Edge.Client.rpc("getPlayerPartys",partyid);
2024-02-24 12:00:53 +01:00
</script>
2024-02-24 15:05:23 +01:00
<div class="{style} {tiletype}" style="background-image: url({img});">
<span style="color: white; margin: 5px; padding: 5px;font-size: 700; background-color: rgba(0,0,0,0.4)">{name}</span>
<span style="color: white; margin: 5px; padding: 5px;font-size: 700; background-color: rgba(0,0,0,0.4)">{position}</span>
{#await promise}
<p>wainting ...</p>
{:then players}
{#each players as player}
{#if player.tileid == _id }
<div style="background-color: {player.color}; width:40px;height:40px; border-radius:100%"></div>
{/if}
{/each}
{:catch err}
{err.message}
{/await}
</div>
2024-02-24 12:00:53 +01:00