Skip to content

Commit a589d0b

Browse files
committed
made jellyfish bigger
1 parent 334d190 commit a589d0b

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

src/components/JellyfishField.svelte

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
existing.has(`${x},${y}`) ||
1111
x < 0
1212
) {
13-
x = Math.floor(Math.random() * 8);
13+
x = Math.floor(Math.random() * 12);
1414
y = Math.floor(Math.random() * 8);
1515
}
1616
existing.add(`${x},${y}`);
@@ -59,16 +59,16 @@
5959

6060
<!-- https://stackoverflow.com/questions/21368410/how-to-set-svg-width-and-svg-height-by-percent -->
6161

62-
<svg width="100%" height="auto" viewBox="0 0 832 832" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin:auto;">
62+
<svg viewBox="0 0 1472 832" preserveAspectRatio="xMidYMid meet" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block; margin:auto; height=auto; width=95%">
6363

6464
<!-- Circle Generation -->
65-
{#each Array(8) as _, i}
65+
{#each Array(12) as _, i}
6666
{#each Array(8) as _, j}
6767
{#if isTaken(i, j)}
6868
<!-- Contributor Jellyfish -->
6969
<image href="/1st/assets/jellyfish.png" width="128" height="128"
70-
x={i * 96+Math.floor(Math.random() * 16)}
71-
y={j * 96+Math.floor(Math.random() * 16)}
70+
x={i * 112+48+Math.floor(Math.random() * 16)}
71+
y={j * 96+8+Math.floor(Math.random() * 16)}
7272
on:mouseover={() => showHover(i, j)}
7373
on:mouseout={hideHover}
7474
on:click={() => {
@@ -77,7 +77,7 @@
7777
/>
7878
{:else}
7979
<!-- Default Circle -->
80-
<!-- <circle cx={i * 96+64} cy={j * 96+64} r="16" fill="#FFFFFF" /> -->
80+
<!-- <circle cx={i * 112+64+48} cy={j * 96+64+8} r="16" fill="#FFFFFF" /> -->
8181
{/if}
8282
{/each}
8383
{/each}
@@ -86,7 +86,7 @@
8686
<!-- Hover Box -->
8787
{#if hovered.name}
8888
<rect
89-
x={hovered.x * 96 + 48 - (hovered.name.length * 7)}
89+
x={hovered.x * 112 + 96 - (hovered.name.length * 7)}
9090
y={hovered.y * 96}
9191
width={hovered.name.length * 14}
9292
height="28"
@@ -95,7 +95,7 @@
9595
rx="4"
9696
/>
9797
<text
98-
x={hovered.x * 96 + 48}
98+
x={hovered.x * 112 + 96}
9999
y={hovered.y * 96 + 16}
100100
font-size="16"
101101
fill="#FFFFFE"
@@ -108,10 +108,3 @@
108108
{/if}
109109

110110
</svg>
111-
112-
<style>
113-
svg {
114-
user-select: none;
115-
width: min(100%, 600px);
116-
}
117-
</style>

0 commit comments

Comments
 (0)