.container
.lane-one
.bb
.base
.rod
.head
.head-base
.head-line
.bb-line-one
.bb-line-one.sub-two
.ball
.line-one
.line-two
.lane-two
.house
.left-bar
.left-one
.left-one-inner
.line-01
.line-02
.line-03
.line-04
.line-05
.line-06
.line
.left-middle
.shadow-line
.sub-line
.window-lane
.window
.window-hor
.window-vert
.middle-lane-top
.middle-house
.house-line-01
.house-line-02
.house-line-03
.house-line-04
.house-line-05
.house-line-06
.house-line-07
.door-bar
.door
.door-handle-left
.door-handle-right
.door-line
.right-middle
.sub-line
.window-lane
.window
.window-hor
.window-vert
.right-bar
.right-one
.left-one-inner
.line-01
.line-02
.line-03
.line-04
.line-05
.line-06
.line
.tree
.tree-branch
.tree-stem
.leaves-one
.leaves-two
.lane-three
View Compiled
$primary-color: #495355;
$ball-color: #F19389;
$bb-base-color: #FBE6D1;
$window: linear-gradient(to right, #0ED2F7, #B2FEFA);
$window-rod: #8E9899;
$brick: #F3938B;
$house: #FBE6D5;
body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
position: relative;
width: 750px;
height: 400px;
margin-top: 8%;
margin-left: auto;
margin-right: auto;
background: #FEF0C3;
border-radius: 10px;
}
.lane-one {
width: 18%;
border: 2px solid $primary-color;
position: absolute;
top: 60%;
left: 5%;
border-radius: 5px;
}
.bb {
width: 30px;
height: 200px;
position: absolute;
top: 40px;
left: 10%;
.base {
width: 20px;
height: 60px;
background: $primary-color;
position: absolute;
top: 70%;
left: 5px;
border-radius: 2px;
}
.rod {
width: 3px;
height: 100px;
background: $primary-color;
position: absolute;
top: 25%;
left: 13px;
}
.head {
width: 50px;
height: 40px;
border: 3px solid $primary-color;
position: absolute;
top: 7px;
left: -11px;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
background: $bb-base-color;
}
}
.head-base {
width: 20px;
height: 20px;
border: 2px solid $primary-color;
position: absolute;
background: $ball-color;
top: 10px;
left: 13px;
border-radius: 5px;
}
.head-line {
width: 30px;
height: 2px;
background: $primary-color;
position: absolute;
top: 20px;
left: 10px;
}
.bb-line-one {
width: 2px;
height: 30px;
background: $primary-color;
position: absolute;
top: 20px;
left: 12px;
transform: rotate(-12deg);
}
.sub-two {
left: 35px;
transform: rotate(12deg);
}
.ball {
width: 30px;
height:30px;
border-radius: 50%;
border: 2px solid $primary-color;
background: $ball-color;
position: absolute;
top: 52%;
left: 95px;
transform: rotate(-15deg);
animation: roll 2s infinite;
.line {
width: 25px;
height: 20px;
border: 1px solid $primary-color;
border-radius: 50%;
border-left: none;
border-right: none;
position: absolute;
}
.line-one {
@extend .line;
border-top: none;
top: -10px;
left: 2px;
}
.line-two {
@extend .line;
top: 20px;
left: 2px;
border-bottom: none;
}
}
.lane-two {
width: 65%;
border: 2px solid $primary-color;
position: absolute;
top: 60%;
left: 25%;
z-index: 22;
border-radius: 5px;
}
.lane-three {
width: 3%;
border: 2px solid $primary-color;
position: absolute;
top: 60%;
right: 35px;
z-index: 22;
border-radius: 5px;
}
.house {
width: 400px;
height: 200px;
// border: 1px solid black;
position: absolute;
top: 40px;
left: 25%;
}
.middle-house {
width: 100px;
height: 150px;
border: 3px solid $primary-color;
position: absolute;
top: 45px;
left: 40%;
background: $brick;
z-index: 20;
.house-lines-vert {
height: 150px;
border: 0.5px solid $primary-color;
position: absolute;
top: 0px;
}
.house-line-01 {
@extend .house-lines-vert;
left: 15px;
}
.house-line-02 {
@extend .house-lines-vert;
right: 15px;
}
.house-lines-hor {
width: 100px;
border: 0.5px solid $primary-color;
position: absolute;
}
.house-line-03{
@extend .house-lines-hor;
top: 20px;
}
.house-line-04 {
@extend .house-lines-hor;
top: 50px;
}
.house-line-05 {
@extend .house-lines-hor;
top: 80px;
}
.house-line-06 {
@extend .house-lines-hor;
top: 110px;
}
.house-line-07 {
@extend .house-lines-hor;
top: 140px;
}
.door-bar {
width: 80px;
height: 5px;
border: 3px solid $primary-color;
border-radius: 10px;
position: absolute;
top: 25px;
left: 6px;
background: white;
}
.door {
width: 65px;
height: 120px;
border: 3px solid $primary-color;
border-top: none;
border-bottom: none;
position: absolute;
top: 35px;
left: 13px;
background: $window;
}
}
.door-line {
height: 115px;
border: 1px solid $primary-color;
position: absolute;
left: 48%;
}
.door-sub-line {
height: 15px;
border: 1px solid $primary-color;
position: absolute;
border-radius: 5px;
top: 40%;
}
.door-handle-left {
@extend .door-sub-line;
left: 24px;
}
.door-handle-right {
@extend .door-sub-line;
right: 25px;
}
.middle-lane-top {
width: 120px;
height: 10px;
border: 3px solid $primary-color;
position: absolute;
top: 32px;
left: 37.5%;
border-radius: 10px;
background: white;
}
@mixin middle-houses($side, $value) {
.#{$side}-middle {
width: 80px;
height: 140px;
border: 3px solid $primary-color;
position: absolute;
top: 30%;
#{$side}: $value;
border-bottom: none;
background: $house;
.shadow-line {
width: 13px;
height: 140px;
background: #B9AFA5;
border-bottom: none;
}
.sub-line {
width: 77px;
height: 15px;
border: 3px solid $primary-color;
border-top: none;
position: absolute;
top: 0px;
background-color: $brick;
}
.window-lane {
width: 60px;
height: 5px;
border: 3px solid $primary-color;
position: absolute;
top: 42px;
left: 7px;
border-radius: 5px;
background: white;
}
.window {
width: 50px;
height: 30px;
border: 3px solid $primary-color;
position: absolute;
top: 50px;
left: 12px;
background: $window;
border-radius: 3px;
.window-hor {
height: 30px;
border: 0.5px solid $primary-color;
position: absolute;
left: 45%;
}
.window-vert {
width: 50px;
border: 0.5px solid $primary-color;
position: absolute;
top: 50%;
}
}
}
}
@include middle-houses(right, 13%);
@include middle-houses(left, 19%);
.left-bar {
width: 75px;
height: 10px;
border: 3px solid $primary-color;
position: absolute;
top: 12px;
left: 5px;
border-radius: 10px;
background: #505A5C;
}
.right-bar {
width: 75px;
height: 10px;
border: 3px solid $primary-color;
position: absolute;
top: 12px;
left: 85%;
border-radius: 10px;
background: #505A5C;
}
@mixin side-house($side,$value) {
.#{$side}-one {
width: 65px;
height: 180px;
border: 3px solid $primary-color;
position: absolute;
top: 18px;
#{$side}: $value;
border-bottom: none;
border-radius: 5px;
z-index: 10;
background: $window-rod;
.left-one-inner {
width: 45px;
height: 180px;
border: 2px solid $primary-color;
border-bottom: none;
border-top: none;
border-radius: 5px;
position: absolute;
background: $window;
left: 7px;
.line {
height: 180px;
border: 0.5px solid $primary-color;
background: black;
position: absolute;
left: 20px;
}
.sub-line {
width: 45px;
border: 0.5px solid black;
position: absolute;
}
.line-01 {
@extend .sub-line;
top: 25px;
}
.line-02 {
@extend .sub-line;
top: 50px;
}
.line-03 {
@extend .sub-line;
top: 75px;
}
.line-04 {
@extend .sub-line;
top: 100px;
}
.line-05 {
@extend .sub-line;
top: 125px;
}
.line-06 {
@extend .sub-line;
top: 150px;
}
}
}
}
@include side-house(right, -17px);
@include side-house(left, 10px);
.tree {
width: 80px;
height: 162px;
position: absolute;
right: 70px;
top: 20%;
}
.tree-stem {
height: 75px;
width: 0px;
border: 2px solid $primary-color;
position: absolute;
top: 50%;
left: 45%;
z-index: 3;
}
.tree-branch {
height: 15px;
width: 0px;
border: 2px solid $primary-color;
position: absolute;
top: 50%;
left: 53%;
transform: rotate(30deg);
z-index: 3;
}
.leaves-one {
width: 60px;
height: 60px;
background-color: #C3DFA4;
border-radius: 50%;
border: 2px solid $primary-color;
position: absolute;
top: 50px;
left: 10px;
}
.leaves-two {
width: 40px;
height: 40px;
background-color: #C3DFA4;
border-radius: 50%;
border: 2px solid $primary-color;
position: absolute;
top: 30px;
left: 20px;
z-index: 10;
border-bottom: none;
}
@keyframes roll {
50% {
transform: rotate(90deg) translateY(-10px);
}
100% {
transform: rotate(90deg);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.