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.
.window
.burn
.space-shuttle
.orbiter
.orbiter_window
.orbiter_wing.orbiter_wing--left
.orbiter_wing.orbiter_wing--right
.orbiter_fin.orbiter_fin--left
.orbiter_fin.orbiter_fin--right
.rocket
.rocket_booster.rocket_booster--left
.rocket_booster.rocket_booster--right
$window-size: 500px;
$window-gradient-height: ($window-size - 40px)/6;
$flame-start-time: 0.5s;
body {
background: #141D39;
height: 100vh;
overflow: hidden;
margin: 0;
}
*, *:before, *:after {
box-sizing: border-box;
}
@mixin horizontal-center {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.window {
width: $window-size;
height: $window-size;
@include horizontal-center;
top: 55%;
transform: translate(-50%, -50%);
border: 20px solid #16264B;
border-radius: 50%;
background: linear-gradient(to bottom, #1A3864 $window-gradient-height, #1B3159 $window-gradient-height, #1B3159 $window-gradient-height * 2, #1B2C4F $window-gradient-height * 2, #1B2C4F $window-gradient-height * 3, #182443 $window-gradient-height * 3, #182443 $window-gradient-height * 4, #141D39 $window-gradient-height * 4, #141D39 $window-gradient-height * 5, #1A3863 $window-gradient-height * 5);
overflow: hidden;
&:before, &:after {
content: '';
@include horizontal-center;
top: 50%;
width: 5px;
height: 5px;
border-radius: 50%;
}
&:before {
box-shadow: 215px 25px 0 0 #fff, 105px -45px 0 0 #fff, 160px -90px 0 0 #fff, 110px -120px 0 -1px #fff, 105px 70px 0 -1px #fff, 145px 105px 0 0 #fff, -190px -85px 0 0 #fff, -150px -50px 0 0 #fff, -160px -130px 0 -1px #fff, -140px 85px 0 0 #fff, -195px 65px 0 0 #fff;
animation: blink 1s ease-in 0s infinite;
}
&:after {
box-shadow: 150px 0 0 0 #fff, 200px -65px 0 0 #fff, 130px -170px 0 0 #fff, -160px 20px 0 2px #fff, -215px 5px 0 0 #fff, -110px 15px 0 -1px #fff, -110px -120px 0 0 #fff, -100px -170px 0 0 #fff;
animation: blink 1s ease-in 0.5s infinite;
}
}
.burn {
@include horizontal-center;
width: 60px;
height: 100px;
border-radius: 50%;
background: none;
bottom: 70px;
animation: flame-spread 0.5s ease-in $flame-start-time infinite alternate;
&:before {
content: '';
@include horizontal-center;
width: 40px;
height: 250px;
background: linear-gradient(to right, #FEDA94 25%, #FECE5F 25%, #FECE5F 75%, #FEDA94 75%);
box-shadow: -62.5px -10px 0 -10px #fff, 62.5px -10px 0 -10px #fff;
animation: flame-start $flame-start-time ease-in 0s 1, flame-glow 0.5s ease-in $flame-start-time infinite;
}
&:after {
content: '';
@include horizontal-center;
background: #fff;
width: 30px;
height: 30px;
border-radius: 50%;
bottom: -20px;
transform: translateX(-50%) translateY(10px);
opacity: 0;
box-shadow: 0 50px 0 10px #E6E9ED, -140px 10px 0 0 #E6E9ED, -125px 35px 0 0 #E6E9ED, -100px 30px 0 5px #E6E9ED, -60px 0 0 5px #E6E9ED, -60px 40px 0 30px #E6E9ED, -35px 25px 0 10px #E6E9ED, -85px 15px 0 5px #E6E9ED, 35px 45px 0 10px #E6E9ED, 35px 25px 0 10px #E6E9ED, 75px 40px 0 15px #E6E9ED, 125px 50px 0 15px #E6E9ED, 155px 20px 0 15px #E6E9ED, 0 20px 0 15px #FFF, -185px -15px 0 15px #FFF, -205px -45px 0 0 #FFF, -150px 0px 0 0 #FFF, -115px -5px 0 15px #FFF, -95px -35px 0 5px #FFF, -70px -50px 0 0 #FFF, -70px 0px 0 30px #FFF, -65px -75px 0 0 #FFF, -55px -55px 0 0 #FFF, -40px -30px 0 5px #FFF, -15px -15px 0 5px #FFF, 20px -25px 0 5px #FFF, 40px -5px 0 15px #FFF, 55px -45px 0 0 #FFF, 55px -65px 0 -5px #FFF, 75px -70px 0 -5px #FFF, 75px -60px 0 -10px #FFF, 75px -40px 0 5px #FFF, 90px -25px 0 5px #FFF, 90px 5px 0 25px #FFF, 135px -15px 0 20px #FFF, 185px -25px 0 10px #FFF, 195px -55px 0 10px #FFF, 215px -75px 0 0 #FFF;
animation: flame-gas-show 0.5s ease-in $flame-start-time 1 forwards, flame-gas 0.5s ease-in $flame-start-time infinite;
}
}
.space-shuttle {
width: 500px;
height: 500px;
@include horizontal-center;
top: 55%;
transform: translate(-50%, -50%);
animation: shake 0.125s ease-in $flame-start-time infinite;
}
.orbiter {
width: 50px;
height: 220px;
@include horizontal-center;
top: 30%;
transform: translate(-50%, -50%);
background: linear-gradient(to bottom, transparent 45px, rgba(#000, 0.5) 45px, rgba(#fff, 0.85) 46px, transparent 46px, transparent 85px, rgba(#000, 0.5) 85px, rgba(#fff, 0.85) 86px, transparent 86px, transparent 125px, rgba(#000, 0.5) 125px, rgba(#fff, 0.85) 126px, transparent 126px), linear-gradient(to right, rgba(#fff, 1) 50%, #D9D9D9 50%);
border-radius: 50% 50% 0 0/ 30% 30% 0 0;
box-shadow: 0 -12px 0 0 #414750;
&:before, &:after {
content: '';
@include horizontal-center;
}
&:before {
width: 70px;
bottom: -35px;
height: 50px;
background: linear-gradient(-135deg, #D9D9D9 25px, transparent 25px), linear-gradient(to right, rgba(#fff, 1) 50%, #C5C5C5 50%);
border-radius: 25px 25px 10px 10px;
box-shadow: 0 30px 0 -15px #414750;
z-index: 2;
}
&:after {
height: 60px;
bottom: -50px;
border-left: 3px solid #ECEFF2;
border-right: 3px solid #9EA3A9;
z-index: 2;
}
&_window {
@include horizontal-center;
top: 20px;
&:before, &:after {
content: '';
position: absolute;
width: 14px;
height: 6px;
background: #414750;
border-radius: 5px 0 0 2px;
left: 50%;
}
&:before {
transform: translateX(-50%) rotate(-8deg) translateX(-9px);
}
&:after {
transform: translateX(-50%) rotate(8deg) translateX(9px) scaleX(-1);
}
}
&_wing {
position: absolute;
left: 50%;
margin-left: - 30px;
width: 60px;
height: 25px;
bottom: 0px;
z-index: 1;
border-radius: 12px 0 0 5px;
box-shadow: -6px -5px 0 0 #434A53;
&:before {
content: '';
position: absolute;
right: 0;
bottom: 29px;
border-top: 35px solid transparent;
border-right: 25px solid #434A53;
border-bottom: 30px solid #434A53;
border-left: 35px solid transparent;
}
&:after {
content: '';
position: absolute;
right: 0;
bottom: 23px;
border-top: 35px solid transparent;
border-left: 30px solid transparent;
}
&--left {
background: #F2F3F4;
transform: translateX(-55px);
&:after {
border-right: 25px solid #F2F3F4;
border-bottom: 25px solid #F2F3F4;
}
}
&--right {
background: #AEB2B9;
transform: translateX(55px) scaleX(-1);
&:after {
border-right: 25px solid #AEB2B9;
border-bottom: 25px solid #AEB2B9;
}
}
}
&_fin {
position: absolute;
left: 50%;
margin-left: -30px;
width: 60px;
height: 25px;
bottom: -15px;
z-index: 0;
border-radius: 5px;
&--left {
background: #656D77;
transform: translateX(-55px) rotate(15deg);
}
&--right {
background: #565D65;
transform: translateX(55px) rotate(-15deg);
}
}
}
.rocket {
@include horizontal-center;
width: 80px;
height: 260px;
border-radius: 50% 50% 0 0/ 25% 25% 0 0;
background: linear-gradient(to bottom, transparent 60px, rgba(#000, 0.25) 60px, rgba(#000, 0.25) 62px, transparent 62px, transparent 110px, rgba(#000, 0.25) 110px, rgba(#000, 0.25) 112px, transparent 112px, transparent 160px, rgba(#000, 0.25) 160px, rgba(#000, 0.25) 162px, transparent 162px, transparent 210px, rgba(#000, 0.25) 210px, rgba(#000, 0.25) 212px, transparent 212px), linear-gradient(to right, #ED5466 50%, #CA4757 50%);
z-index: -1;
top: -12%;
&:before, &:after {
content: '';
position: absolute;
width: 10px;
height: 20px;
top: 45%;
}
&:before {
left: -10px;
background: #AAB2BC;
box-shadow: 0 90px 0 0 #AAB2BC;
}
&:after {
right: -10px;
background: #838C94;
box-shadow: 0 90px 0 0 #79848E;
}
&_booster {
width: 25px;
height: 300px;
position: absolute;
top: 60px;
border-radius: 50% 50% 5px 5px/ 10% 10% 5px 5px;
box-shadow: 0 10px 0 -2px #393F46;
&:before {
content: '';
@include horizontal-center;
width: 30px;
bottom: 0;
height: 12px;
border-radius: 4px;
}
&--left {
left: -35px;
background: linear-gradient(to bottom, transparent 60px, rgba(#000, 0.25) 60px, rgba(#000, 0.25) 62px, transparent 62px, transparent 110px, rgba(#000, 0.25) 110px, rgba(#000, 0.25) 112px, transparent 112px, transparent 160px, rgba(#000, 0.25) 160px, rgba(#000, 0.25) 162px, transparent 162px, transparent 210px, rgba(#000, 0.25) 210px, rgba(#000, 0.25) 212px, transparent 212px), linear-gradient(45deg, #E6E9ED 20px, #D1D4D8 20px, #FFFFFF 50px);
&:before {
background: linear-gradient(45deg, #E6E9ED 22px, #D1D4D8 22px);
}
}
&--right {
background: linear-gradient(to bottom, transparent 60px, rgba(#000, 0.25) 60px, rgba(#000, 0.25) 62px, transparent 62px, transparent 110px, rgba(#000, 0.25) 110px, rgba(#000, 0.25) 112px, transparent 112px, transparent 160px, rgba(#000, 0.25) 160px, rgba(#000, 0.25) 162px, transparent 162px, transparent 210px, rgba(#000, 0.25) 210px, rgba(#000, 0.25) 212px, transparent 212px), linear-gradient(45deg, #91979F 40px, #B9B9B9 40px, #B9B9B9 150px, #D9D9D9 150px);
right: -35px;
&:before {
background: #91979F;
}
}
}
}
@keyframes blink {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.25;
}
}
@keyframes flame-spread {
0%, 100% {
background: rgba(#FECE5F, 0.25);
box-shadow: 0 25px 0 25px rgba(#FECE5F, 0.15), 62.5px 5px 0 5px rgba(#fff, 0.05), 62.5px -10px 0 -10px rgba(#fff, 0.25), -62.5px 5px 0 5px rgba(#fff, 0.05), -62.5px -10px 0 -10px rgba(#fff, 0.25);
width: 60px;
height: 100px;
bottom: 70px;
}
50% {
width: 55px;
height: 90px;
bottom: 80px;
}
}
@keyframes flame-start {
0%, 19% {
width: 25px;
opacity: 0;
}
20%, 39% {
width: 25px;
opacity: 1;
}
40%, 59% {
width: 25px;
opacity: 0;
}
60%, 79% {
width: 25px;
opacity: 1;
}
100% {
width: 40px;
opacity: 1;
}
}
@keyframes flame-glow {
0%, 100% {
box-shadow: -62.5px -10px 0 -10px #fff, 62.5px -10px 0 -10px #fff, -62.5px -10px 0 -10px #fff, 62.5px -10px 0 -10px #fff, 0 0 0 0 #FEDA94;
}
50% {
box-shadow: -62.5px -10px 0 -10px #fff, 62.5px -10px 0 -10px #fff, -62.5px -10px 8px -10px #fff, 62.5px -10px 8px -10px #fff, 0 0 10px 0 #FEDA94;
}
}
@keyframes flame-gas-show {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes flame-gas {
0%, 100% {
transform: translateX(-50%) translateY(10px) scale(1.03);
}
50% {
transform: translateX(-50%) translateY(15px) scale(0.99);
}
}
@keyframes shake {
0%, 100% {
transform: translate(-50%, -50%) translateY(0px);
}
50% {
transform: translate(-50%, -50%) translateY(1px);
}
}
Also see: Tab Triggers