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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                .window
	.windmill
		.pillar
		.dome
			.dome-window
		.windmill-window
		.blades
			- var bladeCount = 4;
			- var i = bladeCount;
			while (i--)
				.blade(class="blade-"+ (bladeCount - i))
		.ramp
			.grill
			- var hookCount = 4;
			- var i = hookCount;
			while (i--)
				.hook(class="hook-"+ (hookCount - i))
	.sun
	.land
	- var grassCount = 2;
	- var i = grassCount;
	while (i--)
		.grass(class="grass-"+ (grassCount - i))
	
              
            
!

CSS

              
                :root {
  --sun-color: #FFBB10;
  --sky-color-1: #FBD788;
  --sky-color-2: #FFEFC0;
  --sky-color-3 : #E8BF62;
  --land-color-1: #62B144;
  --land-color-2: #3D9339;
  --grass-color-1: #37913B;
  --grass-color-2: #8BC435;
  --brick-color-1: #D58256;
  --brick-color-2: #CD7555;
  --wood-color-1: #623B39;
  --wood-color-2: #472A2A;
  --wood-color-3: #2E1D1D;
  --wood-color-4: #000000;
  --window-color-1: #E3E1E1;
  --window-color-2: #000000;
  --window-color-3: #FFFFFF;
  --mill-top-color: #C0C0C0;
  --mill-bottom-color-1: #8F3C31;
  --mill-bottom-color-2: #9C4B3D;
  --dome-color: #FFFFFF;
  --blade-color-1: #FD903D;
  --blade-color-2: #BE684F;
	--window-move-time: 2s;
	--land-slide-time: 2s;
	--blades-spin-time: 6s;
}

@keyframes window-move {
	0% {
		top: 47%;
	}
	100% {
		top: 53%;
	}
}

@keyframes window-bottom-move {
	0% {
		transform: scale(1);
		top: 0px;
	}
	100% {
		transform: scale(1.1);
		top: -10px;
	}
}

@keyframes blades-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@keyframes land-slide {
	0% {
		transform: translateX(-50%) scale(0.95);
	}
	100% {
		transform: translateX(-50%) scale(1.05);
	}
}

body {
	width: 100vw;
  height: 100vh;
	overflow: hidden;
  margin: 0;
}

* {
	position: absolute;
	box-sizing: border-box;
  
  &::before, &::after {
    content: '';
		position: inherit;
		box-sizing: inherit;
  }
}

.window {
  width: 540px;
  height: 540px;
  left: 50%;
  top: 50%;
	transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(1);
  border-radius: 50%;
  background: radial-gradient(farthest-side at 135px 340px, var(--sky-color-2) 135px, transparent 135px), radial-gradient(farthest-side at 405px 300px, var(--sky-color-1) 140px, transparent 135px), linear-gradient(to bottom, var(--sky-color-1) 320px, var(--sky-color-2) 320px);
	animation: window-move var(--window-move-time) ease-in-out infinite alternate;
	
	&::before {
		bottom: 0;
		left: 0;
		top: 0;
		right: 0;
		background: linear-gradient(to bottom, transparent 490px, var(--sky-color-3) 490px, var(--sky-color-3) 510px, var(--sky-color-1) 510px);
		border-radius: 50%;
		animation: window-bottom-move var(--window-move-time) ease-in-out infinite alternate;
	}
}

.land {
  width: 460px;
  height: 40px;
  background: var(--land-color-1);
  bottom: 40px;
  left: 50%;
	transform-origin: 50% 0%;
  transform: translateX(-50%) scale(1);
  border-radius: 20px 20px 5px 5px;
  border-bottom: 5px solid var(--land-color-2);
  z-index: 2;
	animation: land-slide var(--land-slide-time) ease-in-out infinite alternate;
}

.grass {
  background: transparent;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
}

