cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              [[[https://codepen.io/thebabydino/pen/zEbVPO]]]

svg(viewBox=[-.5*w, -.5*d, w, d].join(' ')
		xmlns='http://www.w3.org/2000/svg')
	style
		//- using style+* so that it works fine in Edge too
		//- just 1 byte more than [d*=C] which causes problems
		| * {
		| 	fill: none;
		| 	stroke: #{darken};
		| 	stroke-width: #{2*sw}
		| }
		| style + * {
		| 	stroke: #{orange};
		| 	stroke-width: #{4*sw}
		| }
		| [r] { fill: #{orange} }
	- var pd = '', tmpo = [];
	- for(var i = 0; i < 2*sp; i++) {
		- var ca = i*.5*sbac + .5*Math.PI; //-current angle
		- var cr = i%2 ? srci : srco; //- current radius
		- var x = (cr*Math.cos(ca)).toFixed(e);
		- var y = (cr*Math.sin(ca)).toFixed(e);
		- var cv = [x, y]; //- current vertex point
		- pts.push(cv);
		- pd += (i%2 ? ` ${cv}` : `C${[cv, cv]}`);
		- if(i == (2*sp - 1)) { pd = `M${cv}${pd}` }
		- if(!(i%2)) { tmpo.push(cv) }
	- }
	//-rounded tips star
	path(d=`${pd}`)
	- for(var i = 0; i < sp; i++) { svo.push(tmpo[(i*sq)%sp]) }
	//-pentagram
	path(d=`M${svo}Z`)
	//-end and control points for the cubic curves
	- for(var i = 0; i < 2*sp; i++) {
		circle(cx=pts[i][0] != 0?pts[i][0]:null 
					 cy=pts[i][1] != 0?pts[i][1]:null r=(i%2?pr:pr1))
	- }
            
          
!
            
              body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: 0;
	height: 100vh
}

svg { display: block }
            
          
!
            
              // minimal SVG https://codepen.io/thebabydino/pen/EwEVgx
            
          
!
999px
Loading ..................

Console