@fe6/icon-img
Version:
Water Icon 的纯 HTML 图标
14 lines (13 loc) • 5.03 kB
JavaScript
var IconsBytedPic=function(u){"use strict";var h={size:"1em",spin:!1,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{outStrokeColor:"#333",outFillColor:"transparent"},filled:{outStrokeColor:"#333",outFillColor:"#fff"},twoTone:{outStrokeColor:"#333",outFillColor:"#2f88ff"},multiColor:{outStrokeColor:"#333",outFillColor:"#2f88ff",innerStrokeColor:"#fff",innerFillColor:"#43ccf8"}},prefix:"cube"},f=function(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)},C=function(l,t,e){var o=t?.colors||[],r=[],n=t?.theme||e.theme;switch(n){case"outline":r.push(typeof o[0]=="string"?o[0]:e.colors.outline.outStrokeColor),r.push(typeof o[1]=="string"?o[1]:e.colors.outline.outFillColor),r.push(typeof o[0]=="string"?o[0]:e.colors.outline.outStrokeColor),r.push(typeof o[1]=="string"?o[1]:e.colors.outline.outFillColor);break;case"filled":r.push(typeof o[0]=="string"?o[0]:e.colors.filled.outStrokeColor),r.push(typeof o[0]=="string"?o[0]:e.colors.filled.outStrokeColor),r.push(typeof o[1]=="string"?o[1]:e.colors.filled.outFillColor),r.push(typeof o[1]=="string"?o[1]:e.colors.filled.outFillColor);break;case"twoTone":r.push(typeof o[0]=="string"?o[0]:e.colors.twoTone.outStrokeColor),r.push(typeof o[1]=="string"?o[1]:e.colors.twoTone.outFillColor),r.push(typeof o[0]=="string"?o[0]:e.colors.twoTone.outStrokeColor),r.push(typeof o[1]=="string"?o[1]:e.colors.twoTone.outFillColor);break;case"multiColor":r.push(typeof o[0]=="string"?o[0]:e.colors.multiColor.outStrokeColor),r.push(typeof o[1]=="string"?o[1]:e.colors.multiColor.outFillColor),r.push(typeof o[2]=="string"?o[2]:e.colors.multiColor.innerStrokeColor),r.push(typeof o[3]=="string"?o[3]:e.colors.multiColor.innerFillColor);break}return{size:t?.size||e.size,strokeWidth:t?.strokeWidth||e.strokeWidth,strokeLinecap:t?.strokeLinecap||e.strokeLinecap,strokeLinejoin:t?.strokeLinejoin||e.strokeLinejoin,colors:r,svg:t?.svg||"",id:l}},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",m=function(l,t){for(var e="",o=0,r=l.length,n,s,c,i=t?g:k;o<r;){if(n=l.charCodeAt(o++)&255,o===r){e+=i.charAt(n>>2),e+=i.charAt((n&3)<<4),e+="==";break}if(s=l.charCodeAt(o++),o===r){e+=i.charAt(n>>2),e+=i.charAt((n&3)<<4|(s&240)>>4),e+=i.charAt((s&15)<<2),e+="=";break}c=l.charCodeAt(o++),e+=i.charAt(n>>2),e+=i.charAt((n&3)<<4|(s&240)>>4),e+=i.charAt((s&15)<<2|(c&192)>>6),e+=i.charAt(c&63)}return e},p=function(l){var t="",e,o,r=l.length;for(e=0;e<r;e++)o=l.charCodeAt(e),o>=1&&o<=127?t+=l.charAt(e):o>2047?(t+=String.fromCharCode(224|o>>12&15),t+=String.fromCharCode(128|o>>6&63),t+=String.fromCharCode(128|o>>0&63)):(t+=String.fromCharCode(192|o>>6&31),t+=String.fromCharCode(128|o>>0&63));return t},L=h,y=function(){return L},S=function(l,t,e){return function(o){var r=y(),n=["".concat(r.prefix,"-icon")];n.push("".concat(r.prefix,"-icon-").concat(l)),t&&r.rtl&&n.push("".concat(r.prefix,"-icon-rtl")),o!=null&&o.spin&&n.push("".concat(r.prefix,"-icon-spin"));var s=C(f(),o,r),c=e(s),i=m(p(c)),v="data:image/svg+xml;base64,".concat(i);return o!=null&&o.base64?v:'<span class="'.concat(n.join(" "),`">
<img class="`).concat(r.prefix,'-icon-img" src="').concat(v,`" />
</span>`)}},d=function(l){var t,e,o,r;return`<?xml version="1.0" encoding="UTF-8"?>
<svg width="`.concat(l.size,'" height="').concat(l.size,`" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<g>
<rect width="48" height="48" fill="white" fill-opacity="0.01" stroke-linejoin="`).concat(l.strokeLinejoin,'" stroke-width="').concat(l.strokeWidth,`" stroke="none" fill-rule="evenodd"/>
<g transform="translate(5.000000, 8.000000)">
<path d="M2,0 L36,0 C37.1045695,-2.02906125e-16 38,0.8954305 38,2 L38,30 C38,31.1045695 37.1045695,32 36,32 L2,32 C0.8954305,32 1.3527075e-16,31.1045695 0,30 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" stroke-width="`).concat(l.strokeWidth,'" stroke-linecap="').concat(l.strokeLinecap,'" stroke-linejoin="').concat(l.strokeLinejoin,'" stroke="').concat((t=l.colors)===null||t===void 0?void 0:t[0],`" fill="none" fill-rule="evenodd"/>
<circle stroke-width="`).concat(l.strokeWidth,'" stroke-linecap="').concat(l.strokeLinecap,'" cx="9.5" cy="8.5" r="1.5" stroke-linejoin="').concat(l.strokeLinejoin,'" stroke="').concat((e=l.colors)===null||e===void 0?void 0:e[0],`" fill="none" fill-rule="evenodd"/>
<path d="M10,16 L15,20 L21,13 L38,26 L38,30 C38,31.1045695 37.1045695,32 36,32 L2,32 C0.8954305,32 2.27508946e-13,31.1045695 2.27373675e-13,30 L2.27373675e-13,26 L10,16 Z" stroke-width="`).concat(l.strokeWidth,'" fill="').concat((o=l.colors)===null||o===void 0?void 0:o[1],'" fill-rule="nonzero" stroke-linejoin="').concat(l.strokeLinejoin,'" stroke="').concat((r=l.colors)===null||r===void 0?void 0:r[0],`"/>
</g>;
</g>;
</svg>`)},w=S("byted-pic",!1,d);return u.default=w,u.getIconBytedPicSvgHtml=d,Object.defineProperty(u,"__esModule",{value:!0}),u}({});