HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>N64 Logo</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://code.jquery.com/jquery-2.0.0.min.js"></script>
<link rel="stylesheet" href="assets/styles.css">
</head>
<body>
<div id="container">
<div id="logo" class="animate">
<div class="column one">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
<div class="column two angle">
<div class="panel front green topLeft bottomRight"></div>
<div class="panel back green topRight bottomLeft"></div>
<div class="panel right blue"></div>
<div class="panel left red"></div>
</div>
<div class="column three">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
<div class="column four angle">
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue topLeft bottomRight"></div>
<div class="panel left blue topLeft bottomRight"></div>
</div>
<div class="column five angle">
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue topRight bottomLeft"></div>
<div class="panel left blue topRight bottomLeft"></div>
</div>
<div class="column six">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
<div class="column seven angle">
<div class="panel front green topRight bottomLeft"></div>
<div class="panel back green topLeft bottomRight"></div>
<div class="panel right red"></div>
<div class="panel left blue"></div>
</div>
<div class="column eight">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
</div>
<div id="reflection">
<div id="reflectedLogo" class="animateRef">
<div class="column one">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
<div class="column two angle">
<div class="panel front green topLeft bottomRight"></div>
<div class="panel back green topRight bottomLeft"></div>
<div class="panel right blue"></div>
<div class="panel left red"></div>
</div>
<div class="column three">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
<div class="column four angle">
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue topLeft bottomRight"></div>
<div class="panel left blue topLeft bottomRight"></div>
</div>
<div class="column five angle">
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue topRight bottomLeft"></div>
<div class="panel left blue topRight bottomLeft"></div>
</div>
<div class="column six">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
<div class="column seven angle">
<div class="panel front green topRight bottomLeft"></div>
<div class="panel back green topLeft bottomRight"></div>
<div class="panel right red"></div>
<div class="panel left blue"></div>
</div>
<div class="column eight">
<div class="panel top yellow"></div>
<div class="panel front green"></div>
<div class="panel back green"></div>
<div class="panel right blue"></div>
<div class="panel left blue"></div>
<div class="panel bottom yellow"></div>
</div>
</div>
</div>
</div>
<div id="background"><div class="glow"></div></div>
</body>
</html>
* {
margin: 0;
padding: 0;
}
@-moz-keyframes rotate {
from { -moz-transform: rotateX( 60deg ) rotateZ(45deg); }
to{ -moz-transform: rotateX( 60deg ) rotateZ(-315deg); }
}
@-webkit-keyframes rotate {
from { -webkit-transform: rotateX( 60deg ) rotateZ(45deg); }
to{ -webkit-transform: rotateX( 60deg ) rotateZ(-315deg); }
}
@-o-keyframes rotate {
from { -o-transform: rotateX( 60deg ) rotateZ(45deg); }
to{ -o-transform: rotateX( 60deg ) rotateZ(-315deg); }
}
@keyframes rotate {
from { transform: rotateX( 60deg ) rotateZ(45deg); }
to{ transform: rotateX( 60deg ) rotateZ(-315deg); }
}
@-moz-keyframes rotateRef {
from { -moz-transform: rotateX( 60deg ) rotateZ(45deg) scaleY(-1); }
to{ -moz-transform: rotateX( 60deg ) rotateZ(-315deg) scaleY(-1); }
}
@-webkit-keyframes rotateRef {
from { -webkit-transform: rotateX( 60deg ) rotateZ(45deg) scaleY(-1); }
to{ -webkit-transform: rotateX( 60deg ) rotateZ(-315deg) scaleY(-1); }
}
@-o-keyframes rotateRef {
from { -o-transform: rotateX( 60deg ) rotateZ(45deg) scaleY(-1); }
to{ -o-transform: rotateX( 60deg ) rotateZ(-315deg) scaleY(-1); }
}
@keyframes rotateRef {
from { transform: rotateX( 60deg ) rotateZ(45deg) scaleY(-1); }
to{ transform: rotateX( 60deg ) rotateZ(-315deg) scaleY(-1); }
}
body {
background: #f0f0f0;
}
#container {
width: 436px;
height: 900px;
position: absolute;
top: 50%;
left: 0; right: 0;
margin: -400px auto;
-webkit-perspective: 1500px;
-moz-perspective: 1500px;
-o-perspective: 1500px;
perspective: 1500px;
-webkit-backface-visibility: hidden;
-webkit-transform: scale( 0.3 );
-moz-transform: scale( 0.3 );
-o-transform: scale( 0.3 );
transform: scale( 0.3 );
}
#logo {
width: 100%;
height: 436px;
position: absolute;
z-index: 2;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
-webkit-transform: rotateX( 60deg ) rotateZ( 45deg );
-moz-transform: rotateX( 60deg ) rotateZ( 45deg );
-o-transform: rotateX( 60deg ) rotateZ( 45deg );
transform: rotateX( 60deg ) rotateZ( 45deg );
-webkit-transition : -webkit-transform 2s linear;
-moz-transition : -moz-transform 2s linear;
-o-transition : -o-transform 2s linear;
-ms-transition : -ms-transform 2s linear;
transition : transform 2s linear;
}
#reflection {
opacity: 0.05;
}
#reflectedLogo {
width: 100%;
top: 500px;
height: 450px;
position: absolute;
z-index: -1;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: rotateX( 60deg ) rotateZ( 45deg ) scaleY(-1);
-moz-transform: rotateX( 60deg ) rotateZ( 45deg ) scaleY(-1);
-o-transform: rotateX( 60deg ) rotateZ( 45deg ) scaleY(-1);
transform: rotateX( 60deg ) rotateZ( 45deg ) scaleY(-1);
-webkit-transition : -webkit-transform 2s linear;
-moz-transition : -moz-transform 2s linear;
-o-transition : -o-transform 2s linear;
-ms-transition : -ms-transform 2s linear;
transition : transform 2s linear;
}
.overlay {
color: white;
opacity: 0.8;
position: absolute;
width: 100%;
height: 400px;
bottom: 0;
z-index: 3;
}
.animate {
-webkit-animation : rotate 11s infinite linear;
-moz-animation : rotate 11s infinite linear;
-o-animation : rotate 11s infinite linear;
-ms-animation : rotate 11s infinite linear;
animation : rotate 11s infinite linear;
}
.animateRef {
-webkit-animation : rotateRef 11s infinite linear;
-moz-animation : rotateRef 11s infinite linear;
-o-animation : rotateRef 11s infinite linear;
-ms-animation : rotateRef 11s infinite linear;
animation : rotateRef 11s infinite linear;
}
.column {
width: 100px;
height: 100px;
position: absolute;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.column.one {
top: 0;
left: 0;
}
.column.two {
top: 0;
left: 50%;
margin: 0 0 0 -50px;
-webkit-transform: rotateY( 42.5deg ) translate3d(-6px,0px,14px);
-moz-transform: rotateY( 42.5deg ) translate3d(-6px,0px,14px);
-o-transform: rotateY( 42.5deg ) translate3d(-6px,0px,14px);
transform: rotateY( 42.5deg ) translate3d(-6px,0px,14px);
}
.column.three {
top: 0;
right: 0;
}
.column.four {
top: 50%;
left: 0;
margin: -50px 0 0 0;
-webkit-transform: rotateX( -47.5deg ) translate3d(0,-6px,15px);
-moz-transform: rotateX( -47.5deg ) translate3d(0,-6px,15px);
-o-transform: rotateX( -47.5deg ) translate3d(0,-6px,15px);
transform: rotateX( -47.5deg ) translate3d(0,-6px,15px);
}
.column.five {
top: 50%;
right: 0;
margin: -50px 0 0 0;
-webkit-transform: rotateX( 47.5deg ) translate3d(0px,-7px,-15px);
-moz-transform: rotateX( 47.5deg ) translate3d(0px,-7px,-15px);
-o-transform: rotateX( 47.5deg ) translate3d(0px,-7px,-15px);
transform: rotateX( 47.5deg ) translate3d(0px,-7px,-15px);
}
.column.six {
bottom: 0;
left: 0;
}
.column.seven {
left: 50%;
bottom: 0;
margin: 0 0 0 -50px;
-webkit-transform: rotateY( -42.5deg ) translate3d(-5px,0px,-13px);
-moz-transform: rotateY( -42.5deg ) translate3d(-5px,0px,-13px);
-o-transform: rotateY( -42.5deg ) translate3d(-5px,0px,-13px);
transform: rotateY( -42.5deg ) translate3d(-5px,0px,-13px);
}
.column.eight {
bottom: 0;
right: 0;
}
.column div.panel {
width: 140px;
height: 140px;
display: block;
position: absolute;
margin: 0px;
}
.column div.panel.top,
.column div.panel.bottom {
height: 140px;
}
.column div.panel.topLeft:before {
width: 0;
height: 0;
content: " ";
bottom: 100%;
position: absolute;;
border-bottom: 152px solid red;
border-right: 140px solid transparent;
}
.column div.panel.topRight:before {
width: 0;
height: 0;
content: " ";
bottom: 100%;
position: absolute;;
border-bottom: 152px solid red;
border-left: 140px solid transparent;
}
.column div.panel.bottomLeft:after {
width: 0;
height: 0;
content: " ";
top: 100%;
position: absolute;;
border-top: 152px solid red;
border-right: 140px solid transparent;
}
.column div.panel.bottomRight:after {
width: 0;
height: 0;
content: " ";
top: 100%;
position: absolute;;
border-top: 152px solid red;
border-left: 140px solid transparent;
}
/* Applying a unique color to each face */
.column div.panel.green { background: rgba( 0, 144, 43, 1 ); }
.column div.panel.blue { background: rgba( 0, 47, 171, 1 ); }
.column div.panel.yellow { background: rgba( 255, 189, 0, 1 ); }
.column div.panel.red { background: rgba( 255, 42, 0, 1 ); }
.column div.panel.green:before,
.column div.panel.green:after {
border-top-color: rgb( 0, 144, 43 );
border-bottom-color: rgb( 0, 144, 43 );
}
.column div.panel.blue:before,
.column div.panel.blue:after {
border-top-color: rgba( 0, 47, 171, 1 );
border-bottom-color: rgba( 0, 47, 171, 1 );
}
/* Giving the desired orientation to each side of the cube */
.column div.panel.top {
-webkit-transform: rotateX( 0deg ) translate3d( 0, 0, 210px );
-moz-transform: rotateX( 0deg ) translate3d( 0, 0, 210px );
-o-transform: rotateX( 0deg ) translate3d( 0, 0, 210px );
transform: rotateX( 0deg ) translate3d( 0, 0, 210px );
}
.column div.panel.front {
-webkit-transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleY(3);
-moz-transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
-o-transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
}
.column.angle div.panel.front {
-webkit-transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleY(1);
-moz-transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleY(1);
-o-transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleY(1);
transform: rotateX( -90deg ) translate3d( 0, 0, 70px ) scaleY(1);
}
.column.four.angle div.panel.front {
-webkit-transform: rotateX( 0deg ) translate3d( 0px, -76px, 70px ) scaleY(2.1);
-moz-transform: rotateX( 0deg ) translate3d( 0px, -76px, 70px ) scaleY(2.1);
-o-transform: rotateX( 0deg ) translate3d( 0px, -76px, 70px ) scaleY(2.1);
transform: rotateX( 0deg ) translate3d( 0px, -76px, 70px ) scaleY(2.1);
}
.column.five.angle div.panel.front {
-webkit-transform: rotateX( 0deg ) translate3d( 0px, 76px, 70px ) scaleY(2.1);
-moz-transform: rotateX( 0deg ) translate3d( 0px, 76px, 70px ) scaleY(2.1);
-o-transform: rotateX( 0deg ) translate3d( 0px, 76px, 70px ) scaleY(2.1);
transform: rotateX( 0deg ) translate3d( 0px, 76px, 70px ) scaleY(2.1);
}
.column div.panel.back {
-webkit-transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleY(3);
-moz-transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
-o-transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
}
.column.angle div.panel.back {
-webkit-transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleY(1);
-moz-transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleY(1);
-o-transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleY(1);
transform: rotateX( 90deg ) translate3d( 0, 0, 70px ) scaleY(1);
}
.column.four.angle div.panel.back {
-webkit-transform: rotateX( 180deg ) translate3d( 0px, -74px, 70px ) scaleY(2.1);
-moz-transform: rotateX( 180deg ) translate3d( 0px, -74px, 70px ) scaleY(2.1);
-o-transform: rotateX( 180deg ) translate3d( 0px, -74px, 70px ) scaleY(2.1);
transform: rotateX( 180deg ) translate3d( 0px, -74px, 70px ) scaleY(2.1);
}
.column.five.angle div.panel.back {
-webkit-transform: rotateX( 180deg ) translate3d( 0px, 74px, 70px ) scaleY(2.1);
-moz-transform: rotateX( 180deg ) translate3d( 0px, 74px, 70px ) scaleY(2.1);
-o-transform: rotateX( 180deg ) translate3d( 0px, 74px, 70px ) scaleY(2.1);
transform: rotateX( 180deg ) translate3d( 0px, 74px, 70px ) scaleY(2.1);
}
.column div.panel.right {
-webkit-transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
-moz-transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
-o-transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(3);
}
.column.angle div.panel.right.red {
-webkit-transform: rotateY( 90deg ) translate3d( -77px, 0, 70px ) scaleX(2.05);
-moz-transform: rotateY( 90deg ) translate3d( -77px, 0, 70px ) scaleX(2.05);
-o-transform: rotateY( 90deg ) translate3d( -77px, 0, 70px ) scaleX(2.05);
transform: rotateY( 90deg ) translate3d( -77px, 0, 70px ) scaleX(2.05);
}
.column.angle div.panel.left.red {
-webkit-transform: rotateY( 90deg ) translate3d( -77px, 0, -70px ) scaleX(2.05);
-moz-transform: rotateY( 90deg ) translate3d( -77px, 0, -70px ) scaleX(2.05);
-o-transform: rotateY( 90deg ) translate3d( -77px, 0, -70px ) scaleX(2.05);
transform: rotateY( 90deg ) translate3d( -77px, 0, -70px ) scaleX(2.05);
}
.column.angle div.panel.right.blue {
-webkit-transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(1);
-moz-transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(1);
-o-transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(1);
transform: rotateY( 90deg ) translate3d( 0, 0, 70px ) scaleX(1);
}
.column.two.angle div.panel.right.blue {
-webkit-transform: rotateY( 90deg ) translate3d( 74px, 0, 70px ) scaleX(2.1);
-moz-transform: rotateY( 90deg ) translate3d( 74px, 0, 70px ) scaleX(2.1);
-o-transform: rotateY( 90deg ) translate3d( 74px, 0, 70px ) scaleX(2.1);
transform: rotateY( 90deg ) translate3d( 74px, 0, 70px ) scaleX(2.1);
}
.column.angle div.panel.left.blue {
-webkit-transform: rotateY( 90deg ) translate3d( 0, 0, -70px ) scaleX(1);
-moz-transform: rotateY( 90deg ) translate3d( 0, 0, -70px ) scaleX(1);
-o-transform: rotateY( 90deg ) translate3d( 0, 0, -70px ) scaleX(1);
transform: rotateY( 90deg ) translate3d( 0, 0, -70px ) scaleX(1);
}
.column.seven.angle div.panel.left.blue {
-webkit-transform: rotateY( 90deg ) translate3d( 74px, 0, -70px ) scaleX(2.1);
-moz-transform: rotateY( 90deg ) translate3d( 74px, 0, -70px ) scaleX(2.1);
-o-transform: rotateY( 90deg ) translate3d( 74px, 0, -70px ) scaleX(2.1);
transform: rotateY( 90deg ) translate3d( 74px, 0, -70px ) scaleX(2.1);
}
.column div.panel.left {
-webkit-transform: rotateY( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
-moz-transform: rotateY( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
-o-transform: rotateY( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
transform: rotateY( -90deg ) translate3d( 0, 0, 70px ) scaleX(3);
}
.column.angle div.panel.left {
-webkit-transform: rotateY( -90deg ) translate3d( -75px, 0, 70px ) scaleX(2);
-moz-transform: rotateY( -90deg ) translate3d( -75px, 0, 70px ) scaleX(2);
-o-transform: rotateY( -90deg ) translate3d( -75px, 0, 70px ) scaleX(2);
transform: rotateY( -90deg ) translate3d( -75px, 0, 70px ) scaleX(2);
}
.column div.panel.bottom {
-webkit-transform: rotateX( -180deg ) translate3d( 0, 0, 210px );
-moz-transform: rotateX( -180deg ) translate3d( 0, 0, 210px );
-o-transform: rotateX( -180deg ) translate3d( 0, 0, 210px );
transform: rotateX( -180deg ) translate3d( 0, 0, 210px );
}
#background {
height: 500px;
width: 500px;
background: #ffffff;
border-radius: 250px;
position: absolute;
top: 50%;
margin: -250px auto 0;
left: 0; right: 0;
z-index: -1;
opacity: 0.5;
-webkit-filter: blur(50px);
}
Also see: Tab Triggers