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/thesbacbydino/pen/zEbVPO]]]

svg(viewBox=[-.5*w, -.5*d, w, d].join(' ')
		xmlns='http://www.w3.org/2000/svg')
	style
		| * { fill: none; stroke: #333; stroke-width: #{2*sw} }
		| [r='#{+sri.toFixed(e)}'] { opacity: .5 }
		| [r='#{+sri.toFixed(e)}'], [d] + [d] { stroke-width: #{4*sw} }
		| [d] + [d] { stroke: #{tomato} }
		| [r] + [d] { stroke: #{purple}; stroke-width: #{3*sw} }
		| [r] ~ [r] { fill: #{orange} }
	- var pd = '';
	- for(var i = 0; i < sp; i++) {
		- var ca = i*sbac;
		- var cao = ca + .5*Math.PI, cab = sq*ca + .5*Math.PI;
		- var cos = Math.cos(cao), sin = Math.sin(cao);
		- pts.push([+(srci*cos).toFixed(e), +(-srci*sin).toFixed(e)]);
		- svo.push([+(srco*Math.cos(cab)).toFixed(e), +(srco*Math.sin(cab)).toFixed(e)]);
		- svi.push([+(sri*cos).toFixed(e), +(sri*sin).toFixed(e)]);
		- pd += ((i%2?' ':'M') + `${svi[i]}` + (i%2?'':' 0 0'));
	- }
	path(d=`M${svo.join(' ')}z`)
	path(d=`M${pts.join(' ')}z`)
	circle(r=+sri.toFixed(e))
	path(d=pd)
	- for(var i = 0; i < sp; i++) {
		circle(cx=svo[i][0] != 0 ? svo[i][0] : null 
					 cy=svo[i][1] != 0 ? svo[i][1] : null 
					 r=pr1)
		circle(cx=svi[i][0] != 0 ? svi[i][0] : null 
					 cy=svi[i][1] != 0 ? svi[i][1] : null 
					 r=pr1)
		circle(cx=pts[i][0] != 0 ? pts[i][0] : null 
					 cy=pts[i][1] != 0 ? pts[i][1] : null 
					 r=pr)
	- }
	circle(r=pr)

// minimal SVG
<svg viewBox='-2500 -1250 5000 2500' xmlns='http://www.w3.org/2000/svg'><style>*{fill:none;stroke:#333;stroke-width:10}[r='375']{opacity:.5}[r='375'],[d]+[d]{stroke-width:20}[d]+[d]{stroke:#b53}[r]+[d]{stroke:#95a;stroke-width:15}[r]~[r]{fill:#f90}</style><path d='M0 1213-713-981 1153 375-1153 375 713-981z'/><path d='M0-463-440-143-272 375 272 375 440-143z'/><circle r='375'/><path d='M0 375 0 0-356 116M-220-303 0 0 220-303M356 116 0 0'/><circle cy='1213' r='18'/><circle cy='375' r='18'/><circle cy='-463' r='25'/><circle cx='-713' cy='-981' r='18'/><circle cx='-356' cy='116' r='18'/><circle cx='-440' cy='-143' r='25'/><circle cx='1153' cy='375' r='18'/><circle cx='-220' cy='-303' r='18'/><circle cx='-272' cy='375' r='25'/><circle cx='-1153' cy='375' r='18'/><circle cx='220' cy='-303' r='18'/><circle cx='272' cy='375' r='25'/><circle cx='713' cy='-981' r='18'/><circle cx='356' cy='116' r='18'/><circle cx='440' cy='-143' r='25'/><circle r='25'/></svg>
            
          
!
            
              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/YraqOy
            
          
!
999px
Loading ..................

Console