OKLCH Radial Gradient Device
HTML
<div class="device-container">
<div class="device-frame">
<div class="screen"></div>
<div class="nav-line"></div>
</div>
<div class="power-button"></div>
<div class="volume-up"></div>
<div class="volume-down"></div>
</div>
CSS
.screen {
background: radial-gradient(
ellipse 200% 100% at 46% 0%,
oklch(0 0.07 279) 66%,
oklch(0.98 0.09 276) 99%
);
}
.screen {
position: absolute;
inset: 0;
border-radius: 33px;
overflow: hidden;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
padding: 40px 20px;
}
.device-container {
position: relative;
width: 100%;
max-width: 400px;
aspect-ratio: 9/19.5;
background: #1a1a1a;
border-radius: 45px;
padding: 12px;
box-shadow:
0 50px 100px -20px rgba(0, 0, 0, 0.5),
0 30px 60px -30px rgba(0, 0, 0, 0.6),
inset 0 -2px 6px 0 rgba(255, 255, 255, 0.1);
}
.device-frame {
position: relative;
width: 100%;
height: 100%;
background: #000;
border-radius: 33px;
overflow: hidden;
box-shadow:
inset 0 0 2px 1px rgba(255, 255, 255, 0.1),
inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
/* Navigation line at bottom */
.nav-line {
position: absolute;
bottom: 8px;
left: 50%;
transform: translateX(-50%);
width: 120px;
height: 4px;
background: rgba(0, 0, 0, 0.8);
border-radius: 2px;
z-index: 10;
transition: width 0.3s ease;
}
.device-container:hover .nav-line {
width: 140px;
background: rgba(0, 0, 0, 0.9);
}
/* Optional: Add a subtle reflection */
.screen::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(
135deg,
transparent 60%,
rgba(255, 255, 255, 0.02) 100%
);
border-radius: 33px;
pointer-events: none;
}
/* Side buttons */
.power-button {
position: absolute;
right: -3px;
top: 180px;
width: 4px;
height: 80px;
background: #2a2a2a;
border-radius: 0 4px 4px 0;
...