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.
<div id="background-wrap">
<div class="x x1"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x2"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x3"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x4"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x5"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x6"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x7"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x8"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x9"><div class="inner"><div class="bubble"></div></div></div>
<div class="x x10"><div class="inner"><div class="bubble"></div></div></div>
</div>
<svg class="jellyfish" viewBox="-100 -100 556 785" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Jellyfish</title>
<defs>
<filter id="turbulence-1">
<feTurbulence type="fractalNoise" baseFrequency="0.001" numOctaves="2" data-filterId="3" />
<feDisplacementMap xChannelSelector="R" yChannelSelector="G" in="SourceGraphic" scale="100" />
</filter>
<filter id="turbulence-2">
<feTurbulence type="fractalNoise" baseFrequency="0.0015" numOctaves="2" data-filterId="3" />
<feDisplacementMap xChannelSelector="R" yChannelSelector="G" in="SourceGraphic" scale="100" />
</filter>
<filter id="turbulence-3">
<feTurbulence type="fractalNoise" baseFrequency="0.002" numOctaves="2" data-filterId="3" />
<feDisplacementMap xChannelSelector="R" yChannelSelector="G" in="SourceGraphic" scale="100" />
</filter>
<filter id="turbulence-4">
<feTurbulence type="fractalNoise" baseFrequency="0.0025" numOctaves="2" data-filterId="3" />
<feDisplacementMap xChannelSelector="R" yChannelSelector="G" in="SourceGraphic" scale="100" />
</filter>
<filter id="turbulence-5">
<feTurbulence type="fractalNoise" baseFrequency="0.003" numOctaves="2" data-filterId="3" />
<feDisplacementMap xChannelSelector="R" yChannelSelector="G" in="SourceGraphic" scale="100" />
</filter>
<radialGradient cx="52.8919822%" cy="37.1312567%" fx="52.8919822%" fy="37.1312567%" r="102.335451%" gradientTransform="translate(0.528920,0.371313),scale(0.337875,1.000000),rotate(77.735795),translate(-0.528920,-0.371313)" id="radialGradient-1">
<stop stop-color="#B45082" offset="0%"></stop>
<stop stop-color="#CF4A8D" offset="0%"></stop>
<stop stop-color="#884F6C" offset="100%"></stop>
</radialGradient>
<radialGradient cx="50%" cy="1.20618666%" fx="50%" fy="1.20618666%" r="95.8716333%" gradientTransform="translate(0.500000,0.012062),scale(0.576923,1.000000),rotate(85.798877),translate(-0.500000,-0.012062)" id="radialGradient-2">
<stop stop-color="#FF5EAF" offset="0%"></stop>
<stop stop-color="#BF2547" offset="100%"></stop>
</radialGradient>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Desktop-HD" transform="translate(-502.000000, -201.000000)">
<g id="Group-2" transform="translate(512.000000, 211.000000)">
<path class="tentacle" d="M113.5,204.5 C90.1835023,277.765192 77.8028382,314.608942 76.3580079,335.03125 C72.5804209,388.426479 99.4101176,423.051732 90.3843355,454.304 C82.1558109,482.795719 43.9168527,496.408367 25,528.401492 C15.8418761,543.890168 7.50854276,573.58967 0,617.5" id="tentacle-left" stroke="#AF335D" stroke-width="10" stroke-linecap="round"></path>
<path class="tentacle" d="M321.706715,198.306678 C277.128036,258.890751 253.457516,300.797001 250.695153,324.025428 C243.472806,384.757406 294.768349,424.140327 277.512008,459.686799 C261.779939,492.093412 188.671094,507.576499 152.504072,543.965626 C134.994707,561.582517 119.062255,595.362868 104.706715,645.306678" id="tentacle-center" stroke="#AF335D" stroke-width="10" stroke-linecap="round" transform="translate(213.206715, 421.806678) rotate(-30.000000) translate(-213.206715, -421.806678) "></path>
<path class="tentacle" d="M359.784264,141.43842 C340.268253,188.604544 329.905583,221.229544 328.696253,239.31342 C325.534396,286.594692 347.990971,317.255221 340.436351,344.928985 C333.54904,370.158294 301.542864,382.212241 285.709375,410.542031 C278.043984,424.257195 271.068948,450.555991 264.784264,489.43842" id="tentacle-right" stroke="#AF335D" stroke-width="10" stroke-linecap="round" transform="translate(312.284264, 315.438420) rotate(-30.000000) translate(-312.284264, -315.438420) "></path>
<g id="body">
<path d="M208.5,212.083775 C309.844252,212.083775 392,251.257956 392,198.153722 C392,145.049488 309.844252,102 208.5,102 C107.155748,102 25,145.049488 25,198.153722 C25,251.257956 107.155748,212.083775 208.5,212.083775 Z" id="body-inner" fill="url(#radialGradient-1)"></path>
<path d="M208,218.065372 C179.309685,218.065372 152.610497,222.301538 114.13249,231.398546 C109.980399,232.380188 93.8901735,236.260654 90.0129711,237.175351 C81.0710195,239.284906 74.2467799,240.780084 67.951037,241.967199 C52.2466132,244.928399 40.4364784,245.790864 30.5677903,244.264843 C6.52746158,240.547425 -5,222.425351 -5,186.103978 C-5,80.4285638 90.4796424,-5 208,-5 C325.520358,-5 421,80.4285638 421,186.103978 C421,222.425351 409.472538,240.547425 385.43221,244.264843 C375.563522,245.790864 363.753387,244.928399 348.048963,241.967199 C341.75322,240.780084 334.928981,239.284906 325.987029,237.175351 C322.109827,236.260654 306.019601,232.380188 301.86751,231.398546 C263.389503,222.301538 236.690315,218.065372 208,218.065372 Z" id="body-outer" stroke-opacity="0.1" stroke="#000000" stroke-width="10" fill-opacity="0.8" fill="url(#radialGradient-2)"></path>
</g>
</g>
</g>
</g>
</svg>
html {
background-image: linear-gradient(to top, black, gray);
}
body {
display: grid;
min-height: 100vh;
justify-content: center;
align-content: center;
background-image: linear-gradient(
to right top,
rgba(50, 157, 209, 0.5),
rgba(76, 188, 136, 0.75)
);
margin: 0;
}
#body-outer {
opacity: 0.6;
}
#background-wrap {
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
opacity: 0.75;
z-index: 2;
}
.bubble {
border-radius: 50%;
box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1),
inset 0px 10px 30px 5px rgba(255, 255, 255, 1);
height: 200px;
width: 200px;
}
.bubble:after {
background: radial-gradient(
ellipse at center,
rgba(255, 255, 255, 0.5) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
content: "";
height: 180px;
left: 10px;
position: absolute;
width: 180px;
}
@keyframes animateBubble {
0% {
transform: translateY(300vh);
opacity: 0.75;
}
100% {
transform: translateY(-200vh);
opacity: 0;
}
}
@keyframes sideWays {
0% {
transform: translateX(-50px);
}
100% {
transform: translateX(50px);
}
}
.x {
position: fixed;
}
.x1 {
.inner {
animation: sideWays 2s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 25s linear infinite;
}
left: -5%;
top: 5%;
transform: scale(0.6);
}
.x2 {
.inner {
animation: sideWays 4s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 20s linear infinite;
}
left: 5%;
top: 80%;
transform: scale(0.4);
}
.x3 {
.inner {
animation: sideWays 2s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 28s linear infinite;
}
left: 10%;
top: 40%;
transform: scale(0.7);
}
.x4 {
.inner {
animation: sideWays 3s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 22s linear infinite;
}
left: 20%;
top: 0;
transform: scale(0.3);
}
.x5 {
.inner {
animation: sideWays 4s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 29s linear infinite;
}
left: 30%;
top: 50%;
transform: scale(0.5);
}
.x6 {
.inner {
animation: sideWays 2s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 21s linear infinite;
}
left: 50%;
top: 0;
transform: scale(0.8);
}
.x7 {
.inner {
animation: sideWays 2s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 20s linear infinite;
}
left: 65%;
top: 70%;
z-index: 9;
transform: scale(0.4);
}
.x8 {
.inner {
animation: sideWays 4s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 22s linear infinite;
}
left: 80%;
top: 15%;
transform: scale(0.35);
}
.x9 {
.inner {
animation: sideWays 4s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 29s linear infinite;
}
left: 90%;
top: 50%;
transform: scale(0.6);
}
.x10 {
.inner {
animation: sideWays 2s ease-in-out infinite alternate;
}
.bubble {
animation: animateBubble 26s linear infinite;
}
left: 80%;
top: 80%;
transform: scale(0.3);
}
.jellyfish {
z-index: 0;
height: 500px;
transform-origin: center;
animation: squoosh 3s ease-in-out infinite;
animation-direction: alternate;
filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, 0.2));
}
.tentacle {
animation-direction: alternate;
animation: squigglevision 0.5s infinite alternate;
}
@keyframes squoosh {
0% {
transform: scaleX(1) scaleY(0.95) translateY(5%);
}
100% {
transform: scaleX(0.9) scaleY(1.05) translateY(-2.5%);
}
}
@keyframes squigglevision {
0% {
filter: url("#turbulence-1");
}
25% {
filter: url("#turbulence-2");
}
50% {
filter: url("#turbulence-3");
}
75% {
filter: url("#turbulence-4");
}
100% {
filter: url("#turbulence-5");
}
}
Also see: Tab Triggers