123

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div id="marquee">
	<div><span>STAY INDOORS: ZOMBIE OUTBREAK</span></div>
	<div aria-hidden="true"><span>STAY INDOORS: ZOMBIE OUTBREAK</span></div>
</div>
<form onsubmit="setText(event)">
  <label for="textsource">Source text</label>
<input type="hidden" id="textsource" value="아이구나 세상에 어떻게 이렇수가 있나" autocapitalize="characters" pattern=".{5,30}" title="Text must be 5 to 30 characters in length">
<input type="submit" value="Use">
</form>
            
          
!
            
              // 3D switched off on viewports less than 993px wide to preserve ledgibility

@font-face {
  font-family: Agency;
   src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/agency-fb-bold.woff);
}
body { 
  font-family: Avenir, sans-serif;
  marging: 0;
}
#marquee { 
  margin-top: 3rem;
	perspective: 800px;
	font-size: 0;
	font-family: Agency, sans-serif;
}
#marquee div {
	display: inline-block; 
	height: 12rem; 
	width: 30rem;
	position: relative;
}
#marquee div:first-of-type { 
	background: #e5233e;
	transform-origin: top right;
	transform: rotateY(-30deg);
	color: #fff;
}
#marquee div:last-of-type {
	background: #b31e31;
	transform-origin: top left;
	transform: rotateY(25deg);
	color: #f8c9d9;
}
#marquee div { 
	font-size: 8rem;
	overflow: hidden;
}
#marquee div span { 
	position: absolute; 
	width: 400%;	
	line-height: 1.4;
}
@keyframes leftcrawl {
	to { transform: translateX(-100rem); }
}
@keyframes rightcrawl {
	to { transform: translateX(-130rem); }
}
#marquee div:first-of-type span {
	transform: translateX(60rem);
	animation: leftcrawl 14s linear infinite;
	text-shadow: 4px 0px 4px rgba(0,0,0,0.3);
}
#marquee div:last-of-type span {
	transform: translateX(30rem);
	animation: rightcrawl 14s linear infinite;
}
form { 
  margin-top: 3rem; 
  background: #334;
  padding: 1rem;
  text-align: center;
  color: #fff;
}
input[type="text"] { 
  padding: .5rem; 
  font-size: 1.2rem; 
  width: 22rem; 
}
input[type="text"] {
  padding: .5rem;
}
label {
  margin: 1rem;
}
@media all and (max-width: 993px) {
  #marquee {
    perspective: none;
  }
  #marquee div:last-of-type { 
    opacity: 0; 
    height: 0;
  }
  #marquee div:first-of-type {
    width: 80%;
  }
}
            
          
!
            
              function setText(event){
  event.preventDefault();
  leftText.innerText = textsource.value.toUpperCase();
  rightText.innerText = textsource.value.toUpperCase();
}
var leftText = document.querySelector("#marquee div:first-of-type span");
var rightText = document.querySelector("#marquee div:last-of-type span");
var textsource = document.getElementById("textsource");
setText();

            
          
!
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.

Console