JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
HTML Settings
Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
<ot-site>
<ot-head>
I render in head.
</ot-head>
<ot-menu>
I render in menu.
</ot-menu>
<ot-body>
I render in body.
</ot-body>
</ot-site>
<!-- not registering custom elements in this demo -->
// unfortunately, unless we're going to use positioning (bleh)
// we have to reset margin/padding and set height to cooperate with ot-site
html,body{margin:0;padding:0;height:100%;}
// get the shadow-host-to-be
// make it a shadow host
// by creating a shadow root
var otSite = document.querySelector("ot-site");
otSite.createShadowRoot();
// put some elements in it the old-fashioned way
otSite.shadowRoot.innerHTML = `
<div id="site">
<header>
<svg class="logo" viewBox="0 0 608.5 135">
<path class="gui-logo--text" fill="currentColor" d="M118.5 0C81.3 0 51 30.2 51 67.5c0 37.3 30.2 67.5 67.5 67.5 37.3 0 67.5-30.2 67.5-67.5C186 30.2 155.8 0 118.5 0zM118.5 84.4c-9.3 0-16.9-7.6-16.9-16.9 0-9.3 7.6-16.9 16.9-16.9s16.9 7.6 16.9 16.9C135.4 76.8 127.8 84.4 118.5 84.4zM0 67.5c0-9.3 7.6-16.9 16.9-16.9 9.3 0 16.9 7.6 16.9 16.9 0 9.3-7.6 16.9-16.9 16.9C7.6 84.4 0 76.8 0 67.5"/>
<path class="gui-logo--text" fill="currentColor" d="M347.3 54.6c10 0 17.7 7.4 17.7 17.9 0 0.6-0.1 1.9-0.2 2.5 -0.1 1-1 1.8-1.8 1.8h-24.7c0.1 4.8 4 8.9 9.6 8.9 3.8 0 6.5-1.4 8.3-2.8 0.9-0.8 1.9-0.8 2.5 0l3.3 4.3c0.7 0.8 0.8 1.7-0.2 2.5 -3.3 2.8-8.1 5.3-14.4 5.3 -11.5 0-19.5-9.2-19.5-20.2C327.9 63.8 335.9 54.6 347.3 54.6zM354.5 69.8c-0.2-3.8-3.2-6.7-7.4-6.7 -4.7 0-7.7 2.8-8.2 6.7H354.5zM448 39.7h-39.3c-0.9 0-1.6 0.8-1.6 1.6v6.8c0 0.8 0.7 1.6 1.6 1.6h14.2v42.7c0 0.8 0.8 1.6 1.6 1.6h7.8c0.8 0 1.6-0.8 1.6-1.6V49.7H448c0.9 0 1.6-0.8 1.6-1.6v-6.8C449.6 40.4 448.9 39.7 448 39.7zM507.1 54.6c-3.8 0-7.7 0.9-9.4 1.7V41.5c0-0.9-0.8-1.8-1.8-1.8H489c-0.9 0-1.8 0.9-1.8 1.8v50.6c0 1 0.9 1.8 1.8 1.8h2.9c0.1 0 0.1 0 0.2 0h0.8c1 0 1.9-0.8 1.9-1.8v-2.9l0-0.1c0 0 4.4 5.8 12.9 5.8 10.5 0 18.1-9.2 18.1-20.2C525.8 63.4 518.5 54.6 507.1 54.6zM506.1 85.4c-5 0-7.7-3.2-8.5-5.3V66.2c0 0 3.2-2.2 8-2.2 6.3 0 9.6 5.2 9.6 10.6C515.2 80.1 512.2 85.4 506.1 85.4zM571.5 54.6c10 0 17.7 7.4 17.7 17.9 0 0.6-0.1 1.9-0.2 2.5 -0.1 1-1 1.8-1.8 1.8h-24.7c0.1 4.8 4 8.9 9.6 8.9 3.8 0 6.5-1.4 8.3-2.8 0.9-0.8 1.9-0.8 2.5 0l3.3 4.3c0.7 0.8 0.8 1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0.5 1.4-3.5 4.1-6.9 4.1 -3.6 0-5.6-2.2-5.6-5.4 0-3.4 2.4-5.5 6.8-5.5 3.1 0 5.7 1.2 5.7 1.2V83zM247.6 39.7c-15.2 0-27.6 12.5-27.6 27.8 0 15.5 12.1 27.6 27.6 27.6 15.5 0 27.7-12.1 27.7-27.6C275.3 52.2 262.9 39.7 247.6 39.7zM247.6 50.5c9.2 0 17 7.8 17 17 0 9.3-7.6 16.9-17 16.9 -9.3 0-16.9-7.6-16.9-16.9C230.7 58.1 238.3 50.5 247.6 50.5zM545.2 94c1 0 1.8-0.8 1.8-1.8l0-6.8c0-1-0.8-1.8-1.8-1.8l-0.3 0c-0.8 0-1.7-0.8-1.7-1.7l0-0.3V41.7c0-0.9-0.9-1.8-1.8-1.8h-6.8c-0.9 0-1.8 0.9-1.8 1.8v44.6l0 1.2c0 3.3 3.3 6.6 6.6 6.6L545.2 94zM592.7 56.2h-3.1v-1.6h8.1v1.6h-3.1V64h-1.9V56.2zM599.2 54.6h2.3l1.5 3.5 0.9 2.4h0.1l0.9-2.4 1.4-3.5h2.2V64h-1.7v-4.2l0.2-3.2h-0.1l-2.3 5.9h-1.5l-2.3-5.9h-0.1l0.2 3.2V64h-1.7V54.6z"/>
</svg>
<content select="ot-head" />
</header>
<nav>
<content select="ot-menu" />
</nav>
<main>
<content select="ot-body" />
</main>
<footer>
© 2015 OpenTable, Inc.
</footer>
</div>
<style>@import "https://codepen.io/morewry/pen/xbzdJB.css";</style>
`;
Also see: Tab Triggers