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

              
                <figure class="resize-box">
  <div class="webcam"></div>
	<div class="device-border">
		<div class="screen-mask">
			<svg class="resizable" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px"
			y="0px" width="506px" height="371.849px" viewBox="0 0 506 371.849">
				<g class="body">
					<rect class="nav-dark" fill="#0079C2" width="26.5%" height="29.021" viewBox="0 0 506 371.849"/>
					<rect class="nav-light" x="143" fill="#00AAFF" width="72%" height="29.021"/>
					<rect class="hero" y="40" fill="#00AAFF" width="364" height="124.011"/>
					<rect class="project proj-3" x="248.477" y="175.011" fill="#00AAFF" width="115.523" height="105"/>
					<rect class="caption" y="290.011" fill="#00AAFF" width="364" height="49"/>
					<rect class="etc" y="351.24" fill="#00AAFF" width="364" height="20.608"/>
					<rect class="project proj-2" x="123.989" y="175.011" fill="#00AAFF" width="115.523" height="105"/>
					<rect class="project proj-1" y="175.011" fill="#00AAFF" width="115.523" height="105"/>
				</g>
				<rect class="sidebar side-1" x="374" y="40" fill="#C4C4C4" width="132" height="124.011"/>
				<rect class="sidebar side-2" x="374" y="174.011" fill="#C4C4C4" width="132" height="56"/>
				<rect class="sidebar side-3" x="374" y="241.011" fill="#C4C4C4" width="132" height="130.838"/>
			</svg>
		</div>
	</div>
</figure>
              
            
!

CSS

              
                @import "compass/css3";

// MIXINS

@mixin keyframes($name) {
	@-o-keyframes #{$name} { @content };
	@-moz-keyframes #{$name} { @content };
	@-webkit-keyframes #{$name} { @content }; 
	@keyframes #{$name} { @content };
}

//called hero-animation because it's specific to a hero-image of a website I'm working on:
@mixin hero-animation($animation) {
	-o-animation: $animation 12s infinite alternate backwards ease-in-out;
	-moz-animation: $animation 12s infinite alternate backwards ease-in-out;
	-webkit-animation: $animation 12s infinite alternate backwards ease-in-out;
	animation: $animation 12s infinite alternate backwards ease-in-out;
}

