Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                div.main
    div.house
        div.floor
        div.wall
            div.window
            div.door
                div.door__square
                div.door__line
                div.door__square
            div.window

        div.top
        div.circle
        div.plastic
            div.plastic__g
                - var n = 0;
                    while n < 9
                        div(class='plastic__item')
                        - n++
    
        div.line 
            - var n = 0;
                while n < 9
                    div(class='line__item')
                    - n++
    
    div.clouds 
        div.cloud
            div.cloud__item
            div.cloud__item
        div.cloud
            div.cloud__item
            div.cloud__item
        div.cloud
            div.cloud__item
            div.cloud__item
        div.bird
        
    div.birds
        div.bird
        div.bird

    div.tree
        div.tree__item 
        div.tree__item 
        div.tree__item 
    
    div.bush
        div.bush__item
        div.bush__item
        
    div.dot
        
              
            
!

CSS

              
                /* Variables */
$border: 4px solid #314b70;
$blue: #314b70;
$red: #f9aabe;
$white: #fffdff;
$wall: #c3e0e7;

$floor-1: #e1f6fd;
$floor-2: #e0f5fc;
$floor-3: #aac4d0;

$door-1: #ffe0ad;
$door-2: #ffc26b;
$door-3: #ffad61;

$line-1: #66c8fa;
$line-2: #00affa;

$tree-1: #77e4c6;
$tree-2: #00d398;

