Make the game use relative paths when loading assets, to make it work in a folder on my server.
This commit is contained in:
parent
58c6d910bb
commit
3b38d16868
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Bourgade</title>
|
||||
</head>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<div class="building">
|
||||
<div class="illustration">
|
||||
<img src="/img/buildings/{ building.type }.png" alt="">
|
||||
<img src="./img/buildings/{ building.type }.png" alt="">
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="level">
|
||||
|
@ -48,7 +48,7 @@
|
||||
<div class="oasis-panel">
|
||||
<header>
|
||||
<h1>
|
||||
<img src="/img/icons/{ region.resource }.png" alt="{ region.resource }">
|
||||
<img src="./img/icons/{ region.resource }.png" alt="{ region.resource }">
|
||||
Oasis
|
||||
</h1>
|
||||
<span class="close">
|
||||
|
@ -27,7 +27,7 @@
|
||||
<Tile
|
||||
onTileClick={ () => gameTab.set('village') }
|
||||
>
|
||||
<img src="/img/icons/village.svg" alt="">
|
||||
<img src="./img/icons/village.svg" alt="">
|
||||
</Tile>
|
||||
{ /if }
|
||||
{ /each }
|
||||
|
@ -20,11 +20,11 @@
|
||||
>
|
||||
{ #if region.type === WORLDMAP_TYPES.BOURGADE }
|
||||
<button class="invisible" on:click={ () => gameTab.set('resources') }>
|
||||
<img src="/img/icons/field.svg" alt="">
|
||||
<img src="./img/icons/field.svg" alt="">
|
||||
</button>
|
||||
{ :else if region.type === WORLDMAP_TYPES.OASIS }
|
||||
<button class="invisible" on:click={ () => showOasisPanel.set(region.id) }>
|
||||
<img src="/img/icons/{region.resource}.png" alt="">
|
||||
<img src="./img/icons/{region.resource}.png" alt="">
|
||||
</button>
|
||||
{ :else }
|
||||
{ region.id }
|
||||
|
@ -48,7 +48,7 @@
|
||||
{ #each constructible as building }
|
||||
<div class="building">
|
||||
<div class="content">
|
||||
<img src="/img/buildings/{building.type}.png" alt="">
|
||||
<img src="./img/buildings/{building.type}.png" alt="">
|
||||
<div>
|
||||
<h3>{ building.name }</h3>
|
||||
<p>{ building.description.short }</p>
|
||||
|
@ -15,33 +15,33 @@
|
||||
<div
|
||||
class:short={ $village.resources.wood < cost.wood }
|
||||
>
|
||||
<img src="/img/icons/wood.png" alt="Wood" />
|
||||
<img src="./img/icons/wood.png" alt="Wood" />
|
||||
{ cost.wood }
|
||||
</div>
|
||||
|
||||
<div
|
||||
class:short={ $village.resources.stone < cost.stone }
|
||||
>
|
||||
<img src="/img/icons/stone.png" alt="Stone" />
|
||||
<img src="./img/icons/stone.png" alt="Stone" />
|
||||
{ cost.stone }
|
||||
</div>
|
||||
|
||||
<div
|
||||
class:short={ $village.resources.iron < cost.iron }
|
||||
>
|
||||
<img src="/img/icons/iron.png" alt="Iron" />
|
||||
<img src="./img/icons/iron.png" alt="Iron" />
|
||||
{ cost.iron }
|
||||
</div>
|
||||
|
||||
<div
|
||||
class:short={ $village.resources.food < cost.food }
|
||||
>
|
||||
<img src="/img/icons/food.png" alt="Food" />
|
||||
<img src="./img/icons/food.png" alt="Food" />
|
||||
{ cost.food }
|
||||
</div>
|
||||
{ #if duration !== null }
|
||||
<div>
|
||||
<img src="/img/icons/time.png" alt="Duration">
|
||||
<img src="./img/icons/time.png" alt="Duration">
|
||||
{ prettyDuration }
|
||||
</div>
|
||||
{ /if }
|
||||
|
@ -9,21 +9,21 @@
|
||||
class="invisible"
|
||||
on:click={ () => setTab('village') }
|
||||
>
|
||||
<img src="/img/icons/village.svg" alt="">
|
||||
<img src="./img/icons/village.svg" alt="">
|
||||
<span>Village</span>
|
||||
</button>
|
||||
<button
|
||||
class="invisible"
|
||||
on:click={ () => setTab('resources') }
|
||||
>
|
||||
<img src="/img/icons/field.svg" alt="">
|
||||
<img src="./img/icons/field.svg" alt="">
|
||||
<span>Resources</span>
|
||||
</button>
|
||||
<button
|
||||
class="invisible"
|
||||
on:click={ () => setTab('world') }
|
||||
>
|
||||
<img src="/img/icons/world.svg" alt="">
|
||||
<img src="./img/icons/world.svg" alt="">
|
||||
<span>Worldmap</span>
|
||||
</button>
|
||||
</nav>
|
||||
|
@ -27,7 +27,7 @@
|
||||
<Reward reward={ quest.reward } />
|
||||
</p>
|
||||
<p>
|
||||
<img src="/img/icons/time.png" alt="Duration">
|
||||
<img src="./img/icons/time.png" alt="Duration">
|
||||
{ #if quest.started }
|
||||
{ getPrettyTime(quest.remainingTime || 0) }
|
||||
{ :else }
|
||||
|
@ -9,27 +9,27 @@
|
||||
|
||||
<div class="resources">
|
||||
<div>
|
||||
<img src="/img/icons/wood.png" alt="Wood" />
|
||||
<img src="./img/icons/wood.png" alt="Wood" />
|
||||
{ Math.floor($village.resources.wood) } / { capacity.wood }
|
||||
({ production.wood >= 0 ? '+' : '' }{ production.wood })
|
||||
</div>
|
||||
<div>
|
||||
<img src="/img/icons/stone.png" alt="Stone" />
|
||||
<img src="./img/icons/stone.png" alt="Stone" />
|
||||
{ Math.floor($village.resources.stone) } / { capacity.stone }
|
||||
({ production.stone >= 0 ? '+' : '' }{ production.stone })
|
||||
</div>
|
||||
<div>
|
||||
<img src="/img/icons/iron.png" alt="Iron" />
|
||||
<img src="./img/icons/iron.png" alt="Iron" />
|
||||
{ Math.floor($village.resources.iron) } / { capacity.iron }
|
||||
({ production.iron >= 0 ? '+' : '' }{ production.iron })
|
||||
</div>
|
||||
<div>
|
||||
<img src="/img/icons/food.png" alt="Food" />
|
||||
<img src="./img/icons/food.png" alt="Food" />
|
||||
{ Math.floor($village.resources.food) } / { capacity.food }
|
||||
({ production.food >= 0 ? '+' : '' }{ production.food })
|
||||
</div>
|
||||
<div>
|
||||
<img src="/img/icons/culture.png" alt="Culture" />
|
||||
<img src="./img/icons/culture.png" alt="Culture" />
|
||||
{ Math.floor($village.resources.culture) }
|
||||
({ production.culture >= 0 ? '+' : '' }{ production.culture })
|
||||
</div>
|
||||
|
@ -7,31 +7,31 @@
|
||||
<div class="reward">
|
||||
{ #if reward.wood > 0 }
|
||||
<div>
|
||||
<img src="/img/icons/wood.png" alt="Wood" />
|
||||
<img src="./img/icons/wood.png" alt="Wood" />
|
||||
{ reward.wood }
|
||||
</div>
|
||||
{ /if }
|
||||
{ #if reward.stone > 0 }
|
||||
<div>
|
||||
<img src="/img/icons/stone.png" alt="Stone" />
|
||||
<img src="./img/icons/stone.png" alt="Stone" />
|
||||
{ reward.stone }
|
||||
</div>
|
||||
{ /if }
|
||||
{ #if reward.iron > 0 }
|
||||
<div>
|
||||
<img src="/img/icons/iron.png" alt="Iron" />
|
||||
<img src="./img/icons/iron.png" alt="Iron" />
|
||||
{ reward.iron }
|
||||
</div>
|
||||
{ /if }
|
||||
{ #if reward.food > 0 }
|
||||
<div>
|
||||
<img src="/img/icons/food.png" alt="Food" />
|
||||
<img src="./img/icons/food.png" alt="Food" />
|
||||
{ reward.food }
|
||||
</div>
|
||||
{ /if }
|
||||
{ #if reward.culture > 0 }
|
||||
<div>
|
||||
<img src="/img/icons/culture.png" alt="Culture" />
|
||||
<img src="./img/icons/culture.png" alt="Culture" />
|
||||
{ reward.culture }
|
||||
</div>
|
||||
{ /if }
|
||||
|
@ -4,4 +4,5 @@ import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
base: './',
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user