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

              
                <p>Works only in Chrome (with Zoom: 100%) for now! I do not suggest using this in a production environment - it's a preformance nightmare ☺</p>
<div class="ground">
  
  <div class="flag">
    <div class="flag-pattern ch"></div>
		<div class="flag-wave"></div>
  </div>

  <div class="flag rect">
    <div class="flag-pattern fr"></div>
		<div class="flag-wave"></div>
	</div>

  <div class="flag rect">
    <div class="flag-pattern us"></div>
		<div class="flag-wave"></div>
	</div>
  
  <div class="flag rect">
    <div class="flag-pattern pl"></div>
		<div class="flag-wave"></div>
	</div>

  <div class="flag rect">
    <div class="flag-pattern de"></div>
		<div class="flag-wave"></div>
	</div>
 
  <div class="flag rect">
    <div class="flag-pattern ru"></div>
		<div class="flag-wave"></div>
	</div>

  <div class="flag rect">
    <div class="flag-pattern jp"></div>
		<div class="flag-wave"></div>
	</div>
  
</div>
              
            
!

CSS

              
                @colorRed: rgb(200,0,0); 
@colorBlueUs: rgb(63, 60, 110);
@colorBlue: rgb(0, 49, 156);
@flagSize: 120px;

body {
  font-size: 16px;
  line-height: 26px;
  font-family: Helvetica, 'Helvetica Neue' ,Arial;
}
p {
  color: #bbb;
}

.ground {
    background-image: 
linear-gradient( white 50%, #eee);
 padding-bottom: 20px;
}

.flag {
  position: relative;
  display: inline-block;
  margin: 2em 3em @flagSize;
	width: @flagSize;
	height: @flagSize;
	border: 1px solid #bbb;
  	border-left-color: white;
  box-sizing: border-box;
	box-shadow: 2px 5px 14px 0px rgba(0,0,0,0.4);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000;
  -webkit-transform-style: preserve3d;
  -webkit-transform-origin: 0 250px;
  -webkit-transform: translate3d(0, 0, 0) rotateZ(5deg) rotateY(-22deg);

	-webkit-animation-name: wave;
	-webkit-animation-duration: 8s;
	-webkit-animation-timing-function: cubic-bezier(.16,.14,.82,.73);
  	-webkit-animation-timing-function: linear;
	-webkit-animation-iteration-count: infinite;
  
  &:nth-child(odd) {
   -webkit-animation-delay: 1s;
  }
  
  &:before {
  position: absolute;
  content: "";
   height: @flagSize*2;
  left: -5px;
  top: -3px;
  width: 6px;
  border-right: 1px solid white;
  border-radius: 3px;
  background-color: #444;
  box-shadow: -3px 3px 8px 0px rgba(0,0,0,0.4);
}
  
  &.rect {
  	width: @flagSize*1.4;
  
  }  
}

.flag-pattern {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;  
    -webkit-box-reflect: below 60px -webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(70%,transparent),to(rgba(255,255,255,0.05)));
  
    &.ch {
      border: 15px solid @colorRed;
      background-color: @colorRed;
background-image: 
linear-gradient(90deg, white 50%, transparent 50%),
linear-gradient(white 50%, transparent 50%);
      background-size: @flagSize/2 @flagSize/2;
      background-position: 100% 100%;
  }
  
  &.fr {
     background-color: @colorRed;
    background-image: 
linear-gradient( 90deg, @colorBlue 33.3%, transparent 33.3%),
linear-gradient(90deg, white 66.6%, transparent 66.6%);
  }
  
 	&.us {
		background-color: @colorRed;
		background-image: linear-gradient(@colorRed 50%, white 50%);
		background-size: 100% 15.38%;
		background-repeat: repeat-y;


		&:before, &:after {
			position: absolute;
			max-width: 52%;
			overflow: hidden;
			word-break: break-word;
			text-align: center;
			font-size: 7px;
			color: white;
			line-height: 1.9em;
			letter-spacing: 1em;
		}
		&:before {
			content: "\2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 ";
			background-color: @colorBlueUs;
			border-left: 3px solid @colorBlueUs;
		}

		&:after {
			content: "\2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 \2605 ";
			box-sizing: border-box;
			margin-left: 3px;
			padding: .9em 1em;
		}
	}
    
  &.pl {
     background-color: @colorRed;
    background-image: 
linear-gradient( white 50%, transparent 50%);
  }
  
  &.de {
     background-color: gold;
    background-image: 
linear-gradient( black 33.3%, transparent 33.3%),
linear-gradient(red 66.6%, transparent 66.6%);
  }
  
    &.ru {
     background-color: red;
    background-image: 
linear-gradient( blue 33.3%, transparent 33.3%),
linear-gradient(white 66.6%, transparent 66.6%);
  }
  
    &.jp {
     background-color: white;
    background-image: 
radial-gradient(circle, @colorRed 40%, transparent 0);

  }
}

.flag-wave {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;

	background-image:
		-webkit-gradient(
			linear,
			0 -25%,
			100% top,
			color-stop(0%,rgba(255,255,255,0)),
			color-stop(20%,rgba(255,255,255,0)),
      color-stop(30%,rgba(0,0,0,.04)),
			color-stop(40%,rgba(255,255,255,.2)),
      color-stop(60%,rgba(255,255,255,0)),
    	color-stop(65%,rgba(255,255,255,.2)),
			color-stop(80%,rgba(0,0,0,.05)),
			color-stop(100%,rgba(255,255,255,0)));

	background-size: 200%;
  
	-webkit-animation-name: flutter;
	-webkit-animation-duration: 8s;
	-webkit-animation-timing-function: cubic-bezier(.16,.14,.82,.73);
	-webkit-animation-iteration-count: infinite;
}


@-webkit-keyframes flutter {

	0% {
		background-position: -200% 0px;
	}

  30% {
		background-position: -60% 5px;
	}
  
   70% {
		background-position: 70% -5px;
	}
  
	100% {
		background-position: 200% 0px;
	}
}

@-webkit-keyframes wave {

	0% {
		box-shadow: 4px 5px 5px 0 rgba(0,0,0,0.1);
        -webkit-transform: translate3d(0, 0, 0) rotateZ(5deg) rotateY(22deg);

	}

	20% {
		box-shadow: 4px 5px 15px 0 rgba(0,0,0,0.1);
     -webkit-transform: translate3d(0, 0, 0) rotateZ(5deg) rotateY(0deg);
	}

  40% {
		box-shadow: 4px 5px 20px 0 rgba(0,0,0,0.4);
   -webkit-transform: translate3d(0, 0, 0) rotateZ(6deg) rotateY(-22deg);
	}
  
  	60% {
		box-shadow: 4px 5px 5px 0 rgba(0,0,0,0.1);
     -webkit-transform: translate3d(0, 0, 0) rotateZ(5deg) rotateY(0deg);
	}

  80% {
		box-shadow: 4px 5px 5px 0 rgba(0,0,0,0.3);
   -webkit-transform: translate3d(0, 0, 0) rotateZ(5deg) rotateY(16deg);
	}
  
	100% {
		box-shadow: 4px 5px 5px 0 rgba(0,0,0,0.1);
   -webkit-transform: translate3d(0, 0, 0) rotateZ(5deg) rotateY(22deg);
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console