@mixin prefixer ($property, $value,
				 $moz:    true,
				 $webkit: true,
				 $o:      false,
				 $ms:     true,
				 $spec:   true) {
	@if $moz    {    -moz-#{$property}: $value; }
	@if $webkit { -webkit-#{$property}: $value; }
	@if $o      {      -o-#{$property}: $value; }
	@if $ms     {     -ms-#{$property}: $value; }
	@if $spec   {         #{$property}: $value; }
}


// ANIMATION LOOP
$things-animating: device-border, resizable, nav-dark, nav-light, sidebar, body, hero, proj-1, proj-2, proj-3, caption, webcam;

@each $class in $things-animating {
		.#{$class} {
			@include hero-animation($class);
		}
}


//OTHER CSS

body {
  background-color: #ffaa72;
}

.resize-box {
	height: 371px;
	width: 700px;
  margin: 30px auto;
}

.device-border {
	border-radius: 10px;
	border: 30px solid black;
	display: block;
	height: 100%;
	margin: 0 auto;
	width: 100%;
  background: white;
}

.resizable {
	@include prefixer(transform-origin, 50% 0%);
	display: block;
	margin: 5px auto -2px;
	width: 500px;
}

.screen-mask {
	display: block;
	height: 100%;
	margin: 0 auto;
	overflow: hidden;
	width: 100%;
}

.nav-light {
	@include prefixer(transform-origin, 0% 0%);
}

.webcam {
  background: #0079c2;
  border-radius: 50%;
  display: block;
  height: 5px;
  margin: 10px auto -20px;
  position: relative;
  width: 5px;
}


// ANIMATIONS

@include keyframes(device-border) {
	0% {
		height: 100%;
		width: 100%;
	}
	20% {
		width: 72%;
	}
	65% {
		border: 15px solid black;
		border-bottom: 30px solid black;
		border-radius: 10px;
		border-top: 30px solid black;
		height: 85%;
		width: 36.5%;
	}
	100% {
		border: 10px solid black;
		border-bottom: 30px solid black;
		border-radius: 5px;
		border-top: 25px solid black;
		height: 50%;
		width: 15%;
	}
}

@include keyframes(resizable) {
	0% {
		margin: 5px auto -2px;
		width: 500px;
	}
	20% {
		width: 95%;
	}
	35% {
		width: 500px;
	}
	65% {
		width: 500px;
	}
}

@include keyframes(nav-dark) {
	0%   {
		@include transform(scaleX(1));
	}
	25% {
		@include transform(scaleX(1));
	}
	30% {
		 @include transform(scaleX(0.6));
	}
	65%   {
	 @include transform(scaleX(0.4));
	}
	100%   {
		@include transform(scaleX(0.28));
	}
}

@include keyframes(nav-light) {
	0%   {
		@include transform(translateX(0px) scaleX(1));
	}
	25% {
		@include transform(translateX(0px) scaleX(1));
	}
	30% {
		 @include transform(translateX(-50px) scaleX(.75));
	}
	65%   {
	 @include transform(translateX(-83px) scaleX(.48));
	}
	100%   {
		@include transform(translateX(-100px) scaleX(.18));
	}
}

@include keyframes(sidebar) {
	0%   {
		opacity: 1;
	}
	25% {
		opacity: 1;
	}  
	30% {
		opacity: 0;
	}
}

@include keyframes(body) {
	0%   {
		 @include transform(translateX(0));
	}
	25% {
		 @include transform(translateX(0));
	}  
	30% {
		@include transform(translateX(8%));
	}
	65% {
		@include transform(translateX(2%));
	}
}

@include keyframes(hero) {
	0%   {
		@include transform(scaleX(1));
	}
	25% {
		@include transform(scaleX(1));
	}
	30% {
		 @include transform(scaleX(1));
	}
	65%   {
	 @include transform(scaleX(0.65) translateY(0) scaleY(1));
	}
	100%   {
		@include transform(scaleX(0.3) translateY(3px) scaleY(0.8));
	}
}


@include keyframes(proj-1) {
	0%   {
		@include transform(scaleX(1));
	}
	25% {
		@include transform(scaleX(1));
	}
	30% {
		 @include transform(scaleX(1));
	}
	65%   {
	 @include transform(scaleX(0.65) translateY(0px));
	}
	75% {
	 @include transform(scaleX(0.85) translateY(-10px));
	}
	90% {
		@include transform(scaleX(0.58) translateY(-25px));
	}
	100%   {
		@include transform(scaleX(1.2) translateY(-35px));
	}
}

@include keyframes(proj-2) {
	0%   {
		@include transform(scaleX(1));
	}
	25% {
		@include transform(scaleX(1));
	}
	30% {
		 @include transform(scaleX(1));
	}
	65%   {
	 @include transform(scaleX(0.65) translateY(0px));
	}
	75% {
	 @include transform(scaleX(0.85) translateY(-10px));
		opacity: 1;
	}
	90% {
		opacity: 1;
		@include transform(scaleX(0.58) translateY(-25px));
	}
	93% {
		opacity: 0;
		@include transform(scaleX(0.6) translateY(-30px));
	}
	100%   {
		opacity: 1;
		@include transform(scaleX(1.2) translateY(-35px));
	}
}

@include keyframes(proj-3) {
	0%   {
		@include transform(scaleX(1));
	}
	25% {
		@include transform(scaleX(1));
	}
	30% {
		 @include transform(scaleX(1));
	}
	65%   {
	 @include transform(scaleX(0.65) scaleY(1));
		opacity: 1;
	}
	75% {
		opacity: 0;
	 @include transform(scaleX(1) scaleY(1));
	}
	100%   {
	 opacity: 1;
	 @include transform(scaleX(1) scaleY(0.8));
	}
}

@include keyframes(caption) {
	0%   {
		@include transform(scaleX(1));
	}
	25% {
		@include transform(scaleX(1));
	}
	30% {
		 @include transform(scaleX(1));
	}
	65%   {
	 @include transform(scaleX(0.65));
	}
	100%   {
		@include transform(scaleX(0.3));
	}
}

@include keyframes(webcam) {
	0%   {
    background: #0079c2;
	}
	65%   {
    border-radius: 50%;
    background: #0079c2;
    padding: 0;
    width: 5px;
	}
	100%   {
    background: white;
    border-radius: 10px;
    width: 25px;
  }
}
              
            
!

JS

              
                // A responsive animation created with .svg's and css shapes
              
            
!
999px

Console