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.
<body>
<div id="svg_wrap">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" width="640" height="480">
<g>
<path class='path' id="svg_4" d="m575.790733,231.479953c-25.218287,-3.980384 -51.465463,-6.601132 -72.77817,-7.310507l-3.758596,-0.118229c0.860907,-1.773438 1.511837,-2.975436 1.721815,-3.152779c0.46195,-0.354688 0.83991,-1.852258 0.881905,-3.310418c0,-0.8079 0.377959,-3.428648 0.965896,-6.896705c5.774379,0.197049 13.438554,0.354688 21.795655,0.413802c32.273528,0.236458 66.037895,2.679863 89.198403,6.522312c13.795516,2.285765 18.352026,2.206946 8.168121,-0.118229c-10.309891,-2.34488 -40.882602,-5.793232 -65.239981,-7.290802c-16.35724,-1.044358 -39.811717,-1.438456 -53.62823,-1.221702c0.398957,-2.246355 0.860907,-4.748874 1.343855,-7.310507c1.95279,-9.91155 2.60372,-19.882215 2.645715,-39.725021c0.041995,-30.779009 -1.721815,-39.252104 -12.409665,-59.607236c-4.346532,-8.315456 -9.260004,-15.3698 -15.202364,-21.754178c5.186442,-14.364851 5.060456,-36.611651 -0.314966,-56.119474c-4.430523,-16.000356 -5.984356,-17.025009 -21.438693,-13.951049c-13.10259,2.620748 -23.601461,6.18733 -37.061013,12.552003c-6.362315,3.014845 -15.139371,7.704605 -21.501687,11.389416c-16.588215,-5.477954 -33.74337,-9.103651 -52.0534,-11.054433c-18.562003,-1.970487 -64.064108,-0.867014 -80.21137,1.931077c-15.790301,2.738977 -30.005772,6.088805 -42.877387,10.069189c-6.425309,-3.724221 -15.748306,-8.748963 -22.40459,-11.901742c-13.522545,-6.384378 -24.021416,-9.931255 -37.166001,-12.552003c-15.412342,-3.093665 -17.00817,-2.049307 -21.417696,13.951049c-5.459413,19.763986 -5.501408,42.385179 -0.104989,56.71062c0.629932,1.635504 1.007892,2.798092 1.154876,3.704516c-21.879646,25.852791 -29.018878,54.779543 -24.273388,95.154825c1.238867,10.522401 3.149661,20.177788 5.816374,29.025276c-13.963498,-0.078819 -33.827361,0.394097 -48.168818,1.261112c-24.399375,1.517275 -54.972086,4.926218 -65.281977,7.271098c-10.162907,2.325175 -5.648392,2.403994 8.168121,0.137934c23.160508,-3.822745 56.945873,-6.305559 89.198403,-6.522312c6.089345,-0.019705 11.779733,-0.137934 16.672206,-0.256163c1.469842,4.670055 3.149661,9.123356 5.060456,13.359903l-0.146984,0.019705c-21.312707,0.689671 -47.538885,3.310418 -72.757172,7.290802c-18.918965,2.975436 -46.84596,8.926307 -50.10061,10.640631c-3.422632,1.793143 -0.629932,1.399046 14.026491,-2.088716c26.730124,-6.344969 61.481385,-11.212072 104.526754,-14.60131l4.808483,-0.394097c9.239006,20.138379 23.475474,35.508178 43.59131,47.48874c12.304676,7.349917 32.021555,14.896883 41.953486,16.079175c2.729706,0.315278 10.666852,1.852258 17.638102,3.389238c6.992248,1.53698 20.661777,3.84245 30.362733,5.162676l0.230975,0c-0.18898,0.118229 -0.356962,0.197049 -0.524944,0.315278c-11.758735,5.734118 -19.401913,14.660424 -24.546359,28.709998c-2.309752,0.650261 -5.186442,1.53698 -8.294108,2.541928c-11.107805,3.546877 -15.43334,4.275957 -26.688129,4.354777c-11.674744,0.078819 -14.446446,-0.394097 -21.417696,-3.468057c-10.141909,-4.433596 -19.590892,-12.591413 -25.890215,-22.325619c-10.519868,-16.276224 -28.703912,-27.783869 -43.864281,-27.783869c-12.955606,0 -15.412342,4.926218 -6.047349,12.118496c14.110482,10.817974 24.651348,21.852703 28.976882,30.286388c2.435738,4.729169 6.173336,12.039676 8.336103,16.236814c2.288754,4.473006 7.181227,10.542106 11.842726,14.739244c10.960821,9.813026 21.543682,14.502785 37.333983,16.709731c10.582861,1.45816 13.186581,1.45816 25.680237,-0.03941c6.026352,-0.689671 11.107805,-1.49757 15.664315,-2.502519c0,4.807989 0,10.345058 0,16.847665c0,34.798803 -0.440953,45.99117 -1.910794,49.262179c-2.771702,6.226739 -8.987033,12.630823 -15.034382,15.507734c-6.026352,2.876911 -7.895151,6.049396 -5.354424,8.965717c1.406849,1.57639 4.115557,1.852258 13.207579,1.300522c17.260143,-1.004948 29.459831,-6.995229 35.675162,-17.557041c1.994785,-3.389238 2.456736,-10.207123 3.086668,-45.675892c0.671928,-38.483614 0.965896,-42.18813 3.632609,-47.685789c1.616826,-3.271009 3.947575,-6.817886 5.249435,-7.783424c2.183765,-1.694619 2.330749,1.655209 2.330749,47.685789c-0.020998,50.799159 -0.566939,56.927374 -5.984356,66.70099c-1.217869,2.22665 -3.52762,5.123267 -5.144447,6.502608c-2.834695,2.423699 -4.031566,8.630734 -2.057779,10.502697c3.25465,3.03455 19.569895,-1.734029 28.472937,-8.315456c15.160369,-11.271187 16.966175,-20.591591 17.092161,-87.903432l0.062993,-39.488563l4.598505,0.413802l4.598505,0.394097l0.755919,51.646468c0.860907,58.149076 0.986894,58.996385 11.52776,70.228162c5.984356,6.344969 12.010708,9.852436 21.816653,12.591413c13.123588,3.704516 17.071163,-2.009897 8.252112,-11.921447c-9.595968,-10.778565 -10.057918,-14.896883 -9.532974,-78.701257c0.356962,-40.907313 0.356962,-40.907313 3.170659,-38.523024c5.921363,5.044447 7.055241,13.320493 7.055241,51.685878c0,47.646379 1.448844,52.1785 19.380915,60.493956c8.378099,3.84245 10.729846,4.315367 21.459691,4.354777c11.422771,0.03941 12.115697,-0.118229 12.535651,-2.916321c0.356962,-2.26606 -1.049887,-3.80304 -6.383313,-6.857295c-6.992248,-4.039499 -11.842726,-9.202175 -14.887398,-15.704783c-1.154876,-2.502519 -1.931792,-18.896972 -2.456736,-52.651417c-0.755919,-47.153758 -0.923901,-49.301589 -4.052564,-56.690915c-4.220546,-9.931255 -10.666852,-17.773794 -18.834974,-22.97588c-2.120772,-1.300522 -4.241544,-2.384289 -6.992248,-3.192189c3.380636,-0.315278 6.656284,-0.650261 9.826943,-1.083768c33.008449,-4.118318 50.457571,-7.546966 64.463065,-12.630823c29.627812,-10.699745 49.659657,-28.473539 60.515489,-53.67607c0.965896,-2.246355 1.931792,-4.374481 2.750704,-6.088805l8.357101,0.650261c43.066367,3.408943 77.817628,8.276046 104.547752,14.64072c14.656423,3.487762 17.449123,3.901565 14.026491,2.069012c-3.191657,-1.674914 -31.118652,-7.60608 -50.016619,-10.581516zm-126.280414,-0.610851c-4.892474,10.088894 -18.541005,23.0547 -29.564819,28.138557c-10.87683,5.044447 -27.926995,8.886897 -47.244917,10.71945c-13.207579,1.261112 -86.867654,1.635504 -99.025346,0.512327c-40.252669,-3.704516 -62.804243,-10.975613 -79.434454,-25.537513c-15.748306,-13.83282 -23.097515,-32.611562 -21.816653,-55.725377c0.818912,-14.463376 4.535512,-23.547321 14.257466,-34.58205c8.840049,-10.049484 18.142048,-16.256519 29.102869,-19.409298c9.176013,-2.640453 37.333983,-2.876911 75.19291,-0.591146c16.7352,1.004948 30.572711,1.004948 47.286913,0c39.601739,-2.34488 66.037895,-2.088716 75.801845,0.748785c15.349349,4.453301 29.333844,16.433863 37.73294,32.394809c3.779593,7.133163 4.514514,10.167714 5.060456,21.182737c0.755919,15.172751 -2.036781,31.291336 -7.349209,42.14872zm-199.688516,-65.144305c-22.530576,-3.704516 -35.402191,32.493333 -18.12105,50.976503c8.210117,8.768668 15.496333,10.207123 24.609352,4.886808c8.441092,-4.945923 13.018599,-14.187507 13.018599,-26.168069c0,-15.980651 -7.748166,-27.724754 -19.506901,-29.695241zm136.758287,2.167536c-22.530576,-3.704516 -35.423189,32.453923 -18.142048,50.956798c8.231114,8.768668 15.496333,10.226828 24.63035,4.867103c8.420094,-4.926218 13.018599,-14.187507 13.018599,-26.168069c0,-15.921536 -7.748166,-27.705049 -19.506901,-29.655832zm-60.59948,71.173996c-0.482948,1.45816 -2.834695,3.625696 -5.20744,4.788284c-6.005354,2.896616 -10.330889,1.891668 -16.672206,-3.527172c-3.926578,-3.330123 -5.711386,-5.083857 -6.908257,-1.596095c-1.11288,3.231599 5.879367,9.714502 11.275787,11.704694c4.955467,1.852258 8.504085,1.911373 13.879507,-0.197049c5.333426,-2.088716 9.994925,-7.704605 9.994925,-11.350006c0,-3.389238 -5.186442,-3.231599 -6.362315,0.177344zm-6.656284,-11.330301c3.422632,-2.837501 4.199548,-8.670143 0.923901,-11.763808s-9.931931,-2.620748 -12.535651,0.847309c-3.023675,4.059204 -1.406849,7.152868 0.755919,10.443582c3.359639,2.443404 7.874153,2.936026 10.855832,0.472917z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="transparent"/>
</g>
</svg>
</div>
</body>
//colors
$c-purple: rgb(22, 20, 30);
$c-red: rgb(214, 62, 62);
$c-blue: rgb(94, 152, 186);
$c-black: rgb(34, 34, 34);
$c-dark: rgb(17, 17, 17);
$c-white: rgb(255, 246, 229);
$c-rt-red: rgb(191, 8, 0);
$c-rt-white: rgb(255, 255, 255);
html,
body {
min-height: 100vh;
min-width: 100vw;
overflow-x: hidden;
padding: 0;
margin: 0;
background-color: $c-black;
#svg_wrap {
width: 640px;
height: auto;
margin: 50px auto;
}
.path {
stroke-dasharray: 4881;
stroke-dashoffset: 4881;
animation: dash 4s linear forwards;
animation-iteration-count: 3;
animation-direction: alternate;
}
@keyframes dash {
from {
stroke: $c-red;
}
to {
stroke: $c-blue;
stroke-dashoffset: 0;
}
}
}
var path = document.querySelector('.path');
var length = path.getTotalLength();
Also see: Tab Triggers