Create route icons and components to place these icons.
This commit is contained in:
32
src/lib/components/mapIcons/Loop.svelte
Normal file
32
src/lib/components/mapIcons/Loop.svelte
Normal file
@@ -0,0 +1,32 @@
|
||||
<script lang="ts">
|
||||
import { getElecColour } from '$lib/railStyles';
|
||||
import BaseTrack from '$lib/components/mapIcons/BaseTrack.svelte';
|
||||
|
||||
export let feature: {
|
||||
side: 'left' | 'right' | 'both';
|
||||
elecLoop?: string;
|
||||
};
|
||||
|
||||
export let reversed: boolean = false;
|
||||
export let activeElec: any;
|
||||
|
||||
$: loopColour = getElecColour(feature.elecLoop || activeElec);
|
||||
|
||||
const leftPath = `M 32 0 Q 8 32 32 64`;
|
||||
const rightPath = `M 32 0 Q 56 32 32 64`;
|
||||
</script>
|
||||
|
||||
<svg viewBox="0 0 64 64" width="64" height="64" class="loops">
|
||||
<g fill="none" stroke={loopColour} stroke-width="4" stroke-linecap="round">
|
||||
{#if feature.side === 'left' || feature.side === 'both'}
|
||||
<path d={leftPath} />
|
||||
{/if}
|
||||
|
||||
{#if feature.side === 'right' || feature.side === 'both'}
|
||||
<path d={rightPath} />
|
||||
{/if}
|
||||
</g>
|
||||
|
||||
<BaseTrack {activeElec} height={64} />
|
||||
|
||||
</svg>
|
||||
Reference in New Issue
Block a user