Cats-vs-Mice/css/style.css
2025-05-09 15:08:28 +09:00

196 lines
3.3 KiB
CSS

:root {
--dark-brown: #503E28;
--med-brown: #B09472;
--light-brown: #CAB49A;
--dark-yellow: #F7E7BE;
--light-yellow: #FDF4E5;
}
body {
background-color: #FDF6E3;
margin: 0;
font-family: sans-serif;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#gameFrame {
position: relative;
/* flex-shrink: 0; */
max-width: 800px;
width: 60vw;
aspect-ratio: 800/569;
border-radius: 35px;
background: #FFFEF9;
overflow: hidden;
}
canvas {
display: block;
width: 100%;
height: 100%;
border-radius: 25px;
z-index: 0;
}
#upperContainer {
position: absolute;
display: flex;
flex-direction: row;
gap: 16px;
align-items: center;
background: var(--med-brown);
border-radius: 25px 25px 0 0;
width: 100%;
}
#controlPanel {
/* background: var(--light-brown); */
border-radius: 30px 30px 0 0;
display: flex;
flex-direction: row;
gap: 10px;
/* TODO: ganti ke % apa ya, 10px magic number bgt */
align-items: center;
}
#cheeseLabel {
margin-left: 20px;
height: 100%;
}
#catsLabel {
height: 100%;
}
#cheeseDisplay {
background: var(--light-brown);
height: 100%;
width: auto;
aspect-ratio: 80/83;
border-radius: 8px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#catToolbar {
display: flex;
flex-direction: row;
height: 100%;
width: auto;
aspect-ratio: 330/83;
/* gap: 1px; */
background: var(--light-brown);
/* padding: 4px 8px; */
border-radius: 6px;
}
.catButton {
width: 20%;
display: flex;
flex-direction: column;
align-items: center;
background: var(--light-brown);
border: 1px solid var(--dark-brown);
border-radius: 4px;
padding: 4px 6px;
font-size: 18px;
cursor: pointer;
transition: background 0.2s;
}
.catButton span {
font-size: 12px;
color: #333;
}
.catButton:not(:disabled):hover {
background: var(--dark-yellow);
}
.catButton.activeButton {
background: red;
}
#petCage {
height: 100%;
width: auto;
aspect-ratio: 60/83;
justify-content: center;
}
.catIcon {
width: 100%;
height: auto;
object-fit: contain;
}
#cageIcon {
width: 100%;
height: auto;
object-fit: contain;
}
#cheeseIcon {
width: 50%;
height: auto;
object-fit: contain;
}
#gameProgressWrapper {
display: flex;
flex-direction: column;
align-items: center;
height: 50%;
}
#gameProgress {
appearance: none;
border-radius: 100px;
background-color: var(--dark-brown);
border: 4px solid #4b392b;
overflow: hidden;
}
#gameProgress::-webkit-progress-bar {
background-color: var(--dark-brown);
border-radius: 100px;
}
#gameProgress::-webkit-progress-value {
background-color: var(--dark-yellow);
border-radius: 100px;
}
#gameProgressLabel {
margin-top: 0.5rem;
font-size: 1.2rem;
font-weight: bold;
}
#gameBackground {
position: absolute;
translate: -50%;
width: 100%;
/* z-index: -1; */
}
.Button {
background: var(--med-brown);
color: white;
border: none;
padding: 6px 10px;
border-radius: 6px;
font-size: 14px;
cursor: pointer;
margin-top: 20px;
}
.Button:hover {
background: #a8845d;
}