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

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.

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

              
                <main>
<div class=c-checkbox>
	<input type=checkbox id=un>
	<!-- cube design ↴ -->
	<div><i></i><i></i><i></i><i></i></div>
</div>
<label for=un>un</label>

<div class=c-checkbox>
	<input type=checkbox id=deux checked>
	<!-- cube design ↴ -->
	<div><i></i><i></i><i></i><i></i></div>
</div>
<label for=deux>deux</label>

<div class=c-checkbox>
	<input type=checkbox id=trois checked>
	<!-- cube design ↴ -->
	<div><i></i><i></i><i></i><i></i></div>
</div>
<label for=trois>trois</label>

<div class=c-checkbox>
	<input type=checkbox id=quatre>
	<!-- cube design ↴ -->
	<div><i></i><i></i><i></i><i></i></div>
</div>
<label for=quatre>quatre</label>
</main>
              
            
!

CSS

              
                .c-checkbox > input[type=checkbox]{
	width: 40px; height: 40px;
	cursor: pointer;
	opacity: 0;
	margin: 0;
	appearance: none; -webkit-appearance: none;
}
.c-checkbox > div{
	display: grid;
	pointer-events: none;
	transition: transform .6s cubic-bezier(.8, .5, .2, 1.4);
	transform-style: preserve-3d;
}
.c-checkbox > div > *{
	grid-area: 1/1;
}
.c-checkbox > div > i:first-child{
	background: blue;
	transform:  translatez( -10px );
}
.c-checkbox > div > i:last-child{
	background: #ddd;
	transform:  translatez( 10px );
}
.c-checkbox > div > i:nth-of-type(2),
.c-checkbox > div > i:nth-of-type(3){
	height: 20px;
	transform: rotatex(90deg)rotatey(90deg) ;
	position: relative;
	top: 10px;
}
.c-checkbox > div > i:nth-of-type(2){
	background: navy;
	right: 20px;
}
.c-checkbox > div > i:nth-of-type(3){
	background: darkslategray;
	left: 20px;
}
input:checked + div{ 
	transform: rotatey( 180deg ); 
}
.c-checkbox{
	display: grid;
	width: 40px; height: 40px;
}
.c-checkbox > *{
	grid-area: 1/1;
}
label{
	font: 60px Girassol;
	color: lime;
	text-shadow: 2px 2px 0 blue;
	cursor: pointer;
}
main{
	display: grid;
	grid:  repeat(5, 70px) / 90px 1fr;
	align-items: center;
	width: max-content;
}
body{
	display: grid;
	height: 100vh;
	align-items: center;
	justify-items: center;
	user-select: none; -webkit-user-select:  none;
	-webkit-tap-highlight-color: transparent;
}

/* This code is for heuristic purposes only. For coding alternatives, you can use peudo-elements instead of elements to show the box faces. The <i> elements, which are inline by nature, were automatically blockified, with full width and height, when they became grid items. If you decide to use inline elements, like I did, to show the box faces, make sure they are blockfied or they won't take dimensions (or just use block elements like <div>). You can also try rotating the boxes in other directions. You will then also need to relcote the side faces accordingly, if needed. */
              
            
!

JS

              
                
              
            
!
999px

Console