Add an image for each building.

This commit is contained in:
Adrian 2024-11-12 12:19:13 +01:00
parent ff7458757a
commit 901d56ffa7
11 changed files with 61 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

View File

@ -18,11 +18,14 @@
}
</script>
<div>
<p>{ building.name }</p>
<p>
<div class="building">
<div class="illustration">
<img src="/img/buildings/{ building.type }.png" alt="">
</div>
<div class="content">
<!-- <p>{ building.name }</p> -->
<div class="level">
<button
class="level"
class:can-upgrade={ canUpgrade }
class:is-upgrading={ isUpgrading }
class:max-level={ maxLevelReached }
@ -35,11 +38,37 @@
</span>
{ /if }
</button>
</p>
</div>
</div>
</div>
<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 {
bottom: -0.4em;
left: 50%;
position: absolute;
translate: -50%;
}
.level button {
aspect-ratio: 1;
background-color: hsl(208, 100%, 97%);
border: 0.4em solid hsl(0, 0%, 45%);
@ -48,21 +77,26 @@
box-shadow: 0 0 0.2em black;
color: hsl(0, 0%, 10%);
font-size: 1.2em;
transition: all 100ms ease-in-out;
}
.level span {
.level button span {
font-size: 0.9em;
}
.level.can-upgrade {
.level button.can-upgrade {
border-color: hsl(90, 99%, 36%);
}
.level.is-upgrading {
.level button.is-upgrading {
border-color: hsl(56, 99%, 43%);
}
.level.max-level {
.level button.max-level {
border-color: hsl(209, 70%, 52%);
}
.level button:hover {
scale: 1.1;
}
</style>

View File

@ -16,8 +16,10 @@
<style>
.hexagon {
aspect-ratio: 1;
background-color: hsl(220, 75%, 75%);
border: 0.2em solid;
border-color: hsl(220, 75%, 75%);
border-radius: 100%;
box-sizing: border-box;
cursor: pointer;
font-size: 1.2vmin;
height: 12em;
@ -27,11 +29,11 @@
}
.hexagon:hover {
background-color: hsl(60, 75%, 75%);
border-color: hsl(60, 75%, 75%);
}
.hexagon:active {
background-color: hsl(60, 75%, 50%);
border-color: hsl(60, 75%, 50%);
}
.hexagon .content {