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="wrapper">
<svg xmlns="http://www.w3.org/2000/svg" id="svg2" viewBox="0 0 793 833" >
<g id="layer1" transform="translate(99.538 -106.566)">
<path id="form1" class="green" fill="#ccc" d="M533.197 348.441c12.972 88.237 70.317 100.636 90.165 162.082 19.848 61.445 42.735 146.568 34.435 185.118-8.3 38.55-40.45 95.1-54.7 113.2-14.25 18.1-107.95 96.8-175.6 109.4-67.65 12.6-152.357-23.87-229.984-42.747-77.627-18.878-26.27-100.998-71.26-154.919-44.99-53.92-160.706 8.516-155.356-66.434 5.35-74.95 22.278-103.776 9.4-154.7-12.877-50.923-60.8-105.297-71.7-145.3-10.9-40.003 31.4-110.5 64.2-143.4 32.8-32.9 152.85-83.85 215.1-73.6s10.667 18.522 122.6 52.8c111.934 34.278 209.729 70.264 222.7 158.5z"/>
<path id="form2" class="green" d="M568.48 354.57c12.29 40.85-.324 80.819-4.751 120.935-5.231 47.4 43.715 71.552 68.101 105.922 43.776 61.698 47.619 138.349 25.367 213.102-16.209 54.453-48.353 72.312-96.542 87.864-68.213 22.014-139.496 33.534-211.128 29.763-43.48-2.288-81.457 25.287-123.905 26.642-63.641 2.032-124.473-32.299-171.42-73.83C3.72 820.308-20.3 755.963-37.39 692.217c-19.328-72.103-23.655-151.273 11.768-219.026 21.266-40.676-24.82-67.86-49.826-92.625-35.376-35.034-3.6-138.426 50.46-155.8 113.082-6.947 153.004-48.926 249.023-22.296 100.574 46.524 307.373 38.682 344.445 152.1z"/>
<path id="form3" class="green" d="M175.195 162.435c96.71 2.64 148.81 39.152 187.384 81.168 38.575 42.016 134.387 56.23 186.268 89.185 51.88 32.955 47.596 74.718 38.687 131.44-8.908 56.723 80.072 9.259 60 152.388-20.071 143.13-65.114 115.727-88.287 181.895C481.35 955.703 353.98 909.5 260.934 875.368c-93.044-34.133-198.91 36.527-258.137 16.373C-56.43 871.588 12.868 775.694-8.46 717.953c-21.33-57.74-96.647-75.103-40.154-167.247C7.88 458.56-35.638 387.957-63.144 326.893c-27.505-61.064 141.628-167.1 238.339-164.458z"/>
</g>
</svg>
</div>
body {
background: #1d1d1d;
overflow:hidden;
}
svg {
display: block;
visibility:hidden;
overflow: visible;
height: 80vh;
margin-left: 50px;
margin-top: 50px;
}
.green{
fill:green;
}
#form2, #form3{
visibility:hidden;
}
TweenLite.set("svg", {visibility:"visible"})
var tl = new TimelineMax({repeat:-1, yoyo:true});
tl.to("#form1", 10, {morphSVG:"#form3", ease: Sine.easeOut})
.to("#form1", 10, {morphSVG:"#form2", ease: Sine.easeOut})
tl.timeScale(3)
//just for fun ...
TweenMax.to("#wrapper",5,{scaleX:1.5,transformOrigin:"left center", repeat:-1, yoyo:true, ease: Sine.easeOut});
TweenMax.to("#svg2",8,{height:'50vh', repeat:-1, yoyo:true, ease: Sine.easeOut});
TweenMax.to("#svg2",200,{rotation:360,transformOrigin:"ceneter center", repeat:-1, yoyo:true, ease: Sine.easeOut});
Also see: Tab Triggers