195 lines
3.9 KiB
CSS
195 lines
3.9 KiB
CSS
/*
|
|
Main Project Styles
|
|
Simple, clean, and modern calculator design.
|
|
*/
|
|
|
|
/* --- Variables --- */
|
|
:root {
|
|
/* Colors */
|
|
--bg-main: #121212;
|
|
--bg-card: rgba(30, 30, 35, 0.8);
|
|
--bg-display: #1a1a1a;
|
|
|
|
--text-main: #ffffff;
|
|
--text-muted: #a0a0a0;
|
|
--text-black: #000000;
|
|
|
|
/* Button Colors */
|
|
--btn-num-bg: #2d2d2d;
|
|
--btn-num-hover: #3d3d3d;
|
|
|
|
--btn-op-bg: #ff9f0a;
|
|
--btn-op-hover: #ffb03a;
|
|
|
|
--btn-clear-bg: #ff453a;
|
|
--btn-clear-hover: #ff6961;
|
|
|
|
/* Layout & Effects */
|
|
--radius-l: 24px;
|
|
--radius-m: 16px;
|
|
--shadow-heavy: 0 20px 50px rgba(0, 0, 0, 0.5);
|
|
--shadow-light: 0 4px 6px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
/* --- Global Setup --- */
|
|
body {
|
|
background-color: var(--bg-main);
|
|
background-image: radial-gradient(circle at 50% 0%, #2a2a35 0%, #121212 100%);
|
|
color: var(--text-main);
|
|
font-family: -apple-system, sans-serif;
|
|
margin: 0;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* --- App Container --- */
|
|
.app-container {
|
|
width: 100%;
|
|
height: 100vh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
animation: fade-in 0.8s ease-out;
|
|
}
|
|
|
|
/* --- Calculator Wrapper (The Card) --- */
|
|
.calculator-wrap {
|
|
background-color: var(--bg-card);
|
|
backdrop-filter: blur(20px);
|
|
width: 360px;
|
|
padding: 24px;
|
|
border-radius: var(--radius-l);
|
|
box-shadow: var(--shadow-heavy);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
}
|
|
|
|
/* --- Display Area --- */
|
|
.display-area {
|
|
background-color: var(--bg-display);
|
|
border-radius: var(--radius-m);
|
|
padding: 24px;
|
|
text-align: right;
|
|
margin-bottom: 10px;
|
|
min-height: 48px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
overflow: hidden;
|
|
/* Hide if numbers get too long */
|
|
}
|
|
|
|
.display-text {
|
|
font-size: 3rem;
|
|
font-weight: 300;
|
|
white-space: nowrap;
|
|
background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
|
|
-webkit-background-clip: text;
|
|
background-clip: text;
|
|
color: transparent;
|
|
/* Fallback */
|
|
}
|
|
|
|
.operator-symbol {
|
|
color: var(--btn-op-bg);
|
|
/* Use operator color for visibility */
|
|
font-weight: 500;
|
|
margin: 0 4px;
|
|
/* Reset gradient text effect for symbol to make it solid color */
|
|
-webkit-text-fill-color: var(--btn-op-bg);
|
|
}
|
|
|
|
/* --- Keypad Grid --- */
|
|
.keypad-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: 12px;
|
|
}
|
|
|
|
/* --- Buttons --- */
|
|
.calc-btn {
|
|
border: none;
|
|
outline: none;
|
|
font-size: 1.5rem;
|
|
font-weight: 500;
|
|
padding: 20px 0;
|
|
border-radius: var(--radius-m);
|
|
cursor: pointer;
|
|
transition: transform 0.1s, filter 0.2s;
|
|
box-shadow: var(--shadow-light);
|
|
color: var(--text-main);
|
|
position: relative;
|
|
/* For overflow/effects */
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Button Interactions */
|
|
.calc-btn:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.calc-btn:hover {
|
|
filter: brightness(1.1);
|
|
}
|
|
|
|
/* Button Variants */
|
|
.btn-number {
|
|
background-color: var(--btn-num-bg);
|
|
}
|
|
|
|
.btn-operator {
|
|
background-color: var(--btn-op-bg);
|
|
color: var(--text-black);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn-equals {
|
|
grid-column: span 4;
|
|
/* Full width */
|
|
background-color: var(--btn-op-bg);
|
|
color: var(--text-black);
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.btn-clear {
|
|
background-color: var(--btn-clear-bg);
|
|
color: white;
|
|
}
|
|
|
|
.btn-zero {
|
|
grid-column: span 2;
|
|
/* Double width */
|
|
text-align: left;
|
|
padding-left: 32px;
|
|
}
|
|
|
|
/* --- Animations --- */
|
|
@keyframes fade-in {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(20px);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
/* --- Responsiveness --- */
|
|
@media (max-height: 700px) {
|
|
.calculator-wrap {
|
|
padding: 16px;
|
|
gap: 12px;
|
|
}
|
|
|
|
.calc-btn {
|
|
padding: 16px 0;
|
|
font-size: 1.25rem;
|
|
}
|
|
} |