Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                // My blog: https://albertwalicki.com

// Inspiration https://www.freepik.com/free-vector/flat-design-house-illustration-set_9857282.htm

div.wrapper
  div.roof
     div.roofShadow1
     div.roofShadow2
     div.roofPatch1
     div.roofPatch2
     div.roofPatch3
     div.roofPatch4
     div.roofPatch5
     div.roofPatch6
     div.roofInner
  div.building
    div.topPart
      div.window1
    div.bottomPart
      div.path
      div.leftPart
        div.windowsMiddle
          div.window1
          div.window2
      div.rightPart
        div.door
        div.windowsBottom
          div.window1
          div.window2
  div.grass
    div.tree
      div.treeBody
        div.treeTop
        div.treeMiddle
        div.treeBottom
      div.treeTrunk
  div.road
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

$size: 1vmin;
$size00675: calc(0.0675 * #{$size});
$size0125: calc(0.125 * #{$size});
$size025: calc(0.25 * #{$size});
$size05: calc(0.5 * #{$size});
$size075: calc(0.75 * #{$size});
$size15: calc(1.5 * #{$size});
$size2: calc(2 * #{$size});
$size3: calc(3 * #{$size});
$size4: calc(4 * #{$size});
$size5: calc(5 * #{$size});

$road: #575757;
$sky: #cbe0f4;
$grass: #859e53;
$grassDark: #6a8344;
$frame: #fff;
$building1: #edebe7;
$building2: #d9d7d6;
$building3: #b6b6b6;
$foundation: #7d7874;
$door: #4f4132;
$doorKnob: #d7d8d5;
$doorLight: #5d4f40;
$brown: #aa5e51;
$darkBrown: #8f554b;
$window: #51a8c2;
$windowDark: #1e3e48;
$windowLight: rgba(255, 255, 255, 0.15);
$roofShadow: #8f5549;

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100vh;
  width: 100%;
  background: $sky;
}

.road {
  height: $size4;
  width: 100%;
  background: $road;
}
.grass {
  height: $size2;
  width: 100%;
  background: $grass;
}

.building {
  width: calc(#{$size} * 29);
  height: calc(#{$size} * 32.5);
  border-left: $size15 solid $frame;
  border-right: $size15 solid $frame;
  background: $frame;
  position: relative;
}

.roof {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 calc(14.5 * #{$size}) calc(12 * #{$size})
    calc(14.5 * #{$size});
  border-color: transparent transparent $frame transparent;
  position: relative;
}

.roofInner {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 calc(13 * #{$size}) calc(11 * #{$size}) calc(13 * #{$size});
  border-color: transparent transparent transparent transparent;
  position: absolute;
  top: $size2;
  left: 0;
  transform: translateX(-50%);
}

.roofPatch1 {
  width: $size2;
  height: $size;
  background: $frame;
  position: absolute;
  left: calc(-13.5 * #{$size});
  top: calc(12 * #{$size});
}

.roofPatch2 {
  width: $size2;
  height: $size;
  background: $frame;
  position: absolute;
  right: calc(-13.5 * #{$size});
  top: calc(12 * #{$size});
}

.roofPatch3 {
  width: $size;
  height: $size3;
  background: $frame;
  position: absolute;
  left: calc(-14.05 * #{$size});
  top: calc(13 * #{$size});
  z-index: 6;
}

.roofPatch4 {
  width: $size;
  height: $size3;
  background: $frame;
  position: absolute;
  right: calc(-14.05 * #{$size});
  top: calc(13 * #{$size});
  z-index: 6;
}
.roofPatch5 {
  width: $size;
  height: $size3;
  background: $frame;
  position: absolute;
  z-index: 7;
  top: $size;
  left: calc(0.5 * #{$size});
  transform: rotate(-51deg);
}

.roofPatch6 {
  width: $size;
  height: $size3;
  background: $frame;
  position: absolute;
  z-index: 7;
  top: $size;
  left: calc(-1.7 * #{$size});
  transform: rotate(51deg);
}

.roofShadow1 {
  background: $roofShadow;
  height: calc(1.5 * #{$size});
  width: calc(18.5 * #{$size});
  transform: rotate(140deg);
  position: absolute;
  top: calc(7.9 * #{$size});
  left: calc(-15.7 * #{$size});
  z-index: 5;
}
.roofShadow2 {
  background: $roofShadow;
  height: calc(1.5 * #{$size});
  width: calc(18.5 * #{$size});
  transform: rotate(-140deg);
  position: absolute;
  top: calc(7.9 * #{$size});
  right: calc(-15.7 * #{$size});
  z-index: 5;
}

.topPart {
  width: 100%;
  height: calc(21.5 * #{$size});
  background-image: linear-gradient(
    0deg,
    #af6356 4.55%,
    #aa5e51 4.55%,
    #aa5e51 50%,
    #af6356 50%,
    #af6356 54.55%,
    #aa5e51 54.55%,
    #aa5e51 100%
  );
  background-size: $size5 $size5;
  position: absolute;
  top: -8vmin;
  clip-path: polygon(50% 0, 50% 0, 100% 50%, 100% 100%, 0 100%, 0% 50%);
  .window1 {
    position: absolute;
    top: calc(9 * #{$size});
    left: calc(4.5 * #{$size});
    width: calc(4.4 * #{$size});
    height: calc(9.5 * #{$size});
    border: calc(0.4 * #{$size}) solid $frame;
    background: linear-gradient(
      180deg,
      $window 50%,
      $window 50%,
      $windowDark 50%
    );
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      background: linear-gradient(
        -64deg,
        transparent 20%,
        $windowLight 20%,
        $windowLight 26%,
        transparent 26%,
        transparent 60%,
        $windowLight 60%,
        $windowLight 66%,
        transparent 66%
      );
      position: absolute;
    }
  }
}

.bottomPart {
  width: 100%;
  height: calc(19 * #{$size});
  background: pink;
  position: relative;
  top: 13.5vmin;
  display: flex;
}

.leftPart {
  width: 50%;
  height: 100%;
  background: $building1;
  border-bottom: $size2 solid $foundation;
}

.rightPart {
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    $building3 0vmin,
    $building3 calc(2.5 * #{$size}),
    $building2 calc(2.5 * #{$size})
  );
}

.door {
  width: calc(5.5 * #{$size});
  height: calc(12 * #{$size});
  background: $door;
  position: absolute;
  bottom: 0;
  right: calc(5.7 * #{$size});
  &:before {
    content: "";
    position: absolute;
    top: $size;
    bottom: $size;
    left: $size;
    right: $size;
    border: $size00675 solid $doorLight;
  }
  &:after {
    content: "";
    position: absolute;
    top: calc(4.5 * #{$size});
    right: calc(0.8 * #{$size});
    width: calc(0.4 * #{$size});
    height: calc(3.5 * #{$size});
    background: $doorKnob;
  }
}

.windowsBottom {
  width: calc(4.8 * #{$size});
  height: calc(12 * #{$size});
  background: $frame;
  position: absolute;
  bottom: 0;
  right: calc(1 * #{$size});
  .window1 {
    height: calc(5.4 * #{$size});
    width: calc(4 * #{$size});
    background: $window;
    position: relative;
    top: calc(0.4 * #{$size});
    left: calc(0.4 * #{$size});
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      background: linear-gradient(
        -64deg,
        $window 10%,
        $windowLight 10%,
        $windowLight 16%,
        $window 16%,
        $window 70%,
        $windowLight 70%,
        $windowLight 76%,
        $window 76%
      );
      position: absolute;
    }
  }
  .window2 {
    height: calc(5.6 * #{$size});
    width: calc(4 * #{$size});
    background: $windowDark;
    position: relative;
    top: calc(1 * #{$size});
    left: calc(0.4 * #{$size});
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      background: linear-gradient(
        -64deg,
        $windowDark 50%,
        $windowLight 50%,
        $windowLight 56%,
        $windowDark 56%
      );
      position: absolute;
    }
  }
}

.windowsMiddle {
  left: 0;
  top: 0;
  width: calc(10 * #{$size});
  height: calc(4.5 * #{$size});
  background: $frame;
  .window1 {
    position: relative;
    top: calc(0.4 * #{$size});
    left: calc(0.4 * #{$size});
    width: calc(3.3 * #{$size});
    height: calc(3.7 * #{$size});
    background: linear-gradient(
      180deg,
      $window 50%,
      $window 50%,
      $windowDark 50%
    );
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      background: linear-gradient(
        -64deg,
        transparent 50%,
        $windowLight 50%,
        $windowLight 58%,
        transparent 58%
      );
      position: absolute;
    }
  }
  .window2 {
    position: absolute;
    top: calc(0.4 * #{$size});
    left: calc(4.2 * #{$size});
    width: calc(5.3 * #{$size});
    height: calc(3.7 * #{$size});
    background: linear-gradient(
      180deg,
      $window 50%,
      $window 50%,
      $windowDark 50%
    );
    &:before {
      content: "";
      width: 100%;
      height: 100%;
      background: linear-gradient(
        -64deg,
        transparent 30%,
        $windowLight 30%,
        $windowLight 36%,
        transparent 36%,
        transparent 80%,
        $windowLight 80%,
        $windowLight 86%,
        transparent 86%
      );
      position: absolute;
    }
  }
}

.path {
   width: calc(5.5 * #{$size});
  height: calc(2 * #{$size});
  position: absolute;
  right: calc(5.7 * #{$size});
  bottom:  calc(-2 * #{$size});
  background: $road;
  z-index: 6;
}

.tree {
  --width: 20vmin;
  --margin: 0 12vmin;
  --trunk: #523b36;
  --green1: #1a4b27;
  --green2: #26713b;
  --green3: #32994e;

  height: calc(var(--width) * 1.666);
  width: var(--width);
  position: absolute;
  bottom:calc(#{$size} * 6);
  left: calc(50% + 12vmin);
  margin: var(--margin);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.treeBody {
      display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.treeTrunk {
      height: calc(var(--width)/3);
    width: calc(var(--width)/7.5);
    background-color: var(--trunk);
}

.treeTop {
      position: absolute;
    width: calc(var(--width)/1.2);
    height: calc(var(--width)/1.2);
    bottom: calc(var(--width)/4);
    border-radius: 50%;
  left: calc(var(--width)/1.2/3);
    background: var(--green1);
    z-index: 5;
}

.treeMiddle {
      position: absolute;
    width: calc(var(--width)/1.2);
    height: calc(var(--width)/1.2);
    bottom: calc(var(--width)/4);
    border-radius: 50%;
  right: calc(var(--width)/1.2/3);
    background: var(--green2);
    z-index: 4;
}

.treeBottom {
         position: absolute;
    width: calc(var(--width)/1.2);
    height: calc(var(--width)/1.2);
    bottom: calc(var(--width)/1.5);
    border-radius: 50%;
    background: var(--green3);
    z-index: 3;
}

              
            
!

JS

              
                
              
            
!
999px

Console