wind-barbs
Version:
A small utility to generate wind barb SVGs
1 lines • 2.38 kB
JavaScript
import*as t from"react";var e={729:(t,e,r)=>{r.d(e,{A:()=>c});const n={color:"#000000",rotationPoint:"stem"},o=Number(18)/2,i=Number(25)/2,a="2",s=2.9,l=6.85,c=(t,e=0,r)=>{const c=5*Math.round(t/5),{color:p=n.color,rotationPoint:d=n.rotationPoint}=r||{},h={attr:{viewBox:"0 0 18 25",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${e}deg)`,transformOrigin:"stem"===d?"bottom center":"center center",height:"100%"}},children:[]};if(c<3)return h.children=[{type:"circle",attr:{cx:o.toString(),cy:i.toString(),r:5..toString(),stroke:p,strokeWidth:a,fill:"none"}}],h;let u=s,g=c;if(c>=50||c<8?h.children.push({type:"polyline",attr:{points:`${o},25 ${o},2.9`,fill:"none",stroke:p,strokeWidth:a}}):(h.children.push({type:"polyline",attr:{points:`${o},25 ${o},3.9 17.7,0.95`,fill:"none",stroke:p,strokeWidth:a}}),g-=10,u=l),c>=3&&c<8)return u=l,h.children.push({type:"line",attr:{x1:o.toString(),y1:u.toString(),x2:13.35.toString(),y2:(u-1.45).toString(),stroke:p,strokeWidth:a}}),h;for(;g>=50;)h.children.push({type:"path",attr:{d:`M${o},${u} \n L15,${u+2} \n L${o},${u+4} \n Z`,fill:p,stroke:p,strokeWidth:a}}),g-=50,u+=g>=50?5.5:7;for(;g>=10&&u!==s;)h.children.push({type:"line",attr:{x1:o.toString(),y1:u.toString(),x2:17.7.toString(),y2:(u-s).toString(),stroke:p,strokeWidth:a}}),g-=10,u=u==s?l:u+3;for(;g>=5;)h.children.push({type:"line",attr:{x1:o.toString(),y1:u.toString(),x2:13.35.toString(),y2:(u-1.45).toString(),stroke:p,strokeWidth:a}}),g-=5,u+=3;return h}}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o={};n.d(o,{A:()=>p});const i=(a={default:()=>t.default},s={},n.d(s,a),s);var a,s,l=n(729);const c=t=>{switch(t.type){case"line":return i.default.createElement("line",Object.assign({},t.attr));case"circle":return i.default.createElement("circle",Object.assign({},t.attr));case"polyline":return i.default.createElement("polyline",Object.assign({},t.attr));case"path":return i.default.createElement("path",Object.assign({},t.attr))}},p=(t,e=0,r)=>{const n=(0,l.A)(t,e,r),o=n.children.map(c);return i.default.createElement("svg",Object.assign({},n.attr),o)};var d=o.A;export{d as default};