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.
const frame = new Frame("fit", 900, 850, purple, darker);
frame.on("ready", ()=>{ // ES6 Arrow Function - similar to function(){}
zog("ready from ZIM Frame"); // logs in console (F12 - choose console)
// often need below - so consider it part of the template
let stage = frame.stage;
let stageW = frame.width;
let stageH = frame.height;
// REFERENCES for ZIM at http://zimjs.com
// see http://zimjs.com/learn.html for video and code tutorials
// see http://zimjs.com/docs.html for documentation
// see https://www.youtube.com/watch?v=pUjHFptXspM for INTRO to ZIM
// see https://www.youtube.com/watch?v=v7OT0YrDWiY for INTRO to CODE
// CODE HERE
new pizzazz.makePattern({
type:"slants",
colors:white,
size:50,
cols:40,
rows:35
}).addTo().alp(.1);
new Blob({
borderColor:white,
borderWidth:6,
color:green,
controlType:"straight",
points:"M220.284, 274.127 C222.69, 292.729 236.31, 327.393 222.104, 343.729 C199.204, 370.062 204.648, 299.718 205.313, 294.403 C206.37599999999998, 285.913 206.538, 234.938 186.057, 258.766 C184.554, 260.516 151.532, 316.948 149.545, 292.699 C148.943, 285.361 165.247, 263.296 156.07, 258.172 C145.273, 252.144 129.462, 266.782 122.903, 273.109 C118.864, 277 88, 308.363 84.866, 290.225 C81.299, 269.623 109.589, 261.834 122.985, 254.777 C133.129, 249.433 155.995, 238.545 154.779, 223.568 C154.115, 215.396 135.042, 213.398 129, 210.94 C97.966, 198.316 176.171, 199.402 160.49, 175.281 C151.785, 161.888 133.318, 160.47 123.697, 148.435 C114.608, 137.066 142.599, 137.991 147.305, 139.401 C165.688, 144.911 174.376, 144.194 180.763, 125.275 C185.332, 111.74 201.271, 101.134 201.022, 122.936 C200.963, 128.247 194.075, 156.565 204.61, 157.111 C217.97, 157.803 224.695, 133.092 227.11, 124.507 C230.276, 113.253 234.811, 76.297 254.02, 81.824 C269.047, 86.148 242.151, 128.931 244.391, 140.223 C250.991, 173.48 296.982, 116.8745 303.12, 111.026 C311.089, 103.41 324.251, 91.402 336.431, 96.705 C352.83, 103.845 351.81, 131.343 341.617, 142.953 C330.393, 155.737 256.125, 167.755 283.709, 195.747 C289.606, 201.732 326.715, 216.353 321.07, 227.267 C313.798, 241.327 288.523, 229.944 276.784, 232.905 C259.242, 237.334 270.387, 261.316 273.851, 271.943 C278.42, 285.957 275.291, 320.994 258.381, 294.742 C250.602, 282.665 254.705, 257.742 239.739, 250.72 C224.742, 243.687 218.352, 268.723 221.061, 279.048Z"})
.addTo()
.transformPoints("scale", 2)
.sha();
new Label({text:"ZIM - Blob with SVG input", color:white}).pos(30,30)
stage.update(); // this is needed to show any changes
// DOCS FOR ITEMS USED
// https://zimjs.com/docs.html?item=Frame
// https://zimjs.com/docs.html?item=Blob
// https://zimjs.com/docs.html?item=Label
// https://zimjs.com/docs.html?item=sha
// https://zimjs.com/docs.html?item=pos
// https://zimjs.com/docs.html?item=alp
// https://zimjs.com/docs.html?item=addTo
// https://zimjs.com/docs.html?item=transformPoints
// https://zimjs.com/docs.html?item=zog
// FOOTER
// Please see a greeting message - then come visit us at ZIM https://zimjs.com
createGreet();
// call remote script to make ZIM Foundation for Creative Coding icon
createIcon();
}); // end of ready
Also see: Tab Triggers