Made pages more visually coherent and simplified css a bit more. Also

added border to plants that indicate the growth time.
This commit is contained in:
sarah committed 2026-09-01 18:47:55 +02:00
1 parent 40db65d955
commit 624b933347
8 files changed
+152 -272

No files matched your search

+6 -6
View File
@@ -17,7 +17,7 @@ $PageSection = "Garden";
<main class="MainContainer"> <main class="MainContainer">
<h1>Garden</h1> <h1>Garden</h1>
<div class="GardenStatus"> <div class="StatusPanel">
<strong>Dew:</strong> <strong>Dew:</strong>
<span id="DewAmount">0</span> <span id="DewAmount">0</span>
<br> <br>
@@ -37,7 +37,7 @@ $PageSection = "Garden";
<section <section
id="Seeds" id="Seeds"
class="SeedPanel" class="Panel SeedPanel"
> >
<h2>Seeds</h2> <h2>Seeds</h2>
@@ -53,7 +53,7 @@ $PageSection = "Garden";
<div class="ToolList"> <div class="ToolList">
<button <button
id="ShovelToolButton" id="ShovelToolButton"
class="ToolButton ToolButtonShovel" class="ActionButton ToolButton ToolButtonShovel"
type="button" type="button"
> >
Shovel Shovel
@@ -62,13 +62,13 @@ $PageSection = "Garden";
</section> </section>
</div> </div>
<p id="GardenMessage"> <p id="GardenMessage" class="PageMessage">
Select a seed, then choose an empty plot. Select a seed, then choose an empty plot.
</p> </p>
<section <section
id="Player" id="Player"
class="GardenUser" class="Panel GardenUser"
> >
<h2>Player</h2> <h2>Player</h2>
@@ -103,7 +103,7 @@ $PageSection = "Garden";
<section <section
id="Leaderboard" id="Leaderboard"
class="Leaderboard" class="Panel Leaderboard"
> >
<h2>Leaderboard</h2> <h2>Leaderboard</h2>
+3 -3
View File
@@ -142,7 +142,7 @@ $PageSection = "Guide";
aria-label="Red Rose, empty plot, Blue Rose" aria-label="Red Rose, empty plot, Blue Rose"
> >
<div <div
class="GuideRecipeCell GuideRecipePlant" class="PlantTile GuideRecipeCell GuideRecipePlant"
data-plant-key="RedRose" data-plant-key="RedRose"
> >
<span class="GuideRecipeLabel"> <span class="GuideRecipeLabel">
@@ -151,13 +151,13 @@ $PageSection = "Guide";
</div> </div>
<div <div
class="GuideRecipeCell GuideRecipeEmpty" class="PlantTile GuideRecipeCell GuideRecipeEmpty"
> >
<span>Empty</span> <span>Empty</span>
</div> </div>
<div <div
class="GuideRecipeCell GuideRecipePlant" class="PlantTile GuideRecipeCell GuideRecipePlant"
data-plant-key="BlueRose" data-plant-key="BlueRose"
> >
<span class="GuideRecipeLabel"> <span class="GuideRecipeLabel">
+4 -4
View File
@@ -25,7 +25,7 @@ $PageTitle = "Profile";
<section <section
id="Player" id="Player"
class="ProfileSection" class="Panel ProfileSection"
> >
<h2>Player</h2> <h2>Player</h2>
@@ -101,7 +101,7 @@ $PageTitle = "Profile";
<section <section
id="Statistics" id="Statistics"
class="ProfileSection" class="Panel ProfileSection"
> >
<h3>Statistics</h3> <h3>Statistics</h3>
@@ -161,7 +161,7 @@ $PageTitle = "Profile";
<section <section
id="Account" id="Account"
class="ProfileSection" class="Panel ProfileSection"
> >
<h2>Account</h2> <h2>Account</h2>
@@ -228,7 +228,7 @@ $PageTitle = "Profile";
<section <section
id="Import" id="Import"
class="ProfileSection" class="Panel ProfileSection"
> >
<h3>Import Account</h3> <h3>Import Account</h3>
+2 -2
View File
@@ -17,7 +17,7 @@ $PageSection = "Shop";
<main class="MainContainer"> <main class="MainContainer">
<h1>Garden shop</h1> <h1>Garden shop</h1>
<div class="ShopStatus"> <div class="StatusPanel">
<strong>Dew:</strong> <strong>Dew:</strong>
<span id="ShopDewAmount">0</span> <span id="ShopDewAmount">0</span>
</div> </div>
@@ -52,7 +52,7 @@ $PageSection = "Shop";
></div> ></div>
</section> </section>
<p id="ShopMessage"> <p id="ShopMessage" class="PageMessage">
Choose a seed to buy. Choose a seed to buy.
</p> </p>
</main> </main>
+16 -13
View File
@@ -262,7 +262,7 @@ function RenderSeeds() {
); );
Button.className = Button.className =
"SeedButton"; "ActionButton SeedButton";
Button.type = "button"; Button.type = "button";
@@ -353,7 +353,7 @@ function CreatePlotElement(
); );
Button.className = Button.className =
"GardenPlot"; "PlantTile GardenPlot";
Button.type = "button"; Button.type = "button";
@@ -394,6 +394,18 @@ function CreatePlotElement(
} }
const Progress =
GetPlantGrowthProgress(
Plot,
Plant
);
Button.style.setProperty(
"--GrowthProgress",
`${Progress * 100}%`
);
const ImagePath = const ImagePath =
GetPlantImage( GetPlantImage(
Plot, Plot,
@@ -407,7 +419,7 @@ function CreatePlotElement(
); );
Image.className = Image.className =
"GardenPlant"; "PlantSprite";
Image.alt = Image.alt =
Plant.Name; Plant.Name;
@@ -462,10 +474,7 @@ function CreatePlotElement(
if ( if (
IsPlantMature( Progress >= 1
Plot,
Plant
)
) { ) {
Button.classList.add( Button.classList.add(
"GardenPlotMature" "GardenPlotMature"
@@ -484,12 +493,6 @@ function CreatePlotElement(
} }
); );
} else { } else {
const Progress =
GetPlantGrowthProgress(
Plot,
Plant
);
Button.title = Button.title =
Plant.Name + Plant.Name +
" - " + " - " +
+1 -1
View File
@@ -46,7 +46,7 @@ function RenderGuideRecipePlants() {
); );
Image.className = Image.className =
"GuideRecipeImage"; "PlantSprite GuideRecipeImage";
Image.src = Image.src =
Images[ Images[
+4 -4
View File
@@ -115,7 +115,7 @@ function CreateShopSeedCard(
); );
Card.className = Card.className =
"ShopItem"; "Panel ShopItem";
const Header = const Header =
@@ -250,7 +250,7 @@ function CreateShopSeedCard(
); );
BuyButton.className = BuyButton.className =
"ShopBuyButton"; "ActionButton ShopBuyButton";
BuyButton.type = "button"; BuyButton.type = "button";
@@ -306,7 +306,7 @@ function CreateShopPlantVisual(
); );
ImageFrame.className = ImageFrame.className =
"ShopPlantImageFrame"; "PlantTile ShopPlantImageFrame";
const PlantKey = const PlantKey =
@@ -344,7 +344,7 @@ function CreateShopPlantVisual(
); );
Image.className = Image.className =
"ShopPlantImage"; "PlantSprite";
Image.src = Image.src =
Images[ Images[
+116 -239
View File
@@ -79,6 +79,85 @@ body {
border: 4px solid var(--Mauve); border: 4px solid var(--Mauve);
} }
.Panel {
background-color: var(--Mantle);
border: 4px solid var(--Mauve);
}
.StatusPanel {
margin-bottom: 1.5rem;
padding: 0.75rem 1rem;
background-color: var(--Mantle);
border: 3px solid var(--Surface2);
}
.PageMessage {
margin-top: 1rem;
margin-bottom: 0;
padding: 0.75rem;
color: var(--Subtext1);
background-color: var(--Mantle);
border-left: 4px solid var(--Blue);
}
.PlantTile {
overflow: hidden;
background-color: var(--Surface0);
border: 3px solid var(--Surface2);
}
.PlantSprite {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
image-rendering: pixelated;
}
.ActionButton {
--ActionAccent: var(--Sky);
width: 100%;
padding: 0.6rem;
cursor: pointer;
color: var(--Text);
background-color: var(--Surface0);
border: 3px solid var(--Surface2);
border-radius: 0;
box-shadow: 3px 3px 0 var(--Crust);
appearance: none;
}
.ActionButton:hover:not(:disabled) {
color: var(--ActionAccent);
background-color: var(--Surface1);
border-color: var(--ActionAccent);
transform: translate(1px, 1px);
box-shadow: 2px 2px 0 var(--Crust);
}
.ActionButton:active:not(:disabled) {
transform: translate(2px, 2px);
box-shadow: 1px 1px 0 var(--Crust);
}
.ActionButton:focus-visible {
outline: 3px solid var(--Yellow);
outline-offset: 3px;
}
h1, h1,
h2, h2,
h3, h3,
@@ -270,14 +349,6 @@ select {
image-rendering: auto; image-rendering: auto;
} }
.GardenStatus {
margin-bottom: 1.5rem;
padding: 0.75rem 1rem;
background-color: var(--Mantle);
border: 3px solid var(--Surface2);
}
.GardenLayout { .GardenLayout {
display: grid; display: grid;
grid-template-columns: minmax(0, 1fr) 12rem; grid-template-columns: minmax(0, 1fr) 12rem;
@@ -306,6 +377,11 @@ select {
} }
.GardenPlot { .GardenPlot {
--GrowthProgress: 0%;
--GrowthColour: var(--Green);
--PlotBorderColour: var(--Surface2);
--TileBackground: var(--Surface0);
position: relative; position: relative;
width: 100%; width: 100%;
@@ -313,31 +389,34 @@ select {
padding: 0; padding: 0;
overflow: hidden;
cursor: pointer; cursor: pointer;
background-color: var(--Surface0); border-color: transparent;
border: 3px solid var(--Surface2); background:
linear-gradient(
var(--TileBackground),
var(--TileBackground)
) padding-box,
conic-gradient(
from -90deg,
var(--GrowthColour)
0
var(--GrowthProgress),
var(--PlotBorderColour)
var(--GrowthProgress)
100%
) border-box;
box-shadow: box-shadow: 3px 3px 0 var(--Crust);
3px 3px 0
var(--Crust);
} }
.GardenPlot:hover { .GardenPlot:hover {
background-color: var(--Surface1); --TileBackground: var(--Surface1);
border-color: var(--Sky); --PlotBorderColour: var(--Sky);
transform: transform: translate(1px, 1px);
translate( box-shadow: 2px 2px 0 var(--Crust);
1px,
1px
);
box-shadow:
2px 2px 0
var(--Crust);
} }
.GardenPlot:focus-visible { .GardenPlot:focus-visible {
@@ -349,37 +428,19 @@ select {
} }
.GardenPlotEmpty { .GardenPlotEmpty {
background-color: var(--Mantle); --TileBackground: var(--Mantle);
} }
.GardenPlotEmpty:hover { .GardenPlotEmpty:hover {
background-color: var(--Surface0); --TileBackground: var(--Surface0);
}
.GardenPlotMature {
border-color: var(--Green);
} }
.GardenPlotMature:hover { .GardenPlotMature:hover {
border-color: var(--Yellow); --GrowthColour: var(--Yellow);
}
.GardenPlant {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
image-rendering: pixelated;
} }
.SeedPanel { .SeedPanel {
padding: 0.75rem; padding: 0.75rem;
background-color: var(--Mantle);
border: 4px solid var(--Mauve);
} }
.SeedPanel h2 { .SeedPanel h2 {
@@ -392,41 +453,9 @@ select {
gap: 0.5rem; gap: 0.5rem;
} }
.SeedButton {
width: 100%;
padding: 0.6rem;
cursor: pointer;
color: var(--Text);
background-color: var(--Surface0);
border: 3px solid var(--Surface2);
box-shadow:
3px 3px 0
var(--Crust);
}
.SeedButton:hover {
color: var(--Sky);
background-color: var(--Surface1);
border-color: var(--Sky);
transform:
translate(
1px,
1px
);
box-shadow:
2px 2px 0
var(--Crust);
}
.SeedButton[aria-current="true"] { .SeedButton[aria-current="true"] {
--ActionAccent: var(--Green);
color: var(--Green); color: var(--Green);
background-color: var(--Surface1); background-color: var(--Surface1);
@@ -447,43 +476,9 @@ select {
gap: 0.5rem; gap: 0.5rem;
} }
.ToolButton {
width: 100%;
padding: 0.6rem;
cursor: pointer;
color: var(--Text);
background-color: var(--Surface0);
border: 3px solid var(--Surface2);
border-radius: 0;
box-shadow:
3px 3px 0
var(--Crust);
appearance: none;
}
.ToolButton:hover {
color: var(--Sky);
background-color: var(--Surface1);
border-color: var(--Sky);
transform:
translate(
1px,
1px
);
box-shadow:
2px 2px 0
var(--Crust);
}
.ToolButtonShovel[aria-current="true"] { .ToolButtonShovel[aria-current="true"] {
--ActionAccent: var(--Red);
color: var(--Red); color: var(--Red);
background-color: var(--Surface1); background-color: var(--Surface1);
@@ -491,31 +486,14 @@ select {
} }
.GardenPlotRemove:hover { .GardenPlotRemove:hover {
border-color: var(--Red); --GrowthColour: var(--Red);
} --PlotBorderColour: var(--Red);
#GardenMessage {
margin-top: 1rem;
margin-bottom: 0;
padding: 0.75rem;
color: var(--Subtext1);
background-color: var(--Mantle);
border-left:
4px solid
var(--Blue);
} }
.GardenUser, .GardenUser,
.Leaderboard { .Leaderboard {
margin-top: 1.5rem; margin-top: 1.5rem;
padding: 1rem; padding: 1rem;
background-color: var(--Mantle);
border: 4px solid var(--Mauve);
} }
.GardenUser h2, .GardenUser h2,
@@ -740,9 +718,6 @@ select {
.ProfileSection { .ProfileSection {
margin-top: 1.5rem; margin-top: 1.5rem;
padding: 1rem; padding: 1rem;
background-color: var(--Mantle);
border: 4px solid var(--Mauve);
} }
.ProfileSection h2 { .ProfileSection h2 {
@@ -1041,14 +1016,6 @@ select {
text-align: center; text-align: center;
} }
.ShopStatus {
margin-bottom: 1.5rem;
padding: 0.75rem 1rem;
background-color: var(--Mantle);
border: 3px solid var(--Surface2);
}
.ShopSection { .ShopSection {
margin-top: 1.5rem; margin-top: 1.5rem;
} }
@@ -1070,12 +1037,7 @@ select {
padding: 0.75rem; padding: 0.75rem;
background-color: var(--Mantle); box-shadow: 3px 3px 0 var(--Crust);
border: 4px solid var(--Mauve);
box-shadow:
3px 3px 0
var(--Crust);
} }
.ShopItemHeader { .ShopItemHeader {
@@ -1128,20 +1090,7 @@ select {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
overflow: hidden;
background-color: var(--Base); background-color: var(--Base);
border: 3px solid var(--Surface2);
}
.ShopPlantImage {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
image-rendering: pixelated;
} }
.ShopItemNumber { .ShopItemNumber {
@@ -1178,48 +1127,9 @@ select {
} }
.ShopBuyButton { .ShopBuyButton {
width: 100%; --ActionAccent: var(--Green);
padding: 0.65rem 0.8rem; padding: 0.65rem 0.8rem;
cursor: pointer;
color: var(--Text);
background-color: var(--Surface0);
border: 3px solid var(--Surface2);
border-radius: 0;
box-shadow:
3px 3px 0
var(--Crust);
appearance: none;
}
.ShopBuyButton:hover:not(:disabled) {
color: var(--Green);
background-color: var(--Surface1);
border-color: var(--Green);
transform: translate(1px, 1px);
box-shadow:
2px 2px 0
var(--Crust);
}
.ShopBuyButton:active:not(:disabled) {
transform: translate(2px, 2px);
box-shadow:
1px 1px 0
var(--Crust);
}
.ShopBuyButton:focus-visible {
outline: 3px solid var(--Yellow);
outline-offset: 3px;
} }
.ShopBuyButton:disabled { .ShopBuyButton:disabled {
@@ -1243,19 +1153,6 @@ select {
border: 3px solid var(--Surface2); border: 3px solid var(--Surface2);
} }
#ShopMessage {
margin-top: 1rem;
margin-bottom: 0;
padding: 0.75rem;
color: var(--Subtext1);
background-color: var(--Mantle);
border-left:
4px solid
var(--Blue);
}
@media (max-width: 700px) { @media (max-width: 700px) {
.ShopSeedList { .ShopSeedList {
grid-template-columns: 1fr; grid-template-columns: 1fr;
@@ -1305,14 +1202,6 @@ select {
.GuideSection { .GuideSection {
margin-top: 1.5rem; margin-top: 1.5rem;
padding: 1rem;
background-color: var(--Mantle);
border: 4px solid var(--Mauve);
}
.GuideSection h2 {
margin-bottom: 1rem;
} }
.GuideSection > :last-child { .GuideSection > :last-child {
@@ -1360,9 +1249,6 @@ select {
padding: 0.35rem; padding: 0.35rem;
text-align: center; text-align: center;
background-color: var(--Surface0);
border: 3px solid var(--Surface2);
} }
.GuideRecipePlant { .GuideRecipePlant {
@@ -1376,13 +1262,8 @@ select {
} }
.GuideRecipeImage { .GuideRecipeImage {
display: block;
width: 3.75rem; width: 3.75rem;
height: 3.75rem; height: 3.75rem;
object-fit: contain;
image-rendering: pixelated;
} }
.GuideRecipeLabel { .GuideRecipeLabel {
@@ -1404,10 +1285,6 @@ select {
} }
@media (max-width: 700px) { @media (max-width: 700px) {
.GuideSection {
padding: 0.75rem;
}
.GuideRecipe { .GuideRecipe {
grid-template-columns: grid-template-columns:
repeat( repeat(