change the base path

main
Yanick Champoux 2022-04-05 19:58:32 -04:00
parent 7106e484b4
commit dcaa1ba7d8
9 changed files with 30 additions and 23 deletions

View File

@ -1,7 +1,8 @@
<div class="mass">{mass}</div> <div class="mass">{mass}<img src="{base}/mass.svg" alt="mass"/></div>
<div class="cost">{cost}</div> <div class="cost">{cost}</div>
<script> <script>
import { base } from '$app/paths';
export let mass; export let mass;
export let cost; export let cost;
</script> </script>
@ -20,8 +21,7 @@
content: "\00A4"; content: "\00A4";
margin-left: 0.5em; margin-left: 0.5em;
} }
.mass:after { .mass img {
content: url("/mass.svg");
width: 0.75em; width: 0.75em;
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;

View File

@ -1,12 +1,12 @@
<div>{mass}</div> <div>{mass}<img src={base+'/mass.svg'} alt="mass"/></div>
<script> <script>
import { base } from '$app/paths';
export let mass = 0; export let mass = 0;
</script> </script>
<style> <style>
div:after { img {
content: url("/mass.svg");
width: 0.75em; width: 0.75em;
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;

View File

@ -4,7 +4,7 @@
{#each row as threshold, j (j)} {#each row as threshold, j (j)}
<div class="cell"> <div class="cell">
{#if threshold} {#if threshold}
<img src="icons/crew-star.svg" alt="crew loss threshold" /> <img src="{base}/icons/crew-star.svg" alt="crew loss threshold" />
{/if} {/if}
</div> </div>
{/each} {/each}
@ -13,6 +13,7 @@
</div> </div>
<script> <script>
import { base } from '$app/paths';
export let shipMass = 0; export let shipMass = 0;
export let rating = 0; export let rating = 0;
export let advanced = false; export let advanced = false;

View File

@ -1,27 +1,30 @@
<div class="main_systems"> <div class="main_systems">
{#if ftl !== "none"} {#if ftl !== "none"}
<img class="ftl" src="icons/ftl-drive.svg" alt="ftl drive" /> <img class="ftl" src="{base}/icons/ftl-drive.svg" alt="ftl drive" />
{/if} {/if}
{#if engine > 0} {#if engine > 0}
<div class="thrust">{engine}</div> <div class="thrust"
style="background-image: url({base}/icons/standard-drive.svg);"
>{engine}</div>
{/if} {/if}
<img <img
class="internal" class="internal"
src="icons/internal-systems.svg" src="{base}/icons/internal-systems.svg"
alt="internal systems" alt="internal systems"
/> />
</div> </div>
<script> <script>
import { base } from '$app/paths';
export let ftl = "none"; export let ftl = "none";
export let engine = 0; export let engine = 0;
</script> </script>
<style> <style>
.thrust { .thrust {
background-image: url(icons/standard-drive.svg);
width: 2em; width: 2em;
background-size: 2em; background-size: 2em;
background-repeat: no-repeat; background-repeat: no-repeat;

View File

@ -1,10 +1,11 @@
<div> <div>
{#each range(1,firecons) as firecon} {#each range(1,firecons) as firecon}
<img class="firecon" src="icons/firecon.svg" alt="firecon" /> <img class="firecon" src="{base}/icons/firecon.svg" alt="firecon" />
{/each} {/each}
</div> </div>
<script> <script>
import { base } from '$app/paths';
import {range} from "$lib/utils.js"; import {range} from "$lib/utils.js";
export let firecons = 0; export let firecons = 0;

View File

@ -1,13 +1,14 @@
<div> <div>
{#each range(1,standard) as i} {#each range(1,standard) as i}
<img src="icons/screen.svg" alt="screen" /> <img src="{base}/icons/screen.svg" alt="screen" />
{/each} {/each}
{#each range(1,advanced) as i} {#each range(1,advanced) as i}
<img src="icons/screen-advanced.svg" alt="advanced screen" /> <img src="{base}/icons/screen-advanced.svg" alt="advanced screen" />
{/each} {/each}
</div> </div>
<script> <script>
import { base } from '$app/paths';
import {range} from "$lib/utils.js"; import {range} from "$lib/utils.js";
export let standard = 0; export let standard = 0;

View File

@ -1,7 +1,7 @@
<div class="mass"> <div class="mass">
<Field label="ship tonnage"> <Field label="ship tonnage">
<input class="short" bind:value={mass} type="number" min="10" max="300" /> <input class="short" bind:value={mass} type="number" min="10" max="300" />
<span class="mass_symbol" /> <img class="mass_symbol" src="{base}/mass.svg" alt="mass"/>
<div class="note" class:warning={!withinBudget}> <div class="note" class:warning={!withinBudget}>
{#if withinBudget} {#if withinBudget}
@ -20,6 +20,7 @@
</div> </div>
<script> <script>
import { base } from '$app/paths';
import { getContext } from "svelte"; import { getContext } from "svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field/index.svelte";
@ -55,8 +56,7 @@
width: 5em; width: 5em;
display: inline !important; display: inline !important;
} }
.mass_symbol:after { .mass_symbol {
content: url("/mass.svg");
width: 0.75em; width: 0.75em;
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;

View File

@ -2,12 +2,14 @@
<div><slot /></div> <div><slot /></div>
<div class="reqs"> <div class="reqs">
<div class="mass" bind:this={mass_el}>{mass}</div> <div class="mass" bind:this={mass_el}>{mass} <img src="{base}/mass.svg"
alt="mass"/></div>
<div class="cost" bind:this={cost_el}>{cost}</div> <div class="cost" bind:this={cost_el}>{cost}</div>
</div> </div>
</div> </div>
<script> <script>
import { base } from '$app/paths';
import { tick } from "svelte"; import { tick } from "svelte";
export let mass; export let mass;
@ -54,8 +56,7 @@
content: "\00A4"; content: "\00A4";
margin-left: 0.5em; margin-left: 0.5em;
} }
.mass:after { .mass img {
content: url("/mass.svg");
width: 0.75em; width: 0.75em;
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;

View File

@ -7,7 +7,7 @@
min="10" min="10"
max="300" max="300"
/> />
<span class="mass_symbol" /> <img class="mass_symbol" src="{base}/mass.svg" alt="mass"/>
<div class="note" class:warning={!within_budget}> <div class="note" class:warning={!within_budget}>
{#if within_budget} {#if within_budget}
@ -24,6 +24,7 @@
</div> </div>
<script> <script>
import { base } from '$app/paths';
import { getContext } from "svelte"; import { getContext } from "svelte";
import Field from "$lib/components/Field/index.svelte"; import Field from "$lib/components/Field/index.svelte";
@ -49,8 +50,7 @@
input { input {
width: 5em; width: 5em;
} }
.mass_symbol:after { .mass_symbol {
content: url("/mass.svg");
width: 0.75em; width: 0.75em;
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;