-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
566 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,70 @@ | ||
<script lang="ts"> | ||
import { PlayerMapping } from '$lib/mappings/PlayerMappings' | ||
import { Badge, Tooltip } from 'flowbite-svelte' | ||
import { Tooltip } from 'flowbite-svelte' | ||
export let type: keyof typeof PlayerMapping | ||
export let type: keyof typeof PlayerMapping = 'P' | ||
export let team: 1 | 2 | 3 | 4 | null = null | ||
export let size: number = 400 | ||
export let x: number = 0 | ||
export let y: number = 0 | ||
export let opacity: number = 1 | ||
export let scale: number = 1 | ||
const uniqueId = crypto.randomUUID() | ||
</script> | ||
|
||
<div | ||
class=" relative flex h-12 w-12 cursor-pointer select-none items-center justify-center rounded-full bg-gray-600 text-white outline outline-2 | ||
{team === 1 ? 'outline-red-400' : ''} | ||
{team === 2 ? 'outline-green-400' : ''} | ||
{team === 3 ? 'outline-teal-400' : ''} | ||
{team === 4 ? 'outline-violet-400' : ''} | ||
{team === null ? 'outline-gray-600' : ''} | ||
{type === 'C' ? ' bg-sky-400 !outline-sky-400' : ''} | ||
" | ||
> | ||
{#if team !== null} | ||
<Badge | ||
rounded | ||
class="absolute -right-2 -top-2 h-6 w-6 p-0 font-black text-white dark:text-white | ||
{team === 1 ? '!bg-red-400' : ''} | ||
{team === 2 ? '!bg-green-400' : ''} | ||
{team === 3 ? '!bg-teal-400' : ''} | ||
{team === 4 ? '!bg-violet-400' : ''} | ||
">{team}</Badge | ||
> | ||
{/if} | ||
<div class="flex flex-col items-center"> | ||
<p class="text-center font-black leading-3"> | ||
{type} | ||
</p> | ||
<!-- {#if team !== null} | ||
<p class="text-center text-xs font-black leading-3 text-black">{team}</p> | ||
{/if} --> | ||
</div> | ||
</div> | ||
<!-- prettier-ignore-start --> | ||
<svg {...$$restProps} x={x} y={y} opacity={opacity} scale={scale} width={size} height={size} viewBox="0 0 1200 1200" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<g id={"Player-"+uniqueId} clip-path="url(#{"clip0_0_1-"+uniqueId})"> | ||
<!-- Player Circle --> | ||
<circle id={"PlayerCircle-"+uniqueId} class=" | ||
fill-gray-600 stroke-gray-600 | ||
{team === 1 ? 'stroke-red-400' : ''} | ||
{team === 2 ? 'stroke-green-400' : ''} | ||
{team === 3 ? 'stroke-teal-400' : ''} | ||
{team === 4 ? 'stroke-violet-400' : ''} | ||
{team === null ? 'stroke-gray-600' : ''} | ||
{type === 'C' ? ' fill-sky-400 stroke-sky-400' : ''} | ||
" cx="500" cy="700" r="490" stroke-width="70" clip-path="url(#{"PlayerCircleClip-"+uniqueId})"/> | ||
|
||
<!-- Player Type Text (Centered in the Player Circle) --> | ||
<text id={"PlayerType-"+uniqueId} class="fill-white select-none" x="500" y="740" text-anchor="middle" dominant-baseline="middle" font-family="Inter" font-size="450" font-weight="bold" letter-spacing="0em"> | ||
<tspan>{type}</tspan> | ||
</text> | ||
|
||
{#if team !== null} | ||
<!-- Team Number Circle --> | ||
<circle id={"TeamNumberCircle-"+uniqueId} class=" | ||
{team === 1 ? 'fill-red-400' : ''} | ||
{team === 2 ? 'fill-green-400' : ''} | ||
{team === 3 ? 'fill-teal-400' : ''} | ||
{team === 4 ? 'fill-violet-400' : ''} | ||
" cx="974.5" cy="225.5" r="225.5" /> | ||
|
||
<!-- Team Number Text (Centered in the Team Circle) --> | ||
<text id={"TeamNumber-"+uniqueId} class="fill-white select-none" x="974.5" y="245.5" text-anchor="middle" dominant-baseline="middle" font-family="Inter" font-size="300" font-weight="bold" letter-spacing="0em"> | ||
<tspan>{team}</tspan> | ||
</text> | ||
{/if} | ||
<rect class="cursor-pointer fill-transparent" width="1200" height="1200"/> | ||
</g> | ||
<defs> | ||
<clipPath id={"PlayerCircleClip-"+uniqueId}> | ||
<use xlink:href={"#PlayerCircle-"+uniqueId}/> | ||
</clipPath> | ||
<clipPath id={"clip0_0_1-"+uniqueId}> | ||
<rect width="1200" height="1200" fill="white"/> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
<!-- prettier-ignore-end --> | ||
<Tooltip | ||
>{PlayerMapping[type]} | ||
class="z-50" | ||
reference={'#PlayerCircle-' + uniqueId} | ||
triggeredBy={'#Player-' + uniqueId} | ||
> | ||
{PlayerMapping[type]} | ||
{#if team !== null} | ||
team {team} | ||
{/if}</Tooltip | ||
> | ||
{/if} | ||
</Tooltip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
export let size: number = 100 | ||
export let x: number = 0 | ||
export let y: number = 0 | ||
export let opacity: number = 1 | ||
export let scale: number = 1 | ||
</script> | ||
|
||
<!-- prettier-ignore-start --> | ||
<svg {...$$restProps} width={size} height={size} x={x} y={y} opacity={opacity} scale={scale} viewBox="0 0 2419 2419" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<rect width="2419" height="2419"/> | ||
<g id="Volleyball"> | ||
<circle id="Yellow" cx="1209.5" cy="1209.5" r="1209.5" fill="#FFD742"/> | ||
<path id="Blue" d="M327.403 581.307L337.24 619.416L360.604 657.524L404.872 710.384L484.8 765.703L574.566 812.416L668.02 848.066L743.03 861.588L816.81 867.735H960.681L1100.86 857.9L1289 834.544L1389.84 821.021H1499.28L1624.7 841.919L1758.74 882.486L1889.08 947.639L2009.59 1028.77L2060 1073.03L2106.73 1122.2L2152.23 1178.75L2191.58 1240.21L2212.48 1279.55L2229.7 1320.12L2271.51 1290.61L2314.55 1238.98L2346.52 1176.29L2358.81 1130.81L2367.42 1071.8V989.436L2360.04 926.741L2351.44 871.423L2336.68 813.645L2299.79 703.008L2324.38 759.556L2346.52 819.792L2357.58 855.442L2377.26 926.741L2390.78 989.436L2401.85 1071.8L2408 1149.25V1226.69L2404.31 1301.68L2395.7 1376.67L2380.95 1450.42L2352.67 1531.56L2339.14 1589.34L2321.92 1644.65L2271.51 1758.98L2224.78 1837.65L2185.43 1897.89L2155.92 1936L2100.58 2002.38L2047.71 2057.7L1992.37 2109.33L1908.76 2175.71L1862.03 2207.67L1811.61 2238.41L1763.65 2264.22L1732.91 2280.2L1696.02 2297.41L1633.31 2322L1686.19 2288.81L1715.7 2270.37L1746.44 2249.47L1790.71 2215.05L1838.66 2175.71L1887.85 2129L1938.27 2077.37L1992.37 2018.36L2036.64 1960.59L2087.06 1897.89L2109.19 1865.93L2127.64 1831.51L2123.95 1815.53L2116.57 1795.86L2106.73 1772.5L2079.68 1735.62L2044.02 1702.43L1980.08 1658.18L1898.92 1622.53L1811.61 1600.4L1742.75 1585.65L1675.12 1578.27H1536.17L1392.29 1593.02L1258.26 1612.69L1180.79 1622.53L1100.86 1626.21L1016.02 1624.99L943.466 1615.15L864.767 1599.17L754.097 1565.98L685.236 1537.7L639.738 1515.58L563.499 1472.55L488.489 1420.92L439.302 1382.81L374.13 1316.43L312.647 1242.67L265.919 1173.83L230.259 1103.76L173.694 1143.1L131.885 1187.35L96.2251 1242.67L74.0911 1295.53L61.7944 1352.08L55.646 1408.63V1475.01L61.7944 1535.25L77.7801 1615.15L56.8757 1554.92L40.89 1503.28L32.2824 1465.18L19.9857 1400.02L10.1483 1325.04L4 1252.51V1143.1L13.8373 1028.77L26.134 998.041L38.4307 964.85L45.8087 951.327L54.4164 937.805L66.713 919.366L74.0911 898.467L81.4691 872.652L85.1581 845.607L104.833 779.225L120.818 728.824L140.493 679.651L183.531 583.766L220.421 508.778L274.527 436.249L351.996 350.198L435.613 273.981L500.786 224.809L563.499 181.784L647.116 133.841L712.289 103.108L763.935 80.9809L806.973 65L782.38 78.5223L739.341 108.026L687.695 151.051L647.116 185.472L573.336 256.771L504.475 329.3L440.532 409.205L375.36 500.173L327.403 581.307Z" fill="#222E94"/> | ||
</g> | ||
</svg> | ||
<!-- prettier-ignore-end --> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.