<div class="car-container">
<div class="circle-bg"></div>
<div class="main-body">
<div class="cut"></div>
<div class="mask">
<div class="headlight headlight-left"></div>
<div class="headlight headlight-right"></div>
<div class="honda-logo">
<div class="rect rect-left"></div>
<div class="rect rect-center"></div>
<div class="rect rect-right"></div>
</div>
<h1 class="message">Hello!</h1>
</div>
<div class="shadow"></div>
</div>
<div class="circle circle-left"></div>
<div class="circle circle-right"></div>
<div class="upper-body">
<div class="window"></div>
</div>
<div class="wheel wheel-left"></div>
<div class="wheel wheel-right"></div>
<div class="car-shadow"></div>
</div>
<div class="road-container">
<div class="road"></div>
</div>
@import url('https://fonts.googleapis.com/css?family=Inconsolata:400,700');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
}
body {
background: #cdcbba;
overflow: hidden;
}
$mainBody: 500px;
$upperBody: 290px;
$primary: #f1edde;
$secondary: #e0dccd;
$window: #0d0822;
$mask: #303030;
$light: #e1f0fc;
$road: #5C4B51;
.car-container {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 500px;
height: 500px;
// border: 1px solid white;
.circle-bg {
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
width: 400px;
height: 400px;
border-radius: 50%;
background: linear-gradient(crimson 5%, transparent 40%);
z-index: -1;
}
.main-body {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: $mainBody;
height: 150px;
background: $primary;
border-top-left-radius: 40px;
border-top-right-radius: 40px;
border-bottom-left-radius: 60px;
border-bottom-right-radius: 60px;
overflow: hidden;
z-index: 3;
.shadow {
position: absolute;
margin: auto;
bottom: -10px;
width: inherit;
height: 20px;
left: 0;
background: black;
opacity: 0.3;
z-index: 4;
}
.cut {
position: absolute;
margin: auto;
top: -40px;
right: 0;
bottom: 0;
left: 0;
width: inherit;
height: 2px;
background: $secondary;
z-index: 5;
}
.mask {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 400px;
height: 80px;
background: $mask;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 60px;
border-bottom-right-radius: 60px;
border-top: 4px solid #303030;
border-bottom: 4px solid $secondary;
z-index: 5;
overflow: hidden;
&::after {
content: "";
position: absolute;
margin: auto;
top: -100px;
right: 100px;
width: 20px;
height: 250px;
background: white;
opacity: 0.2;
transform: rotate(-40deg);
}
.honda-logo {
position: absolute;
margin: auto;
top: -20px;
right: 0;
bottom: 0;
left: 0;
width: 30px;
height: 30px;
border: 4px solid white;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
box-shadow: 0 0 25px 0 $light,
inset 0 0 25px 0 $light;
overflow: hidden;
.rect {
position: absolute;
margin: auto;
width: 4px;
height: 30px;
background: white;
}
.rect-left {
left: 3px;
transform: rotate(-5deg);
}
.rect-right {
right: 3px;
transform: rotate(5deg);
}
.rect-center {
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 10px;
transform: rotate(90deg);
}
}
.headlight {
position: absolute;
margin: auto;
top: -5px;
width: 60px;
height: 60px;
border: 10px solid white;
border-radius: 50%;
box-shadow: 0 0 25px 0 $light,
inset 0 0 25px 0 $light;
&::before {
content: "";
position: absolute;
margin: auto;
top: -10px;
right: 0;
bottom: 0;
left: 0;
width: 20px;
height: 5px;
border-radius: 5px;
background: white;
}
&::after {
content: "";
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: -10px;
left: 0;
width: 20px;
height: 5px;
border-radius: 5px;
background: white;
}
}
.headlight-left {
left: 20px;
}
.headlight-right {
right: 20px;
}
.message {
position: absolute;
margin: auto;
top: -20px;
right: 0;
bottom: 0;
left: -150px;
font-family: 'Inconsolata', monospace;
width: 60px;
height: 20px;
font-size: 16px;
color: white;
text-shadow: 0 0 15px $light;
}
}
}
.circle {
position: absolute;
margin: auto;
top: -60px;
bottom: 0;
width: 150px;
height: 120px;
border-radius: 50%;
background: $primary;
z-index: 2;
}
.circle-left {
left: 0;
}
.circle-right {
right: 0;
}
.upper-body {
position: absolute;
margin: auto;
top: -200px;
right: 0;
bottom: 0;
left: 0;
height: 100px;
width: $upperBody;
background: $primary;
border-top-left-radius: 80px;
border-top-right-radius: 80px;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
overflow: hidden;
z-index: 1;
.window {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 85px;
width: 280px;
background: $window;
border-top-left-radius: 80px;
border-top-right-radius: 80px;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
border: 2px solid #202020;
z-index: 2;
overflow: hidden;
&::before {
content: "";
position: absolute;
margin: auto;
top: -100px;
right: 50px;
width: 20px;
height: 250px;
background: white;
opacity: 0.2;
transform: rotate(-40deg);
}
&::after {
content: "";
position: absolute;
margin: auto;
top: -100px;
right: 100px;
width: 50px;
height: 250px;
background: white;
opacity: 0.2;
transform: rotate(-40deg);
}
}
}
.wheel {
position: absolute;
margin: auto;
bottom: 140px;
height: 100px;
width: 70px;
border-radius: 15px;
background: #303030;
overflow: hidden;
z-index: 1;
&::before {
content: "";
position: absolute;
margin: auto;
bottom: 0;
width: 80px;
height: 5px;
background: #252525;
}
}
.wheel-left {
left: 0;
}
.wheel-right {
right: 0;
}
.car-shadow {
position: absolute;
margin: auto;
top: 120px;
right: 0;
bottom: 0;
left: 0;
height: 50px;
width: 400px;
background: #202020;
z-index: -2;
}
}
.road-container {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 600px;
height: 500px;
overflow: hidden;
.road {
position: absolute;
margin: auto;
top: 230px;
right: 0;
bottom: 0;
height: 10px;
width: 600px;
border-radius: 10px;
background: $road;
z-index: 0;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.