@for $i from 0 to 2 {
  .grass-#{$i + 1} {
    z-index: $i + 1;
    width: #{20 * (3 -$i)}px;
    height: #{10 * (3 -$i)}px;
    border-radius: #{10 * (3 -$i)}px #{10 * (3 -$i)}px 0 0;
  }
}

.grass-1 {
  box-shadow: -90px 0 0 0 var(--grass-color-1), -130px 4px 0 -4px var(--grass-color-1), -165px 8px 0 -8px var(--grass-color-1),90px 0 0 0 var(--grass-color-1), 140px 4px 0 -4px var(--grass-color-1), 165px 8px 0 -8px var(--grass-color-1);
}

.grass-2 {
  box-shadow: -90px 0 0 0 var(--grass-color-2), -60px 2px 0 -2px var(--grass-color-2), -35px 5px 0 -5px var(--grass-color-2),  90px 0 0 0 var(--grass-color-2), 60px 2px 0 -2px var(--grass-color-2), 35px 5px 0 -5px var(--grass-color-2);
}

.windmill {
  width: 180px;
  height: 280px;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  z-index: 2;

  &::before {
    top: 0px;
    background: var(--mill-top-color);
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 30px;
    border-radius: 0 0 20px 20px / 0 0 45px 45px;
  }

  &::after {
    bottom: 0px;
    background: linear-gradient(to bottom, var(--mill-bottom-color-1) 25px, var(--mill-bottom-color-2) 25px, var(--mill-bottom-color-2) 45px, var(--mill-bottom-color-1) 45px);
    width: 100%;
    height: 50px;
  }
}

.windmill-window {
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(0.85, 0.95);
  width: 8px;
  height: 8px;
  background: transparent;
  box-shadow: 5px 25px 0 0 var(--window-color-2), -5px 25px 0 0 var(--window-color-2), 5px 35px 0 0 var(--window-color-2), -5px 35px 0 0 var(--window-color-2), 0 30px 0 5px var(--window-color-1), 0 30px 0 8px var(--window-color-3), 5px -25px 0 0 var(--window-color-2), -5px -25px 0 0 var(--window-color-2), 5px -35px 0 0 var(--window-color-2), -5px -35px 0 0 var(--window-color-2), 0 -30px 0 5px var(--window-color-1), 0 -30px 0 8px var(--window-color-3);
}

.pillar {
  background-image: linear-gradient(335deg, var(--brick-color-2) 6px, transparent 6px), linear-gradient(155deg, var(--brick-color-2) 6px, transparent 6px), linear-gradient(335deg, var(--brick-color-2) 6px, transparent 6px), linear-gradient(155deg, var(--brick-color-2) 6px, transparent 6px);
  background-size: 15px 15px;
  background-position: 0 0, 2px 9px, 7px 8px, 9px 1px;
  background-color: var(--brick-color-1);
  width: 100%;
  height: 200px;
  bottom: 50px;
  clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0 100%);
  box-shadow: inset 0 4px 0 0 var(--wood-color-1);
}

.dome {
  width: 110px;
  height: 65px;
  border-radius: 55px 55px 0 0;
  background: var(--dome-color);
  left: 50%;
  top: -65px;
  transform: translateX(-50%);
}

.dome-window {
  width: 24px;
  height: 26px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(to right, transparent 8px, var(--window-color-1) 8px, var(--window-color-1) 10px, transparent 10px), linear-gradient(to bottom, transparent 9px, var(--window-color-1) 9px, var(--window-color-1) 11px, transparent 11px), var(--window-color-2);
  border: 3px solid var(--window-color-1);
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);

  &::before {
    bottom: -4px;
    width: 32px;
    height: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--window-color-1);
    box-shadow: 0 2px 0 0 var(--wood-color-1);
  }

}

.blades {
  z-index: -1;
  left: 50%;
  top: -30px;
  transform: translate(-50%, -50%) rotate(40deg);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wood-color-3);
	animation: blades-spin var(--blades-spin-time) linear infinite;
}

