Add an image for each building.
BIN
public/img/buildings/barracks.png
Normal file
After Width: | Height: | Size: 213 KiB |
BIN
public/img/buildings/field.png
Normal file
After Width: | Height: | Size: 232 KiB |
BIN
public/img/buildings/granary.png
Normal file
After Width: | Height: | Size: 224 KiB |
BIN
public/img/buildings/mine.png
Normal file
After Width: | Height: | Size: 303 KiB |
BIN
public/img/buildings/pit.png
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
public/img/buildings/townhall.png
Normal file
After Width: | Height: | Size: 258 KiB |
BIN
public/img/buildings/university.png
Normal file
After Width: | Height: | Size: 235 KiB |
BIN
public/img/buildings/warehouse.png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
public/img/buildings/woodcutter.png
Normal file
After Width: | Height: | Size: 196 KiB |
@ -18,11 +18,14 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div class="building">
|
||||||
<p>{ building.name }</p>
|
<div class="illustration">
|
||||||
<p>
|
<img src="/img/buildings/{ building.type }.png" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<!-- <p>{ building.name }</p> -->
|
||||||
|
<div class="level">
|
||||||
<button
|
<button
|
||||||
class="level"
|
|
||||||
class:can-upgrade={ canUpgrade }
|
class:can-upgrade={ canUpgrade }
|
||||||
class:is-upgrading={ isUpgrading }
|
class:is-upgrading={ isUpgrading }
|
||||||
class:max-level={ maxLevelReached }
|
class:max-level={ maxLevelReached }
|
||||||
@ -35,11 +38,37 @@
|
|||||||
</span>
|
</span>
|
||||||
{ /if }
|
{ /if }
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.building {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.building .illustration,
|
||||||
|
.building .illustration img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.building .content {
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.level {
|
.level {
|
||||||
|
bottom: -0.4em;
|
||||||
|
left: 50%;
|
||||||
|
position: absolute;
|
||||||
|
translate: -50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level button {
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
background-color: hsl(208, 100%, 97%);
|
background-color: hsl(208, 100%, 97%);
|
||||||
border: 0.4em solid hsl(0, 0%, 45%);
|
border: 0.4em solid hsl(0, 0%, 45%);
|
||||||
@ -48,21 +77,26 @@
|
|||||||
box-shadow: 0 0 0.2em black;
|
box-shadow: 0 0 0.2em black;
|
||||||
color: hsl(0, 0%, 10%);
|
color: hsl(0, 0%, 10%);
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
|
transition: all 100ms ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.level span {
|
.level button span {
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.level.can-upgrade {
|
.level button.can-upgrade {
|
||||||
border-color: hsl(90, 99%, 36%);
|
border-color: hsl(90, 99%, 36%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.level.is-upgrading {
|
.level button.is-upgrading {
|
||||||
border-color: hsl(56, 99%, 43%);
|
border-color: hsl(56, 99%, 43%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.level.max-level {
|
.level button.max-level {
|
||||||
border-color: hsl(209, 70%, 52%);
|
border-color: hsl(209, 70%, 52%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.level button:hover {
|
||||||
|
scale: 1.1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -16,8 +16,10 @@
|
|||||||
<style>
|
<style>
|
||||||
.hexagon {
|
.hexagon {
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
background-color: hsl(220, 75%, 75%);
|
border: 0.2em solid;
|
||||||
|
border-color: hsl(220, 75%, 75%);
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1.2vmin;
|
font-size: 1.2vmin;
|
||||||
height: 12em;
|
height: 12em;
|
||||||
@ -27,11 +29,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hexagon:hover {
|
.hexagon:hover {
|
||||||
background-color: hsl(60, 75%, 75%);
|
border-color: hsl(60, 75%, 75%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hexagon:active {
|
.hexagon:active {
|
||||||
background-color: hsl(60, 75%, 50%);
|
border-color: hsl(60, 75%, 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hexagon .content {
|
.hexagon .content {
|
||||||
|