feat: only show one shard's popup at a time
This commit is contained in:
parent
762ac7c7c4
commit
400918c349
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let isHovering = false;
|
export let hover;
|
||||||
|
|
||||||
export let shard = {
|
export let shard = {
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -25,11 +25,11 @@
|
|||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div
|
<div
|
||||||
on:click={() => isHovering = !isHovering}
|
on:click={() => hover = (hover != shard.id) ? shard.id : null}
|
||||||
class="shard" id={shard.id.toString()}
|
class="shard" id={shard.id.toString()}
|
||||||
style={color}
|
style={color}
|
||||||
>{ shard.id }</div>
|
>{ shard.id }</div>
|
||||||
{#if isHovering}
|
{#if hover == shard.id}
|
||||||
<div class="more-info">
|
<div class="more-info">
|
||||||
<h3>Shard { shard.id }</h3>
|
<h3>Shard { shard.id }</h3>
|
||||||
<br>
|
<br>
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
import { Container } from 'sveltestrap';
|
import { Container } from 'sveltestrap';
|
||||||
import ShardItem from '../lib/shard.svelte';
|
import ShardItem from '../lib/shard.svelte';
|
||||||
|
|
||||||
|
let hover = null;
|
||||||
|
|
||||||
let message = "Loading...";
|
let message = "Loading...";
|
||||||
let shards = [];
|
let shards = [];
|
||||||
let pingAverage = "";
|
let pingAverage = "";
|
||||||
@ -115,6 +117,6 @@
|
|||||||
<span>{ message }</span>
|
<span>{ message }</span>
|
||||||
|
|
||||||
{#each shards as shard}
|
{#each shards as shard}
|
||||||
<ShardItem shard={shard} />
|
<ShardItem shard={shard} bind:hover={hover} />
|
||||||
{/each}
|
{/each}
|
||||||
</Container>
|
</Container>
|
Loading…
Reference in New Issue
Block a user