mirror of https://github.com/sveltejs/svelte
41 lines
819 B
41 lines
819 B
2 years ago
|
<svelte:options namespace="svg" />
|
||
|
|
||
6 years ago
|
<script>
|
||
|
export let x, y;
|
||
|
</script>
|
||
|
|
||
|
<rect
|
||
2 years ago
|
x="0"
|
||
|
y="0"
|
||
|
width="1400"
|
||
|
height="1800"
|
||
|
stroke="#ccc"
|
||
6 years ago
|
style="opacity: 0.5"
|
||
2 years ago
|
fill="none"
|
||
|
stroke-width="2"
|
||
6 years ago
|
/>
|
||
|
|
||
|
{#each { length: 8 } as _, i}
|
||
|
{#if i < 6}
|
||
2 years ago
|
<path d="M{(i + 1) * 200} 0 L{(i + 1) * 200} 1802" class="grid-line" />
|
||
6 years ago
|
{/if}
|
||
2 years ago
|
<path d="M0 {(i + 1) * 200} L1400 {(i + 1) * 200} " class="grid-line" />
|
||
6 years ago
|
{/each}
|
||
|
|
||
2 years ago
|
<path style="transform: translateX({x + 200}px)" d="M0 0 L0 1800" class="grid-line-xy" />
|
||
|
<path style="transform: translateY({y}px)" d="M0 400 L1400 400" class="grid-line-xy" />
|
||
|
<rect x="200" y="400" width="1000" height="1000" stroke="#999" fill="none" stroke-width="2" />
|
||
4 years ago
|
|
||
|
<style>
|
||
|
.grid-line {
|
||
2 years ago
|
stroke: #ccc;
|
||
4 years ago
|
opacity: 0.5;
|
||
|
stroke-width: 2;
|
||
|
}
|
||
|
|
||
|
.grid-line-xy {
|
||
|
stroke: tomato;
|
||
|
stroke-width: 2;
|
||
|
}
|
||
|
</style>
|