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

              
                <div class="frame">
	<div class="ruby">
		<div class="bottom-left"></div>
		<div class="bottom-right"></div>
		<div class="bottom-middle"></div>
		<div class="top-left-left"></div>
		<div class="top-left"></div>
		<div class="top-middle"></div>
		<div class="top-right"><div class="flash"></div></div>
		<div class="top-right-right"></div>
	</div>
</div>
              
            
!

CSS

              
                .frame {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 400px;
	height: 400px;
	margin-top: -200px;
	margin-left: -200px;
	border-radius: 2px;
	box-shadow: 1px 2px 10px 0px rgba(0,0,0,0.15);
	overflow: hidden;
	background: #FFC902;
	color: #fff;
	font-family: 'Open Sans', Helvetica, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.ruby {
	position: absolute;
	width: 192px;
	height: 126px;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	overflow: hidden;
	
	.bottom-left {
		position: absolute;
		z-index: 2;
		width: 0;
		height: 0;
		left: 0;
		bottom: 0;
		border-style: solid;
		border-width: 84px 0px 0 96px;
		border-color: #890505 transparent transparent transparent;
	}

	.bottom-right {
		position: absolute;
		z-index: 2;
		width: 0;
		height: 0;
		right: 0;
		bottom: 0;
		border-style: solid;
		border-width: 84px 96px 0 0px;
		border-color: #C81718 transparent transparent transparent;
	}

	.bottom-middle {
		position: absolute;
		z-index: 3;
		width: 0;
		height: 0;
		left: 54px;
		bottom: 0;
		border-style: solid;
		border-width: 84px 42px 0 42px;
		border-color: #A51012 transparent transparent transparent;
	}

	.top-left-left {
		position: absolute;
		z-index: 2;
		width: 0;
		height: 0;
		top: 0;
		left: 0;
		border-style: solid;
		border-width: 0 22px 42px 32px;
		border-color: transparent transparent #9E0707 transparent;
	}

	.top-left {
		position: absolute;
		z-index: 1;
		width: 64px;
		height: 42px;
		top: 0;
		left: 32px;
		background: #DC2323;
	}

	.top-middle {
		position: absolute;
		z-index: 2;
		width: 0;
		height: 0;
		top: 0;
		left: 54px;
		border-style: solid;
		border-width: 0 42px 42px 42px;
		border-color: transparent transparent #BC0E0E transparent;
	}

	.top-right {
		position: absolute;
		z-index: 1;
		width: 64px;
		height: 42px;
		top: 0;
		right: 32px;
		background: #F58181;
		overflow: hidden;
		
		.flash {
			position: absolute;
			width: 4px;
			height: 80px;
			top: -40px;
			left: 30px;
			background: #FFDFDF;
			transform: rotate(-44deg) translateX(-30px);
			animation: flash 3s linear infinite both;
			box-shadow: 0 0 5px 0 #FFDFDF;
		}
		
	}

	.top-right-right {
		position: absolute;
		z-index: 2;
		width: 0;
		height: 0;
		top: 0;
		right: 0;
		border-style: solid;
		border-width: 0 32px 42px 22px;
		border-color: transparent transparent #B90B0C transparent;
	}

}

@keyframes flash {
	0% {
		transform: rotate(-44deg) translateX(-30px);
	}
	10%, 100% {
		transform: rotate(-44deg) translateX(30px);
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console