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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              %section
	%p
		%em There are no truly evil black cats, but there are irresponsible and stupid humans.
	%p Black cats are living creatures. They are not accessories to cool witch costumes. They are not objects to use for silly pranks.
	%p
		%strong Keep black cats safe on Halloween!
.scene
	.cube
		- 6.times do
			.cube__face
            
          
!
            
              $edge-len: 16%;
$txt: 'Trick or Treat' 'Fright Night' 
	'Happy Halloween';
$cn: 'bg_sq_halloween_';

body {
	display: flex;
	font: 1em comic sans ms, sans-serif;
}

section {
	box-sizing: border-box;
	padding: 1em;
	width: 32%;
	font-size: 1.25em;
}

p { margin: 1em 0; }

.scene {
	flex: 1;
	position: relative;
	perspective: 20em;
}

div, :before { position: absolute; }

.cube {
	top: 50%; left: 50%;
	margin: -.5*$edge-len;
	padding: .5*$edge-len;
	transform-style: preserve-3d;
	animation: a 16s linear infinite;
	
	&__face {
		top: 0; right: 0; bottom: 0; left: 0;
		opacity: .875;
		box-shadow: 0 0 1px #000;
		background: $c-orange;
		
		&:before {
			top: 50%; left: 50%;
			transform: translate(-50%, -50%);
			text-align: center;
		}
		
		@for $i from 0 to 6 {
			$j: $i%2;
			$k: floor($i/2);
			
			&:nth-child(#{$i + 1}) {
				transform: 
					if($i < 4, rotateY($i*90deg), 
						rotateZ(pow(-1, $i)*90deg))
					translateX(50%) rotateY(90deg);
				
				@if $j == 0 {
					@if $i == 4 { background: $c-red; }
					
					&:before {
						content: nth($txt, $k + 1);
					}
				}
				@else {
					$url: $base + $cn + $k + '.jpg';
					background: url($url) 50% / cover;
				}
			}
		}
	}
}

@keyframes a {
	to { 
		transform: rotateY(-1turn) rotateX(2turn)
	}
}
            
          
!
999px
Loading ..................

Console