.blade {
  height: 60px;
  width: 200px;
  background: var(--blade-color-1);
  box-shadow: 0 5px 0 0 var(--blade-color-2), 0 -5px 0 0 var(--blade-color-2);
  transform-origin: -50px 15px;
  top: -5px;
  left: 60px;
  transform: rotate(0deg);

  &::before {
    height: 8px;
    width: 260px;
    border-radius: 5px;
    background: var(--wood-color-2);
    top: 11px;
    left: -55px;
  }

  &::after {
    height: 75px;
    width: 4px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    background: var(--wood-color-1);
    box-shadow: -33px 0 0 0 var(--wood-color-1), -67px 0 0 0 var(--wood-color-1), -100px 0 0 0 var(--wood-color-1), 33px 0 0 0 var(--wood-color-1), 67px 0 0 0 var(--wood-color-1), 100px 0 0 0 var(--wood-color-1);
  }
}

@for $i from 0 to 4 {
  .blade-#{$i + 1} {
    transform: rotate(#{90 * $i}deg);
  }
}

.ramp {
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 35px;
  background: linear-gradient(to bottom, transparent 10px, var(--wood-color-4) 10px, var(--wood-color-4) 15px, transparent 15px), linear-gradient(to right, var(--wood-color-1) 32%, var(--wood-color-2) 32%, var(--wood-color-2) 66%, var(--wood-color-3) 66%);
  z-index: 2;

  &::before {
    height: 5px;
    width: 20px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    box-shadow: -115px 0 0 0 var(--sky-color-2), 115px 0 0 0 var(--sky-color-1);
  }
}

.grill {
  height: 25px;
  width: 6px;
  top: -25px;
  background: transparent;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px 2px 0 0;
  box-shadow: -100px 0 0 0 var(--wood-color-1), -60px 0 0 0 var(--wood-color-1), -20px 0 0 0 var(--wood-color-2), 20px 0 0 0 var(--wood-color-2), 60px 0 0 0 var(--wood-color-3), 100px 0 0 0 var(--wood-color-3);

  &::before {
    width: 240px;
    height: 6px;
    top: 6px;
    background: linear-gradient(to right, var(--wood-color-2) 33%, var(--wood-color-3) 33%, var(--wood-color-3) 66%, var(--wood-color-4) 66%);
    left: 50%;
    transform: translateX(-50%);
  }
}

.hook {
  width: 8px;
  height: 24px;
  bottom: -24px;
  transform-origin: 0 0;

  &::before {
    background: var(--mill-bottom-color-1);
    width: 8px;
    height: 10px;
    bottom: 0;
    transform: skew(-50deg);
  }

  &::after {
    background: inherit;
    width: 8px;
    height: 10px;
    bottom: 0;
  }
}

$hooks: (2, 1, -1, -2);

@each $hook in $hooks {
  $i: index($hooks, $hook);
  .hook-#{$i} {
    background: var(--wood-color-#{$i});
    left : #{(32.5% * ($i - 1)) + $hook};
    transform: skew(#{25 * $hook}deg);

    &::before {
      right: #{-2.5 * $hook}px;
      transform: skew(#{-25 * $hook}deg);
    }
  }
}

.sun {
  right: 0;
  top: 80px;
  width: 140px;
  height: 140px;
  background: var(--sun-color);
  border-radius: 50%;
}

@media (max-width: 800px) {
  .window {
    transform: translate(-50%, -50%) scale(0.75);
  }
}

@media (max-width: 360px) {
  .window {
    transform: translate(-50%, -50%) scale(0.5);
  }
}

@media (min-width: 1920px) {
  .window {
    transform: translate(-50%, -50%) scale(1.25);
  }
}
              
            
!

JS

              
                // Inspired from design - https://dribbble.com/shots/3003860-Windmill
              
            
!
999px

Console