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 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.
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.
If the stylesheet 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 CSS 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.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<input id="trigger" class="toggle-checkbox" type="checkbox"><label for="trigger">Brawl!</label>
<div class="ring">
<svg fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 800 600"><path id="rope" fill="#3b1717" d="M94 295v3h-2v2H75v-2h-2v-3h-2v-45h26v45h-3z" transform="translate(-2)"/><path fill="#d4d4d4" d="M73 403h654v137H73z"/><path fill="#b94c4c" d="M710 232h17v171h-17zM74 232h16v171H74z"/><path fill="#b94c4c" d="M89 220h3v3h4v14h-4v4h-3v2H75v-2h-3v-4h-3v-14h3v-3h3v-3h14v3zM726 220h3v3h3v14h-3v4h-3v2h-15v-2h-3v-4h-3v-14h3v-3h3v-3h15v3z"/><path fill="#3b1717" d="M718 363h13v20h-13z"/><path fill="#3b1717" d="M716 365h17v16h-17z"/><path fill="#3b1717" d="M735 366v13h-21v-13z"/><g><path fill="#3b1717" d="M68 363h14v20H68z"/><path fill="#3b1717" d="M67 365h17v16H67z"/><path fill="#3b1717" d="M85 366v13H64v-13z"/></g><g><path fill="#3b1717" d="M65 363h657v20H65z"/></g><g><path fill="#3b1717" d="M718 249h13v20h-13z"/><path fill="#3b1717" d="M716 250h17v17h-17z"/><path fill="#3b1717" d="M735 252v13h-21v-13z"/><g><path fill="#3b1717" d="M68 249h14v20H68z"/><path fill="#3b1717" d="M67 250h17v17H67z"/><path fill="#3b1717" d="M85 252v13H64v-13z"/></g><g><path fill="#3b1717" d="M65 249h657v20H65z"/></g></g><g><path fill="#3b1717" d="M718 306h13v20h-13z"/><path fill="#3b1717" d="M716 308h17v16h-17z"/><path fill="#3b1717" d="M735 309v13h-21v-13z"/><g><path fill="#3b1717" d="M68 306h14v20H68z"/><path fill="#3b1717" d="M67 308h17v16H67z"/><path fill="#3b1717" d="M85 309v13H64v-13z"/></g><g><path fill="#3b1717" d="M65 306h657v20H65z"/></g></g></svg>
</div>
<div class="z"><svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 207 112"><g transform="scale(.17625) rotate(36.7 1229.3 -230.6)"><path fill="#91c1a3" fill-rule="nonzero" d="M973.3 922.3L786 675.8l117.8-89.5L1091 832.8z"/><path fill="#91c1a3" fill-rule="nonzero" d="M878.7 846.4l-89-117 46.6-35.5 89 117.1z"/><g id="rarm"><path fill="#91c1a3" fill-rule="nonzero" d="M0 171h9v9H0z" transform="matrix(-11.31663 -6.2968 3.97253 -7.13944 488.5 2093.1)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M1071.2 941.4l-20.8-20.9 82.8-82 62.1 62.6-20 20 20.6 20.8-42.1 41.8L1133 963l-20.5 20.3-20.7-20.9-21 20.7-20.6-20.9 20.9-20.7z" transform="rotate(-106.1 1104.8 806.5)"/><path fill="#91c1a3" fill-rule="nonzero" d="M41.2 500h13.2v-13.2h13.2v-13.1h13.1v-13.2H129v53.1l-87.7-.4V500z" transform="rotate(-150.9 594.4 869.9) scale(2.2344)"/></g><g id="larm"><path fill="#91c1a3" fill-rule="nonzero" d="M0 171h9v9H0z" transform="matrix(11.0045 6.82767 -6.73945 10.86234 1739.1 -1313.2)"/><path fill="#91c1a3" d="M291.7 487.1h12.5V500h-12.5z" transform="matrix(-3.81735 -2.36846 -1.86336 3.00327 2731.8 -155)"/><path fill="#91c1a3" fill-rule="nonzero" d="M41.2 500h13.2v-13.2h13.2v-13.1h13.1v-13.2l83.7 5 .1 53.2-123.3-5.5V500z" transform="rotate(31.8 1373.5 1704.7) scale(2.2344)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M9 180h9v9H9z" transform="matrix(7.4257 10.61016 -8.03246 5.62167 1911.5 -507.1)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M27 207h9v9h-9z" transform="matrix(3.78271 5.40488 -5.35498 3.74778 1507.2 -264)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M0 189h9v9H0z" transform="matrix(5.58675 7.98255 -2.67748 1.87389 1041.2 306.2)"/></g><path fill="#313131" fill-rule="nonzero" d="M1001.5 827L841.7 616.8l286.8-217.9 159.7 210.3z"/><path fill="#313131" d="M780.2 662.2l127-94.8 27.6 37-127 94.8zM906.6 835.6l125-97.3 29.5 38-125 97.2z"/><path fill="#4d4c4c" fill-rule="nonzero" d="M1218.8 662L1059 451.6l23.5-17.8L1242.2 644z"/><path fill="#474747" fill-rule="nonzero" d="M1406.1 519.6l-46.8 35.5-71.2-93.6 134.4-102.1 116 152.7-87.5 66.5-44.9-59z"/><path fill="#9cd3b3" fill-rule="nonzero" d="M1335.9 573l-71.2-93.7 23.4-17.8 71.2 93.6z"/><path fill="#313131" fill-rule="nonzero" d="M1266 626.1l-71-93.4 70.3-53.5 71 93.4z"/><path fill="#474747" fill-rule="nonzero" d="M1355.2 270.6l43.8-93.3 99.5 46.7-63.9 136 .4.6-146.9 83.2-58-102.4 125-70.8z"/><path fill="#9cd3b3" fill-rule="nonzero" d="M1204.6 356l58 102.3 25.5-14.5-58-102.4z"/><path fill="#313131" fill-rule="nonzero" d="M1128 399.3l58 102.2 76.9-43.6-58-102.2z"/>
<g id="head"><path fill="#3a3a3a" fill-rule="nonzero" d="M126 9h9v9h-9z" transform="matrix(-8.92503 -27.6848 6.18225 -1.99302 1674.5 4463.8)"/><path fill="#3a3a3a" fill-rule="nonzero" d="M63 0h9v9h-9z" transform="matrix(-6.94441 -21.54126 6.18225 -1.99302 1007 2298.5)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M54 27h9v9h-9z" transform="matrix(-9.02466 -27.994 27.9211 -9.0012 396 2697)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M63 18h9v9h-9z" transform="matrix(-7.09678 -22.0138 34.21495 -11.03012 456.7 2508.7)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M45 90h9v9h-9z" transform="matrix(-10.98169 -34.0647 10.92304 -3.52136 308.2 2779.6)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M81 117h9v9h-9z" transform="matrix(-3.05948 -9.49033 6.2209 -2.00549 407.3 1780.5)"/><path fill="#9cd3b3" fill-rule="nonzero" d="M144 45h9v9h-9z" transform="matrix(-13.03847 -40.44454 9.49033 -3.05948 2187 6942)"/><path fill="#fbeb8e" fill-rule="nonzero" d="M99 36h9v9h-9z" transform="matrix(-3.36418 -10.4355 9.49033 -3.05948 636.7 1936.6)"/><path fill="#fbeb8e" fill-rule="nonzero" d="M63 36h9v9h-9z" transform="matrix(-2.9833 -9.25404 9.49033 -3.05948 527.7 1598.4)"/><path fill="#3a3a3a" fill-rule="nonzero" d="M135 54h9v9h-9z" transform="scale(-3.26809) rotate(72.1 142.1 -306.9)"/><path fill="#758b7c" fill-rule="nonzero" d="M81 90h9v9h-9z" transform="matrix(-3.00822 -9.33135 3.11045 -1.00274 795 1641.2)"/><path fill="#91c1a3" fill-rule="nonzero" d="M90 54h9v9h-9z" transform="matrix(-1.00274 -3.11045 9.25404 -2.9833 300.9 1244.3)"/><path fill="#444445" fill-rule="nonzero" d="M63 45h9v9h-9zM108 36h9v9h-9z" transform="scale(-3.26809) rotate(72.1 142.1 -306.9)"/><path fill="#3a3a3a" fill-rule="nonzero" d="M135 27h9v9h-9zM45 27h9v9h-9z" transform="matrix(-1.00274 -3.11045 12.32584 -3.97358 383.8 1217.5)"/></g>
<path fill="#fff" fill-rule="nonzero" d="M1033.4 716l21.3-16.8-4.2-5.4-16 12.7-4.2-5.4-16 12.7 4.2 5.3-5.3 4.2-12.6-16 5.3-4.2 4.2 5.3 16-12.6 4.2 5.3 16-12.6 4.2 5.3 16-12.6 8.5 10.6-16 12.7 4.2 5.3-21.4 16.9 4.2 5.3 21.4-16.8 4.2 5.3 16-12.7 8.4 10.7-16 12.7 4.2 5.3-16 12.6 4.3 5.4-16 12.6 4.2 5.3-5.4 4.2-16.8-21.3 5.3-4.2 4.2 5.3 16-12.6-4.2-5.3 16-12.7-4.2-5.3-21.3 16.8-4.3-5.3-16 12.7-8.4-10.7 16-12.7-4.2-5.3zM974.4 641.3l21.3-16.8-4.2-5.3-16 12.6-4.2-5.3-16 12.6 4.2 5.3-5.3 4.3-12.6-16 5.3-4.3 4.2 5.4 16-12.7 4.2 5.4 16-12.7 4.2 5.4 16-12.7 8.5 10.7-16 12.6 4.2 5.4-21.4 16.8 4.3 5.3 21.3-16.8 4.2 5.3 16-12.6 8.4 10.7-16 12.6 4.2 5.3-16 12.7 4.3 5.3-16 12.6 4.2 5.4-5.4 4.2-16.8-21.3 5.3-4.3 4.2 5.4 16-12.7-4.2-5.3 16-12.6-4.2-5.4-21.3 16.9-4.2-5.4-16 12.7-8.5-10.7 16-12.6-4.2-5.4zM957.8 576.5l4.2 5.3 10.7-8.4-12.6-16-5.4 4.2-4.2-5.3-5.3 4.2-4.2-5.3 16-12.7 33.7 42.7-5.4 4.2-4.2-5.3-10.6 8.4-4.2-5.3-5.4 4.2-4.2-5.4-10.7 8.5-4.2-5.4-5.3 4.3-4.2-5.4-10.7 8.4 12.7 16 5.3-4.2 4.2 5.4 5.3-4.2 4.2 5.3-16 12.6-33.7-42.6 5.4-4.3 4.2 5.4 10.7-8.4 4.2 5.3 5.3-4.2 4.2 5.3 10.7-8.4 4.2 5.3 5.3-4.2z"/></g></svg></div>
<div class="h">
<svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 150 240"><g transform="matrix(.4289 0 0 .4289 32 2)"><g id="h-larm"><path fill="#7c5439" d="M390 136v-22h-9v-6h6V97h6v-2h10v2h6v17h-2v35h-3v4h-43v-3h-4v-11h4v-3h29z" transform="matrix(-.32409 2.66829 -2.67357 -.32473 572 -705)"/></g><path fill="#00b0d8" d="M92 379v116h37v55H34V377l58 2z"/><path fill="#60422d" d="M34 473v-12h58v11l-58 1z"/><path fill="#60422d" fill-rule="nonzero" d="M39 161h55v44H38z"/><path fill="#60422d" fill-rule="nonzero" d="M118 346l1-134h-14v-15H36v14H22l-1 135h97z"/><path fill="#3d5070" fill-rule="nonzero" d="M23 381l84 1v-14h14v-22H24l-1 35z"/><path fill="#7c5439" fill-rule="nonzero" d="M122 84l1-57-90-8 6 135v15h27v14h56v-28H94v-15l28 1v-15l14 1V84h-14z"/><path fill="#fff" fill-rule="nonzero" d="M123 55H95v43h27l1-43z"/><path fill="#444445" d="M123 70h-14v14l14 1z"/><path fill="#18100b" fill-rule="nonzero" d="M40-2v9H26v15l-14-1-1 125h14v10h23l1-58-10-1V65h14V51h14v28h14V41h14V27h38V13h-12V5h-12v-6L40-2z"/><path fill="#617594" fill-rule="nonzero" d="M24 339h97v15l-97-1z"/><path fill="#00b0d8" d="M17 382h7v13h9v7h12v7h57v-10h13v-13h9v-79h-3v-9h-4v-35l-1-24h-7v-20h-6v-12h-6v-12H31v24h-8v26h-5l-1 137z"/><path fill="#60422d" d="M40 269v18h10v9h10v9h35v-9h8v-28h5v-22h-6v-19h-6v-14h-5v-14H50v7H40v18H29v45h11z"/><g id="h-rarm"><path fill="#825f48" d="M353 191v-6h1v-5h-10v-7h7v-12h6v-2h10v2h7v19h-3v38h-3v3h-10l-28-28 2-2-4-3 9-9 4 4 2-2 10 10z" transform="rotate(36 811 -856) scale(2.49923)"/></g></g></svg>
</div>
<div class="logo"><a href="https://undead.institute" target="_blank"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/1804713/UndeadInsti-LogoOnWhite.png" alt="Getting Braaains should be fun"></a></div>
.toggle-checkbox:checked ~ .h svg {
animation: 4s linear -0.75s jump-r forwards;
}
@keyframes jump-r {
0%, 25% {
transform: rotate(0);
}
35% {
transform: rotate(1deg);
}
45%, 65% {
transform: rotate(-1deg);
}
55%, 75% {
transform: rotate(3deg);
}
100% {
transform: rotate(90deg);
}
}
.toggle-checkbox:checked ~ .h {
animation: 4s linear -0.75s jump-t forwards;
}
@keyframes jump-t {
0%, 25% {
transform: translate(0,0);
}
35% {
transform: translate(0,1vw);
}
45%, 65% {
transform: translate(0, -1vw);
}
55%, 75% {
transform: translate(0, 1vw);
}
88% {
transform:translate(8vw,-5vw);
}
100% {
transform:translate(11vw,7.25vw);
}
}
.toggle-checkbox:checked ~ .h #h-rarm {
animation: 4s linear -0.75s rightarm forwards;
}
#h-rarm {
transform-origin: 30% 85%;
transform: rotate(0deg);
}
@keyframes rightarm {
0%, 25% {
transform: rotate(0);
}
35% {
transform: rotate(-5deg);
}
45%, 65% {
transform: rotate(5deg);
}
55%, 75% {
transform: rotate(-15deg);
}
80%, 100% {
transform: rotate(-120deg);
}
}
.toggle-checkbox:checked ~ .h #h-larm {
animation: 4s linear -0.75s leftarm forwards;
}
#h-larm {
transform-origin: 30% 85%;
transform: rotate(0);
}
@keyframes leftarm {
0%, 25% {
transform: rotate(0);
}
35% {
transform: rotate(-5deg);
}
45%, 65% {
transform: rotate(5deg);
}
55%, 75% {
transform: rotate(-15deg);
}
80%, 100% {
transform: rotate(-180deg);
}
}
.toggle-checkbox:checked ~ .ring #rope {
animation: 4s linear -0.75s ropespring forwards;
}
#rope {
transform-origin: center top;
transform: scaleY(1);
opacity: 1;
}
@keyframes ropespring {
0%, 25% {
transform: scaleY(1);
opacity: 1;
}
35% {
transform: scaleY(1.01);
}
45%, 65% {
transform: scaleY(0.99);
}
55%, 75% {
transform: scaleY(1.03);
opacity: 1;
}
80%, 100% {
transform: scale(1);
opacity: 0;
}
}
.ring {
width: 60vw;
position: absolute;
bottom: -9vw;
left: 20vw;
z-index: 100;
}
.z {
width: 19vw;
position: absolute;
left: 48vw;
bottom: 3vw;
transform-origin: bottom left;
transform: rotate(0);
z-index: 0;
}
.toggle-checkbox:checked ~ .z {
animation: 3s linear 0.65s zombiehit forwards;
}
@keyframes zombiehit {
0%, 85%, 100% {
transform: rotate(0);
}
90% {
transform: rotate(-20deg);
}
}
.h svg {
width: 13.25vw;
transform-origin: center bottom;
transform: translate(0,0) rotate(0);
z-index: 0;
}
.h {
width: 13.25vw;
position: absolute;
left: 21vw;
bottom: 14vw;
transform-origin: center center;
transform: translate(0,0) rotate(0);
z-index: 0;
}
body {
background-color: #D0EED0;
overflow: hidden;
}
.logo {
width: 100%;
max-width: 400px;
position: absolute;
top: 0;
right: 0;
}
.logo img {
width: 100%;
}
input{
display: none;
}
input:checked + label {
box-shadow: inset 3px 3px 2px #660000;
transform: translate(3px, 3px);
}
label {
font-size: 1.5em;
color: #FFF;
background-color: #960B0B;
width: 140px;
height: 30px;
text-align: center;
font-weight: bold;
display: block;
border-radius: 7px;
box-shadow: 3px 3px 0 #660000;
cursor: pointer;
}
Also see: Tab Triggers