Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boring-avatars

Package Overview
Dependencies
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boring-avatars - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

build/index.js

@@ -1,2 +0,2 @@

!function(e,t){if("object"===typeof exports&&"object"===typeof module)module.exports=t(require("react"));else if("function"===typeof define&&define.amd)define(["react"],t);else{var r="object"===typeof exports?t(require("react")):t(e.react);for(var a in r)("object"===typeof exports?exports:e)[a]=r[a]}}(this,(function(e){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){e.exports=r(2)},function(e,t,r){"use strict";function a(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},l=Object.keys(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}r.r(t);var n=r(0),l=r.n(n),o=function(e){var t=Array.from(e),r=0;return t.forEach((function(e){return r+=e.charCodeAt(0)})),r},i=function(e,t){return e%t},c=function(e,t){return Math.floor(e/Math.pow(10,t)%10)},s=function(e,t,r){var a=e%t;return r&&c(e,r)%2===0?-a:a},f=function(e,t,r){return t[e%r]};function u(e,t,r,a){switch(a){case 0:return t[i(Math.floor(e/1%10)+a,r)];case 1:return t[i(Math.floor(e/10%10)+a,r)];case 2:return t[i(Math.floor(e/1%10)+a,r)];case 3:return t[i(Math.floor(e/10%10)+a,r)];default:return t[i(e+a,r)]}}function m(e,t,r){var a=new Array(4).fill(t);return a[r]=e,3===r?a[0]=e:a[r+1]=e,a}function p(e,t){var r=o(t),a=e&&e.length,n=i(r,4),l=u(r,e,a,i(r,15)),c=u(r,e,a,i(r,24)),s=function(e,t,r){return Array.from({length:4},(function(a,n){return u(e,t,r,n)}))}(r,e,a),f=m(l,"none",n),p=m("none",c,n);return s.concat(f,p)}var h=function(e){var t=p(e.colors,e.name);return l.a.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},l.a.createElement("svg",{viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.a.createElement("path",{d:"M80 40A40 40 0 0040 0v40h40z",fill:t[0]}),l.a.createElement("path",{d:"M40 0A40 40 0 000 40h40V0z",fill:t[1]}),l.a.createElement("path",{d:"M0 40a40 40 0 0040 40V40H0z",fill:t[2]}),l.a.createElement("path",{d:"M40 80a40 40 0 0040-40H40v40z",fill:t[3]}),l.a.createElement("path",{d:"M70 40a30 30 0 00-30-30v30h30z",fill:t[4]}),l.a.createElement("path",{d:"M40 10a30 30 0 00-30 30h30V10z",fill:t[5]}),l.a.createElement("path",{d:"M10 40a30 30 0 0030 30V40H10z",fill:t[6]}),l.a.createElement("path",{d:"M40 70a30 30 0 0030-30H40v30z",fill:t[7]}),l.a.createElement("path",{d:"M60 40a20 20 0 00-20-20v20h20z",fill:t[8]}),l.a.createElement("path",{d:"M40 20a20 20 0 00-20 20h20V20z",fill:t[9]}),l.a.createElement("path",{d:"M20 40a20 20 0 0020 20V40H20z",fill:t[10]}),l.a.createElement("path",{d:"M40 60a20 20 0 0020-20H40v20z",fill:t[11]})))};var d=function(e){var t=function(e,t){var r=o(e),a=t&&t.length;return Array.from({length:4},(function(e,n){return{color:f(r+n,t,a),translateX:s(r/(n+1),80/13-8*n,1),translateY:s(r/(n+1),80/13-8*n,2),rotate:s(r/(n+1),360)}}))}(e.name,e.colors);return n.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},n.createElement("svg",Object.assign({viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n.createElement("mask",{id:"prefix__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:40,fill:"#fff"})),n.createElement("g",{mask:"url(#prefix__a)"},n.createElement("rect",{width:80,height:80,rx:40,fill:t[0].color}),n.createElement("g",{transform:"rotate("+t[0].rotate+" 40 40)"},n.createElement("path",{d:"M8 56.5L19.667 24L63.833 36.5L79.667 80.666L19.667 103.166L8 56.5Z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 80)"})),n.createElement("circle",{cx:40,cy:40,fill:t[2].color,r:17.5,transform:"translate("+t[2].translateX+" "+t[2].translateY+")"}),n.createElement("line",{x1:"0",y1:40,x2:"80",y2:40,strokeWidth:2,stroke:t[3].color,transform:"translate("+t[3].translateX+" "+t[3].translateY+") rotate("+t[3].rotate+" 40 40)"}))))};function g(e,t,r){return t[e%r]}function E(e,t,r){var a=e%t;return r&&c(e,r)%2===0?-a:a}var v=function(e){var t=function(e,t){var r,a,n=o(e),l=t&&t.length,i=g(n,t,l),c=E(n,10,1),s=c<5?c+4:c,f=E(n,10,2),u=f<5?f+4:f;return{wrapperColor:i,faceColor:(a=i,"#"===a.slice(0,1)&&(a=a.slice(1)),(299*parseInt(a.substr(0,2),16)+587*parseInt(a.substr(2,2),16)+114*parseInt(a.substr(4,2),16))/1e3>=128?"black":"white"),backgroundColor:g(n+13,t,l),wrapperTranslateX:s,wrapperTranslateY:u,wrapperRotate:E(n,360),isCircle:(r=n,!(r%10%2)),eyeSpread:E(n,5),mouthSpread:E(n,5),faceRotate:E(n,10,3),faceTranslateX:s>6?s/2:E(n,8,1),faceTranslateY:u>6?u/2:E(n,7,2)}}(e.name,e.colors);return n.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},n.createElement("svg",Object.assign({viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n.createElement("mask",{id:"prefix__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},n.createElement("rect",{width:36,height:36,rx:20,fill:"white"})),n.createElement("g",{mask:"url(#prefix__a)",fill:"transparent"},n.createElement("rect",{width:36,height:36,rx:20,fill:t.backgroundColor}),n.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+t.wrapperTranslateX+" "+t.wrapperTranslateY+") rotate("+t.wrapperRotate+")","transform-origin":"50%",fill:t.wrapperColor,rx:t.isCircle?36:6}),n.createElement("g",{transform:"translate("+t.faceTranslateX+" "+t.faceTranslateY+") rotate("+t.faceRotate+")","transform-origin":"50%"},n.createElement("path",{d:"M15 "+(18+t.mouthSpread)+"c2 1 4 1 6 0",stroke:t.faceColor,fill:"none",strokeLinecap:"round"}),n.createElement("rect",{x:12-t.eyeSpread,y:14,width:2,height:2,rx:1,stroke:"none",fill:t.faceColor}),n.createElement("rect",{x:22+t.eyeSpread,y:14,width:2,height:2,rx:1,stroke:"none",fill:t.faceColor})))))};function w(e,t,r){return t[e%r]}function x(e,t,r){var a=e%t;return r&&c(e,r)%2===0?-a:a}function y(e,t){var r,a,n=o(e),l=t&&t.length,i=x(n,7,1),c=x(n,7,2),s=(r=i,a=c,180*Math.atan2(a,r)/Math.PI);return{backgroundColor:w(n,t,l),scleraColor:"#fcfcfc",pupilColor:"#03030b",lightColor:"#fff",irisColor:w(n+2,t,l),wrapperTranslateX:i,wrapperTranslateY:c,wrapperRotate:-(180-s)}}var b=function(e){var t=y(e.name,e.colors);return n.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},n.createElement("svg",Object.assign({viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n.createElement("mask",{id:"prefix__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},n.createElement("path",{d:"M36 18c0-9.941-8.059-18-18-18S0 8.059 0 18s8.059 18 18 18 18-8.059 18-18z",fill:"#fff"})),n.createElement("g",{mask:"url(#prefix__a)"},n.createElement("path",{d:"M36 18c0-9.941-8.059-18-18-18S0 8.059 0 18s8.059 18 18 18 18-8.059 18-18z",fill:t.backgroundColor}),n.createElement("path",{fill:"#fff","fill-opacity":"0.3",d:"M0 0h36v18H0z"}),n.createElement("mask",{id:"prefix__b",maskUnits:"userSpaceOnUse",x:4,y:11,width:28,height:14},n.createElement("path",{d:"M18 11C7.818 11 4 18 4 18s5 7 14 7 14-7 14-7-3.818-7-14-7z",fill:"#fff"})),n.createElement("g",{mask:"url(#prefix__b)"},n.createElement("path",{d:"M18 11C8 11 4 18 4 18s5 7 14 7 14-7 14-7-4-7-14-7z",fill:t.scleraColor}),n.createElement("g",{transform:"translate("+t.wrapperTranslateX+" "+t.wrapperTranslateY+") rotate("+t.wrapperRotate+")","transform-origin":"50%"},n.createElement("circle",{cx:18,cy:18,r:10,fill:t.irisColor}),n.createElement("circle",{cx:25,cy:18,r:1,fill:t.lightColor}),n.createElement("circle",{cx:18,cy:18,r:4,fill:t.pupilColor}))))))};var z=function(e){var t=function(e,t){var r=o(e),a=t&&t.length;return Array.from({length:3},(function(e,n){return{color:f(r+n,t,a),translateX:s(r*(n+1),8,1),translateY:s(r*(n+1),8,2),scale:1+s(r*(n+1),4)/10,rotate:s(r*(n+1),360,1)}}))}(e.name,e.colors);return n.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},n.createElement("svg",Object.assign({viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n.createElement("mask",{id:"prefix__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("path",{d:"M80 40C80 17.909 62.091 0 40 0S0 17.909 0 40s17.909 40 40 40 40-17.909 40-40z",fill:"#fff"})),n.createElement("g",{mask:"url(#prefix__a)"},n.createElement("path",{d:"M80 40C80 17.909 62.091 0 40 0S0 17.909 0 40s17.909 40 40 40 40-17.909 40-40z",fill:t[0].color}),n.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40) scale("+t[2].scale+")"}),n.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:t[2].color,transform:"translate("+t[2].translateX+" "+t[2].translateY+") rotate("+t[2].rotate+" 40 40) scale("+t[2].scale+")"})),n.createElement("defs",null,n.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},n.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),n.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),n.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})))))},M=function(e){var t=e.variant,r=e.colors,n=e.name,o=e.size,i=a(e,["variant","colors","name","size"]);return"abstract"===t?l.a.createElement(d,Object.assign({colors:r,name:n,size:o},i)):"beam"===t?l.a.createElement(v,Object.assign({colors:r,name:n,size:o},i)):"eye"===t?l.a.createElement(b,Object.assign({colors:r,name:n,size:o},i)):"marble"===t?l.a.createElement(z,Object.assign({colors:r,name:n,size:o},i)):l.a.createElement(h,Object.assign({colors:r,name:n,size:o},i))};M.defaultProps={variant:"geometric",colors:["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:"abcdefg",size:40};var _=M;t.default=_}])}));
!function(e,t){if("object"===typeof exports&&"object"===typeof module)module.exports=t(require("react"));else if("function"===typeof define&&define.amd)define(["react"],t);else{var r="object"===typeof exports?t(require("react")):t(e.react);for(var n in r)("object"===typeof exports?exports:e)[n]=r[n]}}(this,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){e.exports=r(2)},function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}r.r(t);var a=r(0),l=r.n(a),o=function(e){var t=Array.from(e),r=0;return t.forEach((function(e){return r+=e.charCodeAt(0)})),r},i=function(e,t){return e%t},c=12,f=c/3;function u(e,t,r,n){switch(n){case 0:return t[i(Math.floor(e/1%10)+n,r)];case 1:return t[i(Math.floor(e/10%10)+n,r)];case 2:return t[i(Math.floor(e/1%10)+n,r)];case 3:return t[i(Math.floor(e/10%10)+n,r)];default:return t[i(e+n,r)]}}function s(e,t,r){var n=new Array(f).fill(t);return n[r]=e,r===f-1?n[0]=e:n[r+1]=e,n}function m(e,t){var r=o(t),n=e&&e.length,a=i(r,f),l=u(r,e,n,i(r,c+3)),m=u(r,e,n,i(r,2*c)),p=function(e,t,r){return Array.from({length:f},(function(n,a){return u(e,t,r,a)}))}(r,e,n),d=s(l,"none",a),h=s("none",m,a);return p.concat(d,h)}var p=function(e){var t=m(e.colors,e.name);return l.a.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},l.a.createElement("svg",{viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.a.createElement("path",{d:"M80 40A40 40 0 0040 0v40h40z",fill:t[0]}),l.a.createElement("path",{d:"M40 0A40 40 0 000 40h40V0z",fill:t[1]}),l.a.createElement("path",{d:"M0 40a40 40 0 0040 40V40H0z",fill:t[2]}),l.a.createElement("path",{d:"M40 80a40 40 0 0040-40H40v40z",fill:t[3]}),l.a.createElement("path",{d:"M70 40a30 30 0 00-30-30v30h30z",fill:t[4]}),l.a.createElement("path",{d:"M40 10a30 30 0 00-30 30h30V10z",fill:t[5]}),l.a.createElement("path",{d:"M10 40a30 30 0 0030 30V40H10z",fill:t[6]}),l.a.createElement("path",{d:"M40 70a30 30 0 0030-30H40v30z",fill:t[7]}),l.a.createElement("path",{d:"M60 40a20 20 0 00-20-20v20h20z",fill:t[8]}),l.a.createElement("path",{d:"M40 20a20 20 0 00-20 20h20V20z",fill:t[9]}),l.a.createElement("path",{d:"M20 40a20 20 0 0020 20V40H20z",fill:t[10]}),l.a.createElement("path",{d:"M40 60a20 20 0 0020-20H40v20z",fill:t[11]})))},d=4,h=80;function v(e,t,r,n){return t[i(e+n,r)]}function y(e,t){var r=i(e*t,h/4);return e%2===0?-r:r}function b(e,t){var r=i(e*t,h/4);return e%2===0?r:-r}var g=function(e){var t=function(e,t){var r=o(e),n=t&&t.length;return Array.from({length:d},(function(e,a){return{color:v(r,t,n,a),translateX:y(r,a),translateY:b(r,a),rotate:(l=r,i(l,360)+" "+h/2+" "+h/2)};var l}))}(e.name,e.colors);return a.createElement("div",{style:{display:"inline-block",width:e.size,height:e.size}},a.createElement("svg",Object.assign({viewBox:"0 0 "+h+" "+h,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a.createElement("mask",{id:"prefix__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:h,height:h},a.createElement("rect",{width:h,height:h,rx:h/2,fill:"#fff"})),a.createElement("g",{mask:"url(#prefix__a)"},a.createElement("rect",{width:h,height:h,rx:h/2,fill:t[0].color}),a.createElement("path",{d:"M0 64.167l11.667-32.5 44.166 12.5 15.834 44.166-60 22.5L0 64.167z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+")"}),a.createElement("circle",{cx:h/2,cy:h/2,fill:t[2].color,r:17.5,transform:"translate("+t[3].translateX+" "+t[3].translateY+")"}),a.createElement("line",{x1:"0",y1:h/2,x2:"80",y2:h/2,strokeWidth:2,stroke:t[3].color,transform:"translate("+t[3].translateX+" "+t[3].translateY+") rotate("+t[3].rotate+")"}))))},E=function(e){var t=e.variant,r=e.colors,a=e.name,o=e.size,i=n(e,["variant","colors","name","size"]);return"abstract"===t?l.a.createElement(g,Object.assign({colors:r,name:a,size:o},i)):l.a.createElement(p,Object.assign({colors:r,name:a,size:o},i))};E.defaultProps={variant:"geometric",colors:["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:"abcdefg",size:32};var x=E;t.default=x}])}));
//# sourceMappingURL=index.js.map
{
"name": "boring-avatars",
"version": "1.2.0",
"version": "1.2.1",
"main": "build/index.js",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc