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. You can use the CSS from another Pen by using it's URL and the proper URL extention.
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 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.
<div>
<a href="https://corenominal.org/" target="_blank">
<?xml version="1.0" encoding="UTF-8"?>
<svg id="logo" width="92px" height="89px" viewBox="0 0 92 89" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Man on a rock, floating in space, waving</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="logo" fill="#141414">
<path d="M35.2566616,18.706507 C15.8258716,18.706507 0.0367434565,34.4027028 0.0367434565,53.7191391 C0.0367434565,73.0355859 15.8258716,88.7324609 35.2566616,88.7324609 C54.6874621,88.7324609 70.4765797,73.0355859 70.4765797,53.7191391 C70.4765797,34.4027028 54.6874621,18.706507 35.2566616,18.706507 L35.2566616,18.706507 Z M35.2566616,22.1808964 C52.7986391,22.1808964 66.9816219,36.2803993 66.9816219,53.7191391 C66.9816219,71.157879 52.7986391,85.2580714 35.2566616,85.2580714 C17.7146841,85.2580714 3.53171185,71.157879 3.53171185,53.7191391 C3.53171185,36.2803993 17.7146841,22.1808964 35.2566616,22.1808964 Z" id="path4138-5-7"></path>
<path d="M81.7396393,0.17143944 C76.3239616,0.17143944 71.9114286,4.55799348 71.9114286,9.94180933 C71.9114286,15.3256147 76.3239616,19.7128583 81.7396393,19.7128583 C87.1553169,19.7128583 91.5678499,15.3256147 91.5678499,9.94180933 C91.5678499,4.55799348 87.1553169,0.17143944 81.7396393,0.17143944 Z M81.7396393,2.25606474 C86.022021,2.25606474 89.4708731,5.68461974 89.4708731,9.94180933 C89.4708731,14.1989885 86.022021,17.6282226 81.7396393,17.6282226 C77.457247,17.6282226 74.0084054,14.1989885 74.0084054,9.94180933 C74.0084054,5.68461974 77.457247,2.25606474 81.7396393,2.25606474 Z" id="path4172-8-2"></path>
<polygon id="path4174-2-6" points="74.4029476 15.7641291 64.9665571 24.1026616 66.3590837 25.6607187 75.7954742 17.3221757 74.4029476 15.7641291"></polygon>
<polygon id="waving-arm" points="66.0877354 8.11120099 64.2102313 9.0396328 69.83112 20.2779685 71.7087083 19.3502053"></polygon>
<polygon id="path4174-5-6-0-2" points="71.5550889 19.463825 70.651996 21.3455648 82.0454276 26.7532643 82.9485205 24.8715245"></polygon>
<polygon id="path4174-5-6-4-6-3" points="65.4425385 23.780358 62.0753567 35.8771149 64.095981 36.433219 67.4638354 24.3365666 65.4425385 23.780358"></polygon>
<polygon id="path4174-5-6-4-3-8-3" points="66.3310965 23.2489942 54.0946347 26.3413395 54.6113724 28.3615124 66.8471406 25.2691671"></polygon>
</g>
</g>
</svg>
</a>
</div>
body {
overflow: hidden;
}
div {
min-height: 100vh;
display:flex;
justify-content:center;
align-items:center;
}
$( '#logo' ).mouseover( function()
{
var position = 1;
function wave()
{
switch( position )
{
case 1:
$( '#waving-arm' ).attr( 'points', '67.5183995 7.42467755 65.6408954 8.35310936 71.2617841 19.5914451 73.1393724 18.6636819' );
$( '#waving-arm' ).attr( 'transform', 'translate(69.390134, 13.508061) rotate(15.000000) translate(-69.390134, -13.508061) ' );
break;
case 3:
$( '#waving-arm' ).attr( 'points', '63.1360752 10.130244 61.2585711 11.0586758 66.8794598 22.2970115 68.7570481 21.3692483' );
$( '#waving-arm' ).attr( 'transform', 'translate(65.007810, 16.213628) rotate(-29.000000) translate(-65.007810, -16.213628) ' );
break;
default:
$( '#waving-arm' ).attr( 'points', '66.0877354 8.11120099 64.2102313 9.0396328 69.83112 20.2779685 71.7087083 19.3502053' );
$( '#waving-arm' ).removeAttr( 'transform' );
}
position++;
if ( position === 5 )
position = 1;
foo = setTimeout( wave, 140 );
}
wave();
});
$( '#logo' ).mouseout( function()
{
clearTimeout( foo );
});
Also see: Tab Triggers