From 8ba9c7090c88c04d43ca727b7ed012cf5a6b58c8 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 16 May 2022 15:36:06 +0000 Subject: start adding really basic tooltip --- src/lib/AuctionPreviewTooltip.svelte | 22 ++++++++++++++++++++++ src/lib/AuctionPriceScatterplot.svelte | 16 ++++++++++++++++ src/lib/utils.ts | 8 +++++++- src/routes/auctionprices.svelte | 16 ++++++++++++++-- svelte.config.js | 18 +++++++++--------- 5 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 src/lib/AuctionPreviewTooltip.svelte diff --git a/src/lib/AuctionPreviewTooltip.svelte b/src/lib/AuctionPreviewTooltip.svelte new file mode 100644 index 0000000..226feee --- /dev/null +++ b/src/lib/AuctionPreviewTooltip.svelte @@ -0,0 +1,22 @@ + + +{#if preview} +
+

uuid: {JSON.stringify(preview)}

+
+{/if} + + diff --git a/src/lib/AuctionPriceScatterplot.svelte b/src/lib/AuctionPriceScatterplot.svelte index f887725..e416163 100644 --- a/src/lib/AuctionPriceScatterplot.svelte +++ b/src/lib/AuctionPriceScatterplot.svelte @@ -1,7 +1,9 @@ @@ -36,6 +49,9 @@ r="1" stroke-width="4" fill={auction.bin ? '#11b' : '#1b1'} + on:mouseenter={e => showAuctionPreview(e, auction.id)} + on:click={e => showAuctionPreview(e, auction.id)} + on:mouseleave={hideAuctionPreview} /> {/each} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index e34d573..c2e4b86 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -219,4 +219,10 @@ export function skyblockTime(year: number, month = 1, day = 1) { if (month) time += 37200000 * (month - 1) if (day) time += 1200000 * (day - 1) return time -} \ No newline at end of file +} + +export interface PreviewedAuctionData { + pageX: number + pageY: number + uuid: string +} diff --git a/src/routes/auctionprices.svelte b/src/routes/auctionprices.svelte index f464f7b..4e7bfde 100644 --- a/src/routes/auctionprices.svelte +++ b/src/routes/auctionprices.svelte @@ -16,13 +16,23 @@

SkyBlock Auction Prices

@@ -74,7 +86,7 @@ {/if}
- +
{/each} diff --git a/svelte.config.js b/svelte.config.js index b4cc10d..23b0e12 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -42,15 +42,15 @@ const config = { }, }, // if the user is on replit or gitpod, use a secure websocket - server: - process.env.REPL_ID || process.env.GITPOD_WORKSPACE_ID - ? { - hmr: { - protocol: 'wss', - port: 443, - }, - } - : {}, + // server: + // process.env.REPL_ID || process.env.GITPOD_WORKSPACE_ID + // ? { + // hmr: { + // protocol: 'wss', + // port: 443, + // }, + // } + // : {}, }, } } -- cgit