/* Reset */
*, *::after, *::before {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
/* Generic */
body{
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: $white;
}
.main{
    width: 800px;
    height: 600px;
    position: relative;
    @media (max-width: 768px) { transform: scale(.7); }
    @media (max-width: 640px) { transform: scale(.5); }
}
.house{
    width: 400px;
    height: 300px;
    display: flex;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;

    transform: translateX(-50%) translateY(-13%);
    position: relative;
    perspective: 200px;
}
    .floor{
        display: flex;
        justify-content: center;
        position: absolute;
        bottom: 0;
        width: 95%;
        height: 30px;

        border: $border;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
        background-color: $floor-1;
        box-shadow: inset 4px 4px 0 $white;

        &::before,
        &::after{
            content: '';
            position: absolute;
            bottom: 0;
            width: 32%;
            height: 60%;

            border-left: $border;
            border-right: $border;
            border-top: $border;
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
            background-image: linear-gradient(to bottom, $floor-2 50%, $floor-3 50%);
            box-shadow: 4px 0 0 $floor-3;
        }
        &::after{
            top: 0;
            width: 25%;
            height: 40%;
            border-top-left-radius: 0;
            border-top-right-radius: 0;
            border-top: none;
        }
    }
    .wall{
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        position: absolute;
        bottom: 30px;
        width: 91%;
        height: 175px;

        background: $wall;
        border-left: $border;
        border-right: $border;
        overflow: hidden;
    }
        .window{
            position: relative;
            width: 34%;
            height: 125px;

            border-top: $border;
            border-right: $border;
            border-bottom: none;
            border-left: none;
            border-top-right-radius: 8px;
            background: $floor-3;
            box-shadow: inset 0 4px 2px $floor-2;

            &::before{
                content: '';
                position: absolute;
                width: 94%;
                height: 88%;
                top: 6%;
                left: 0;

                border-top-right-radius: 4px;
                border-bottom-right-radius: 4px;
                border-top: $border;
                border-right: $border;
                border-bottom: $border;
                border-left: none;
                background-image:
                    linear-gradient(
                    to top,
                    lighten($blue, 65) 47%,
                    lighten($blue, 40) 47%,
                    lighten($blue, 40) 50%,
                    lighten($blue, 65) 50%,
                    );
            }
            &::after{
                content: '';
                position: absolute;
                height: 40px;
                width: 30px;
                top: 19%;
                left: 20%;

                background-color: $red;
                border: 4px solid lighten($blue, 40);
            }
            &:nth-of-type(3){
                transform: rotateZ(180deg);
                border-top: none;
                border-right: $border;
                border-bottom: $border;
                border-left: none;
                border-bottom-right-radius: 8px;
                border-top-right-radius: 0;
                box-shadow: inset 0 -4px 2px $floor-2;
                &::after{ content: none;}
            }
        }
        .door{
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            align-items: flex-start;
            width: 20%;
            height: 130px;
            padding-left: 8px;
            border: $border;
            border-bottom: none;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
            background-color: $door-2;
            box-shadow:
                inset 3px 3px $door-1,
                inset -10px -8px $door-3,
                4px 0 $floor-3
                ;
            &__square{
                width: 85%;
                height: 47px;
                border-radius: 4px;
                border: $border;
                box-shadow: inset 3px 3px $door-1;
            }
            &__line{
                width: 25%;
                height: 4px;
                background: $blue;
                border-radius: 4px;
            }
        }
    .top{
        position: absolute;
        width: 82%;
        height: 30px;

        border: $border;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
        background-color: $floor-3;
        box-shadow: inset 4px 4px 0 $floor-1;
    }
    .circle{
        content: '';
        position: absolute;
        top: -10%;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 115px;
        height: 115px;

        border: $border;
        border-radius: 50%;
        background-color: $floor-2;
        box-shadow:
            inset 4px 4px 0 $white,
            inset 4px -4px 0 $white,
            inset -4px 4px 0 $white,
            inset -4px -4px 0 $white
        ;
        &::before,
        &::after{
            content: '';
            position: absolute;
            top: 35%;
            width: 70%;
            height: 4px;
            background-color: $blue;
        }
        &::after{
            width: 35%;
            top: 20%;
        }
    }
    .plastic{
        position: absolute;
        z-index: 100;
        top: 30%;
        width: 100%;
        height: 30px;
        overflow: hidden;

        &__g{
            display: flex;
            justify-content: center;
            width: 100%;
            overflow: hidden;
            transform: translateY(-22px);
        }
        &__item{
            border-radius: 50%;
            width: 43px;
            height: 43px;
            border: 3px solid $blue;
            box-shadow: 0 4px 0px $floor-3;
            margin-bottom: 4px;

            &:nth-child(odd){
                background: darken($line-1, 25);
                box-shadow: 0 4px 0px $floor-3, inset 4px 4px 0 $line-1;
            }
            &:nth-child(even){ background: $white;}
            &:nth-of-type(1),
            &:nth-last-of-type(1){
                box-shadow: none;
                box-shadow: inset 4px 4px 0 $line-1;
                width: 45px;
                height: 45px;
            }
            &:nth-of-type(5){
                width: 45px;
                height: 45px;
            }
        }
    }
    .line{
        display: flex;
        position: absolute;
        top: 15px;
        width: 90%;
        height: 85px;

        transform-style: preserve-3d;
        transform: rotateX(25deg);
        border-left: $border;
        border-right: $border;
        border-bottom: $border;
        background-color: $floor-1;
        border-radius: 4px;

        &__item{
            height: 100%;
            flex-grow: 1;
            border-right: $border;

            &:nth-child(odd){
                background: $line-2;
                box-shadow: inset 4px 4px 0 $line-1;
            }
            &:nth-child(even){background: $white;}
            &:nth-last-of-type(1){border-right: none;}
            &:nth-child(4),
            &:nth-child(5),
            &:nth-child(6){ border-top: 6px solid $blue; }
        }
    }
.tree{
    display: flex;
    justify-content: center;
    position: absolute;
    left: 10%;
    bottom: 19%;
    width: 100px;
    height: 165px;

    border-radius: 50px;
    border: $border;
    background-color: $tree-2;
    box-shadow: inset 4px 0 0px $tree-1,inset -4px 0 0px darken($tree-2, 10);
    transform-origin: 0% 100% ;
    animation: tree 1s linear alternate infinite ;

    &__item{
        position: absolute;
        bottom: -80px;
        width: 4px;
        height: 140px;
        background: $blue;

        &:nth-of-type(2){
            bottom: 80px;
            height: 40px;
            box-shadow: 0 0 0 8px $tree-1;
            border-radius: 20px;

            &:before{
                content: '';
                position: absolute;
                bottom: -45px;
                left: -30px;
                width: 20px;
                height: 35px;
                border-radius: 15px;
                background-color: $tree-1;
            }
        }
        &:nth-of-type(3){
            bottom: 20px;
            left: 36%;
            width: 4px;
            height: 30px;
            background-color: $blue;
            transform: rotateZ(-45deg);
        }
    }
}
.dot{
    position: absolute;
    bottom: 38px;
    width: 100%;
    height: 4px;
    background-image: linear-gradient(
        to right,
        $blue 10% ,
        transparent 10%,
        transparent 11%,
        $blue 11%,
        $blue 85%,
        transparent 85%,
        transparent 86%,
        $blue 86%
    )
    ;
}
.bush__item{
    position: absolute;
    left: 18%;
    bottom: 40px;
    width: 80px;
    height: 60px;
    border: 1px solid red;
    border-top-left-radius: 50px;
    border-top-right-radius: 100px;
    border: $border;
    border-bottom: none;
    background-color: $tree-2;
    box-shadow: inset 4px 0 0px $tree-1, inset -4px 0 0px darken($tree-2, 10);

    transform-origin:  bottom center;
    animation: bush 2s alternate infinite;
    &:nth-of-type(2){
        left: 13%;
        width: 50px;
        height: 40px;
        border-top-left-radius: 50px;
        border-top-right-radius: 10px;
        animation: tree 2s alternate reverse infinite .5s;
    }
    &::before{
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        background: $tree-1;
        border-radius: 50%;
        top: 10px;
        left: 10px;
    }
}
.cloud{
    position: absolute;
    top: 200px;
    left: 60px;
    display: flex;
    justify-content: center;
    width: 85px;
    height: 20px;
    border-bottom: 4px solid lighten($blue, 60);
    animation: cloud 4s infinite alternate;

    &:nth-of-type(2){
        left: 50%;
        top: 150px;
        animation: cloud 4s infinite reverse alternate .5s;
    }
    &:nth-of-type(3){
        left: 80%;
        top: 250px;
        animation: cloud 4s ease infinite alternate .75s;
    }
    &__item{
        position: relative;
        border-radius: 50%;
        border-top: 20px solid lighten($blue, 60);
        border-left: 20px solid lighten($blue, 60);
        border-bottom: 20px solid transparent;
        border-right: 20px solid transparent;
        transform: rotateZ(45deg);
        &:nth-of-type(2){
            margin-left: -7px;
            margin-top: 5px;
            border-top: 15px solid lighten($blue, 60);
            border-left: 15px solid lighten($blue, 60);
            border-bottom: 15px solid transparent;
            border-right: 15px solid transparent;
        }
    }
}
.bird{
    position: absolute;
    bottom: 40%;
    right: 10%;
    width: 20px;
    height: 20px;
    border-top: 4px solid lighten($blue, 50);
    border-left: 4px solid lighten($blue, 50);
    transform: rotateZ(-135deg);
    z-index: -1;

    animation: bird 1s ease alternate infinite;
    &:nth-of-type(2){
        right: 20%;
        bottom: 30%;
        width: 15px;
        height: 15px;
    }
}
/**/
@keyframes bird {
    0%{ transform: scaleY(.7) rotateZ(-135deg) translateX(0) translateY(0) skew(-10deg,-10deg );}
    100%{ transform: scaleY(1) rotateZ(-135deg) translateX(50%) translateY(50%) skew(-10deg,-10deg );}
}
@keyframes tree {
    0%{ transform: scaleY(1);}
    100%{transform: scaleY(.975);}
}
@keyframes bush {
    0%{ transform: skewX(-2deg);}
    100%{transform: skewX(5deg);}
}
@keyframes cloud {
    0%{ transform: translateX(-10%);}
    100%{ transform: translateX(20%);}
}

              
            
!

JS

              
                /*
	Dseigned by: Alex Kunchevsky
	Original Image: https://dribbble.com/shots/7105929-Shop
*/
              
            
!
999px

Console