cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <div class="absolute-center">

  <!-- The Morphing Device -->
  <figure class="device">
    <figcaption class="ir">
      Responsive Web Design
    </figcaption>
  </figure>

</div>
            
          
!
            
              // Morphing Device by Edmundo Santos

$bg-color: #202126;
$outline: rgba(255,255,255,.1);

.device {
	position: relative;
	overflow: hidden;
	width: 100%;
	padding-top: 70%;
	margin: 0 auto;
	border: 2px solid #ebcb63;
	border-radius: 6px;
	box-shadow: 10px 10px 0 -2px $bg-color, 10px 10px 0 rgba(255,255,255,.1);
	backface-visibility: hidden;
	animation: morphDevice 10s infinite cubic-bezier(1,.015,.295,1.225) forwards;

	figcaption {
		position: absolute;
		top: 12px;
		left: 12px;
		width: 10px;
		height: 10px;
		background: rgba(255,255,255,.1);
		box-shadow: 15px 0 0 rgba(255,255,255,.1), 30px 0 0 rgba(255,255,255,.1);
		border-radius: 50%;
		animation: morphButtons 10s infinite cubic-bezier(1,.015,.295,1.225) forwards;
		backface-visibility: hidden;
	}
}

@keyframes morphDevice {
	0%, 15% {
		width: 100%;
		padding-top: 70%;
		margin-top: 0;
		border-color: #ebcb63;
		box-shadow: 10px 10px 0 -2px $bg-color, 10px 10px 0 $outline;
		transform: rotate(0);
	}
	25%, 40% {
		width: 70%;
		padding-top: 55%;
		margin-top: 7.5%;
		border-color: #4b8ac4;
		box-shadow: 9px -9px 0 -2px $bg-color, 9px -9px 0 $outline;
		transform: rotate(90deg);
	}
	50%, 65% {
		width: 28%;
		padding-top: 42%;
		margin-top: 15%;
		border-color: #ece9f2;
		box-shadow: -8px -8px 0 -2px $bg-color, -8px -8px 0 $outline;
		transform: rotate(180deg);
	}
	75%, 90% {
		width: 55%;
		padding-top: 70%;
		margin-top: 0;
		border-color: #57c39f;
		box-shadow: -9px 9px 0 -2px $bg-color, -9px 9px 0 $outline;
		transform: rotate(270deg);
	}
	100% {
		width: 100%;
		padding-top: 70%;
		margin-top: 0;
		border-color: #ebcb63;
		box-shadow: 10px 10px 0 -2px $bg-color, 10px 10px 0 $outline;
		transform: rotate(360deg);
	}
}

@keyframes morphButtons {
	0%, 15%, 100% {
		top: 12px;
		left: 12px;
		margin: 0;
		background: #ebcb63;
		box-shadow: 15px 0 0 rgba(255,255,255,.1), 30px 0 0 rgba(255,255,255,.1);
		transform: scale(1);
	}
	25%, 40% {
		top: 50%;
		left: 100%;
		margin: -5px 0 0 -20px;
		background: #4b8ac4;
		box-shadow: 0 0 0 250px rgba(255,255,255,0.05), 0 0 0 100px transparent;
		transform: scale(.9);
	}
	50%, 65% {
		top: 10px;
		left: 50%;
		margin: 0 0 0 -5px;
		background: #ece9f2;
		box-shadow: 0 -30px 0 rgba(255,255,255,.05), 0 -30px 0 rgba(255,255,255,.05);
		transform: scale(.8);
	}
	75%, 90% {
		top: 100%;
		left: 50%;
		margin: -20px 0 0 -5px;
		background: #57c39f;
		box-shadow: 0 0 0 250px rgba(255,255,255,0.05), 0 0 0 100px transparent;
		transform: scale(.9);
	}
}

// Demo purposes only

body {
  height: 100%;
  background: $bg-color;
}

.absolute-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 222px;
  transform: translate(-50%,-50%);
}

.ir {
	font: 0/0 a;
	text-shadow: none;
	color: transparent;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console