kalkulator/static/assets/css/keyboard.css

93 lines
1.8 KiB
CSS
Raw Permalink Normal View History

2024-10-16 22:46:58 +02:00
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.calculator {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: minmax(100px, auto) repeat(5, 1fr);
gap: .5rem;
width: 100vw;
2024-10-17 09:05:34 +02:00
height: 100vh;
2024-10-16 22:46:58 +02:00
padding: 10px;
border-radius: 20px;
2024-10-17 09:05:34 +02:00
transition: all 0.4s;
z-index: 100;
2024-10-16 22:46:58 +02:00
}
.display {
grid-column: span 4;
color: var(--text-color);
2024-10-16 22:46:58 +02:00
font-size: 3rem;
display: flex;
justify-content: flex-end;
align-items: center;
padding: 0.5rem;
border-radius: 10px;
position: relative;
/* Allows us to absolutely position child elements */
overflow: hidden;
/* Hide characters when they move outside the display */
}
.display-text span {
position: absolute;
opacity: 0;
top: 50%;
transform: translateY(-100%);
/* Vertically centered */
font-size: 2.5rem;
white-space: nowrap;
color: var(--text-color);
2024-10-16 22:46:58 +02:00
}
.display-text {
position: relative;
width: 100%;
height: 100%;
display: flex;
justify-content: flex-end;
/* Characters start from the right */
}
.button {
background-color: var(--button-primary);
border: none;
border-radius: 50%;
color: var(--text-color);
2024-10-16 22:46:58 +02:00
font-size: 1.25rem;
display: flex;
justify-content: center;
align-items: center;
padding: .5rem;
aspect-ratio: 1;
/* This will make the buttons perfectly circular */
cursor: pointer;
transition: transform 0.1s ease-out;
}
.button.operation {
background-color: var(--button-secondary);
}
.button.settings {
background-color: var(--button-primary);
2024-10-16 22:46:58 +02:00
border-radius: 50%;
}
.button.settings img {
width: 1.5rem;
height: 1.5rem;
}
.button:active {
transform: scale(0.85);
}
.button.zero {
grid-column: span 1;
/* Make the '0' button normal size again */
}