mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-23 00:05:09 +00:00
2 lines
No EOL
19 KiB
JavaScript
2 lines
No EOL
19 KiB
JavaScript
(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{38:function(e,t,n){},42:function(e,t,n){var a={"./0xSOM.png":[50,13],"./2xSOM-Blue-Green.png":[51,14],"./2xSOM-Red-Yellow.png":[52,15],"./4xSOM-Blue-Red-Yellow-Green.png":[53,16],"./5xSOM-Blue.png":[54,17],"./5xSOM-Green.png":[55,18],"./5xSOM-Red.png":[56,19],"./5xSOM-White.png":[57,20],"./5xSOM-Yellow.png":[58,21]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=42,e.exports=c},43:function(e,t,n){var a={"./#DeineWahl.png":[59,22],"./#EUReform.png":[60,23],"./#Europa.png":[61,24],"./#EuropeCares.png":[62,25],"./#European.png":[63,26],"./#FutureMadeInEurope.png":[64,27],"./#IkStemVolt.png":[65,28],"./#JetztBistDuDran.png":[66,29],"./#JoinTheChange.png":[67,30],"./#RejoinEU.png":[68,31],"./#ValuesOverPower.png":[69,32],"./#Volt.png":[70,33],"./#Volt21.png":[71,34],"./#VoltEuropa.png":[72,35],"./#VoltForLGBTIAQ.png":[73,36],"./#VoltRLP.png":[74,37],"./#VoteVolt.png":[75,38],"./#ZukunftMadeInEurope.png":[76,39],"./#democracy.png":[77,40],"./#paneurop\xe4isch.png":[78,41],"./#pragmatisch.png":[79,42],"./#progressiv.png":[80,43],"./stemvolt.nl.png":[81,44]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=43,e.exports=c},48:function(e,t,n){var a={"./de.ftl":[82,3],"./en.ftl":[83,4],"./es.ftl":[84,5],"./fr.ftl":[85,6],"./it.ftl":[86,7],"./nl.ftl":[87,8],"./pl.ftl":[88,9],"./pt.ftl":[89,10],"./ru.ftl":[90,11]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=48,e.exports=c},49:function(e,t,n){"use strict";n.r(t);var a=n(1),c=n(0),r=n.n(c),o=n(25),s=n.n(o),i=n(5),u=n(13),O=n(2),h=n(6),l=n(32),d=(n(38),n(30)),j=n(27),b=n(4),f=n.n(b),p=n(9);var g=function(e){var t=e.onChange,r=Object(c.useState)([]),o=Object(O.a)(r,2),s=o[0],i=o[1],u=Object(c.useState)(null),h=Object(O.a)(u,2),l=h[0],d=h[1],j=l?l.src:null;Object(c.useEffect)((function(){function e(){return(e=Object(p.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all(["0xSOM","4xSOM-Blue-Red-Yellow-Green","5xSOM-Blue","5xSOM-Green","5xSOM-Red","5xSOM-Yellow"].map(function(){var e=Object(p.a)(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,n(42)("./".concat(t,".png"));case 3:return e.t1=e.sent.default,e.abrupt("return",{name:e.t0,src:e.t1});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){i(e),d(e[0])}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var b=Object(c.useCallback)((function(e){d(e)}),[d]);return Object(c.useEffect)((function(){t(l)}),[t,l]),Object(a.jsx)("div",{className:"FrameChooser",children:s.map((function(e){var t=e.src,n=j===t;return Object(a.jsx)("div",{"data-src":t,className:n?"frame choosen":"frame",onClick:function(){return b(e)},children:Object(a.jsx)("img",{alt:e.name,src:t})},t)}))})},w=n(17),v=n(10),x=function(e){return Object(a.jsx)(w.b,Object(h.a)(Object(h.a)({},e),{},{elems:Object(h.a)({br:Object(a.jsx)("br",{})},e.elems),children:Object(a.jsx)(r.a.Fragment,{children:e.children})}),e.id)};function m(e){return function(t){var n=r.a.useContext(v.a);return r.a.createElement(e,Object(h.a)({getString:function(e,t,a){return n.getString(e,t,a||" ")}},t))}}var A=m((function(e){var t=e.onChange,r=e.getString,o=Object(c.useState)([]),s=Object(O.a)(o,2),i=s[0],h=s[1],l=Object(c.useState)(null),d=Object(O.a)(l,2),j=d[0],b=d[1],g=j?j.src:null,w=r("hashtags");Object(c.useEffect)((function(){function e(){return(e=Object(p.a)(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all([""].concat(Object(u.a)(w.split("\n").map((function(e){return e.trim()})).filter((function(e){return e.length>0})))).map(function(){var e=Object(p.a)(f.a.mark((function e(t){var a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t,""===t){e.next=5;break}return e.next=4,n(43)("./".concat(t,".png"));case 4:a=e.sent.default;case 5:return e.abrupt("return",{name:t,src:a});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){h(e),b(e[0])}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[w]);var v=Object(c.useCallback)((function(e){b(e)}),[b]);return Object(c.useEffect)((function(){t(j)}),[t,j]),Object(a.jsx)("div",{className:"HashtagChooser",children:i.map((function(e){var t=e.src,n=g===t;return Object(a.jsx)("button",{"data-src":t,className:n?"isInRow choosen":"isInRow",onClick:function(){return v(e)},children:""===e.name?r("button_no_hashtag"):e.name},e.name)}))})})),D=n(28),C=n.n(D),Q=n(29),H=n.n(Q);function T(e,t,n){return Math.min(Math.max(t,e),n)}var U=function(e){var t=e.onChange,n=e.backgroundURL,r=e.backgroundRatio,o=e.frameURL,s=e.hashtagURL,i=Object(c.useRef)(null),u=Object(c.useRef)(null),h=Object(c.useState)(!1),l=Object(O.a)(h,2),d=l[0],j=l[1],b=Object(c.useState)(null),f=Object(O.a)(b,2),p=f[0],g=f[1],w=Object(c.useState)(null),v=Object(O.a)(w,2),x=v[0],m=v[1],A=Object(c.useState)(0),D=Object(O.a)(A,2),Q=D[0],U=D[1],N=Object(c.useState)(0),k=Object(O.a)(N,2),F=k[0],E=k[1],S=Object(c.useState)(0),y=Object(O.a)(S,2),K=y[0],M=y[1],_=Object(c.useState)(0),R=Object(O.a)(_,2),B=R[0],L=R[1],I=Object(c.useState)(1),P=Object(O.a)(I,2),V=P[0],Y=P[1],G=Object(c.useState)(300),z=Object(O.a)(G,2),J=z[0],X=z[1],W=Object(c.useState)(300),q=Object(O.a)(W,2),Z=q[0],$=q[1],ee=Object(c.useState)(300),te=Object(O.a)(ee,2),ne=te[0],ae=te[1],ce=Object(c.useState)(300),re=Object(O.a)(ce,2),oe=re[0],se=re[1],ie=Object(c.useState)(0),ue=Object(O.a)(ie,2),Oe=ue[0],he=ue[1],le=Object(c.useState)(0),de=Object(O.a)(le,2),je=de[0],be=de[1],fe=Object(c.useState)(0),pe=Object(O.a)(fe,2),ge=pe[0],we=pe[1],ve=Object(c.useState)(0),xe=Object(O.a)(ve,2),me=xe[0],Ae=xe[1];Object(c.useEffect)((function(){t&&t({x:Q,y:F,scale:V})}),[t,Q,F,V]),Object(c.useEffect)((function(){if(i&&i.current){var e=i.current.offsetWidth,t=i.current.offsetHeight;se(t),ae(e);var n=1,a=1;r<1?n=1/r:r>1&&(a=1*r),X(n),$(a)}}),[r]),Object(c.useEffect)((function(){var e=function(e,t,n,a,c){var r=Math.max(0,e*n-a)/2,o=Math.max(0,t*n-c)/2;return{rangeMaxX:r,rangeMinX:0-r,rangeMaxY:o,rangeMinY:0-o}}(J*ne,Z*oe,V,ne,oe),t=e.rangeMinX,n=e.rangeMinY,a=e.rangeMaxX,c=e.rangeMaxY;he(t),be(n),we(a),Ae(c)}),[J,Z,ne,oe,V]),Object(c.useEffect)((function(){U(0),E(0),M(0),L(0),Y(1)}),[n]);var De=Object(c.useCallback)((function(e){var t=1*e.target.dataset.x,n=1*e.target.dataset.y,a=T(t+e.deltaX,Oe,ge),c=T(n+e.deltaY,je,me);e.isFinal?(U(a||0),E(c||0),M(0),L(0)):(M(a-t||0),L(c-n||0))}),[Oe,je,ge,me]),Ce=Object(c.useCallback)((function(e,t,n,a){e.preventDefault();var c=T(1*e.target.dataset.scale+t/200,1,8);Y(c||1);var r=1*e.target.dataset.x,o=1*e.target.dataset.y;U(T(r,Oe,ge)||0),E(T(o,je,me)||0)}),[Oe,je,ge,me]);return Object(c.useEffect)((function(){if(!d&&i&&i.current){var e=i.current;e.addEventListener("mousedown",(function(e){e.preventDefault()}),!1),e.addEventListener("touchstart",(function(e){e.preventDefault()}),!1),e.addEventListener("touchend",(function(e){e.preventDefault()}),!1),e.addEventListener("touchmove",(function(e){e.preventDefault()}),!1),g(new C.a(e,{direction:"DIRECTION_ALL"})),m(H()(e)),j(!0)}}),[i,d]),Object(c.useEffect)((function(){if(p&&x&&d&&i&&i.current)return p.on("pan",De),x.wheel(Ce),function(){p.off("pan",De),x.unwheel()}}),[i,De,Ce,d,p,x]),Object(a.jsxs)("div",{className:"Editor",ref:i,"data-x":Q,"data-y":F,"data-scale":V,children:[Object(a.jsx)("img",{src:n,ref:u,alt:"",className:"background",style:{width:100*J+"%",height:100*Z+"%",transform:"translate3d(calc(-50% + ".concat(Q+K,"px), calc(-50% + ").concat(F+B,"px), 0) scale(").concat(V,",").concat(V,")")}}),Object(a.jsx)("img",{src:o,alt:"",className:"foreground"}),Object(a.jsx)("img",{src:s,alt:"",className:"hashtag"})]})},N=n.p+"static/media/VoltLogoPurple.125355f6.svg",k="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDgAAAQ4AgMAAACRfoQcAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJUExURVAjeFAjeE8jd3Yl3xwAAAADdFJOU//+/Q3dsqEAAATsSURBVHgB7dAxAQAABAAwQtI/ipMCvi3CgiMV6NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQ4cOdOjQoUOHDh06dOjQoUOHDh06dOjQoQMdOnTo0KFDhw4dOnTo0KFDhw4dOnToQIcOHTp06NChQ4cOHTp06NChQ4cOHejQoUOHDh06dOjQoUOHDh06dOjQoUMHOnTo0KFDhw4dOnTo0KFDhw4dOnTo0IEOHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NChQIcOHTp06NChQ4cOHTp06NChQ4cOHejQoUOHDh06dOjQoUOHDh06dOjQoUMHOnTo0KFDhw4dOnTo0KFDhw4dOnTo0IEOHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06ECHDh06dOjQoUOHDh06dOjQoUOHDh060KFDhw4dOnTo0KFDhw4dOnTo0KFDhw506NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQ4cOBTp06NChQ4cOHTp06NChQ4cOHTp06ECHDh06dOjQoUOHDh06dOjQoUOHDh060KFDhw4dOnTo0KFDhw4dOnTo0KFDhw506NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQwc6dOjQoUOHDh06dOjQoUOHDh06dOjQgQ4dOnTo0KFDhw4dOnTo0KFDhw4dOnSgQ4cOHTp06NChQ4cOHTp06NChQ4cOHTx06NChQ4cOdOjQoUOHDh06dOjQoUOHDh06dOjQoQMdOnTo0KFDhw4dOnTo0KFDhw4dOnToQIcOHTp06NChQ4cOHTp06NChQ4cOHTrQoUOHDh06dOjQoUOHDh06dOjQoUOHDnTo0KFDhw4dOnTo0KFDhw4dOnTo0KEDHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NCBDh06dOjQoUOHDh06dOjQoUOHDh06dKBDhw4dOnTo0KFDhw4dOnTo0KFDhw4d6NChQ4cOHTp06NChQ4cOHTp06NChQ4cCHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NCBDh06dOjQoUOHDh06dOjQoUOHDh06dKBDhw4dOnTo0KFDhw4dOnTo0KFDhw4dxeoB30xd38yzCvgAAAAASUVORK5CYII=",F="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAALSURBVHgBY2BgAAAAAwABjPg5OgAAAABJRU5ErkJggg==",E=(n(44),n(21)),S=n(20),y=n(31),K={de:"Deutsch",en:"English",es:"Espa\xf1ol",pt:"Portugu\xeas",fr:"Fran\xe7ais",it:"Italiano",nl:"Dutch",pl:"Polska",ru:"P\u0443\u0441\u0441\u043a\u0438\u0439"},M=Object.keys(K);function _(e){return R.apply(this,arguments)}function R(){return(R=Object(p.a)(f.a.mark((function e(t){var a,c,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(48)("./"+t+".ftl");case 2:return a=e.sent,e.next=5,fetch(a.default);case 5:return c=e.sent,e.next=8,c.text();case 8:return r=e.sent,e.abrupt("return",Object(E.a)({},t,new S.b(r)));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(e){return L.apply(this,arguments)}function L(){return(L=Object(p.a)(f.a.mark((function e(t){var n,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(_));case 2:return n=e.sent,a=n.reduce((function(e,t){return Object.assign(e,t)})),e.abrupt("return",f.a.mark((function e(){var n,c,r,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object(i.a)(t),e.prev=1,n.s();case 3:if((c=n.n()).done){e.next=11;break}return r=c.value,(o=new S.a(r)).addResource(a[r]),e.next=9,o;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),n.e(e.t0);case 16:return e.prev=16,n.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){var t=e.userLocales,n=e.children,r=e.onLocaleChange,o=Object(c.useState)(function(){var e=new S.a("");return e.addResource(new S.b("")),new w.c([e])}()),s=Object(O.a)(o,2),i=s[0],u=s[1];return Object(c.useEffect)((function(){function e(){return(e=Object(p.a)(f.a.mark((function e(){var n,a;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(y.a)(t,M,{defaultLocale:"en"}),r&&r(n),e.next=4,B(n);case 4:a=e.sent,u(new w.c(a()));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t,r]),i?Object(a.jsx)(w.a,{l10n:i,children:n}):Object(a.jsx)("div",{children:"Loading texts\u2026"})}var P=1080;function V(e){var t=e.href,n=e.name,r=e.target,o=e.children,s=Object(l.a)(e,["href","name","target","children"]),i=Object(c.useCallback)((function(e){return n&&window.umami.trackEvent("A: "+n),r?window.open(t,r):setTimeout((function(){window.location=t}),200),e.preventDefault(),!1}),[t,n,r]);return Object(a.jsx)("a",Object(h.a)(Object(h.a)({},s),{},{href:t,onClick:i,children:o}))}var Y=m((function(e){var t=e.getString,n=Object(c.useState)(null),r=Object(O.a)(n,2),o=r[0],s=r[1],i=Object(c.useState)(null),l=Object(O.a)(i,2),b=l[0],f=l[1],p=Object(c.useState)(null),w=Object(O.a)(p,2),v=w[0],m=w[1],D=Object(c.useState)(1),C=Object(O.a)(D,2),Q=C[0],H=C[1],T=Object(c.useState)(null),E=Object(O.a)(T,2),S=E[0],y=E[1],K=o?o.src:null,M=b?b.src:null,_=Object(c.useState)(0),R=Object(O.a)(_,2),B=R[0],L=R[1],I=Object(c.useState)(0),Y=Object(O.a)(I,2),G=Y[0],z=Y[1],J=Object(c.useState)({x:0,y:0,scale:1}),X=Object(O.a)(J,2),W=X[0],q=X[1],Z=Object(c.useCallback)((function(e){s(e)}),[s]),$=Object(c.useCallback)((function(e){f(e)}),[f]),ee=Object(c.useCallback)((function(e){var t=e.x,n=e.y,a=e.scale;q({x:t,y:n,scale:a})}),[]),te=Object(c.useCallback)((function(e){if(e){var t=new FileReader;t.onload=function(t){var n=new Image;n.onload=function(){var a,c;n.width<n.height?(c=n.height/n.width*P,a=P):(c=P,a=n.width/n.height*P),function(e,t){var n=new FileReader;n.onload=function(e){var n=new DataView(e.target.result);if(65496!==n.getUint16(0,!1))return t(-2);for(var a=n.byteLength,c=2;c<a;){var r=n.getUint16(c,!1);if(c+=2,65505===r){if(1165519206!==n.getUint32(c+=2,!1))return t(-1);var o=18761===n.getUint16(c+=6,!1);c+=n.getUint32(c+4,o);var s=n.getUint16(c,o);c+=2;for(var i=0;i<s;i++)if(274===n.getUint16(c+12*i,o))return t(n.getUint16(c+12*i+8,o))}else{if(65280!==(65280&r))break;c+=n.getUint16(c,!1)}}return t(-1)},n.readAsArrayBuffer(e.slice(0,65536))}(e,(function(e){var n=1;switch(e){case 2:case 3:case 4:n=c/a;break;case 5:case 6:case 7:case 8:n=a/c;break;default:n=c/a}L(a),z(c),m(t.target.result),y(e),H(n)}))},n.src=t.target.result},t.readAsDataURL(e)}}),[]),ne=Object(c.useCallback)((function(e){te(e.target.files[0])}),[te]),ae=Object(c.useCallback)((function(e){te(e[0])}),[te]),ce=Object(c.useCallback)((function(){var e=new Image;e.onload=function(){var t=document.createElement("canvas");t.width=P,t.height=P;var n=t.getContext("2d",{alpha:!0});switch(S){case 2:n.translate(t.width,0),n.scale(-1,1);break;case 3:n.translate(t.width,t.height),n.rotate(Math.PI);break;case 4:n.translate(0,t.height),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-t.height);break;case 7:n.rotate(.5*Math.PI),n.translate(t.width,-t.height),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-t.width,0)}var a=B*W.scale,c=G*W.scale;n.drawImage(e,3.5*W.x+.5*(P-a),3.5*W.y+.5*(P-c),a,c);var r=t.toDataURL();Object(j.a)([k].concat(Object(u.a)(r?[r]:[]),Object(u.a)(K?[K]:[]),Object(u.a)(M?[M]:[]))).then((function(e){!function(e,t){var n=document.createElement("a");document.body.appendChild(n),n.download=e,n.href=t,n.click(),n.remove()}("volt-profile-picture.png",e);var t=o.name||"No-Frame",n=b.name||"No-Hashtag";window.umami.trackEvent("F: "+t),window.umami.trackEvent("H: "+n),window.umami.trackEvent("C: "+[t,n].join(" | "))}))},e.src=v}),[v,W.x,W.y,W.scale,S,K,M,G,B,o,b]),re=Object(d.a)({onDrop:ae,accept:"image/*",maxFiles:1,noKeyboard:!0}),oe=re.isDragActive,se=re.getRootProps;return Object(a.jsxs)("div",Object(h.a)(Object(h.a)({className:"App"},se()),{},{children:[Object(a.jsx)("img",{src:N,className:"HeaderImage",alt:t("alt_volt_logo")}),Object(a.jsx)("h1",{children:Object(a.jsx)(x,{id:"title_profile_generator"})}),Object(a.jsx)("div",{className:oe?"droparea active":"droparea",children:Object(a.jsx)(x,{id:"title_drop_photo_here"})}),Object(a.jsx)("h2",{children:Object(a.jsx)(x,{id:"title_choose_photo"})}),Object(a.jsx)("p",{children:Object(a.jsx)(x,{id:"text_choose_photo_info"})}),Object(a.jsxs)("label",{className:"labelButton",tabIndex:"0",style:{outline:"none"},children:[v?Object(a.jsx)("img",{src:v,alt:"Preview"}):null,Object(a.jsx)("span",{children:t(v?"button_change_photo":"button_load_photo")}),Object(a.jsx)("input",{onChange:ne,type:"file",accept:"image/*",style:{display:"none"}})]}),Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("h2",{children:Object(a.jsx)(x,{id:"title_choose_frame"})}),Object(a.jsx)(g,{onChange:Z}),Object(a.jsx)("h2",{children:Object(a.jsx)(x,{id:"title_choose_hashtag"})}),Object(a.jsx)(A,{onChange:$})]}),v&&K?Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("h2",{children:Object(a.jsx)(x,{id:"title_reposition_photo"})}),Object(a.jsx)(U,{backgroundURL:v||F,backgroundRatio:Q,frameURL:K,hashtagURL:M||F,onChange:ee}),Object(a.jsx)("button",{onClick:ce,children:Object(a.jsx)(x,{id:"button_download"})})]}):null,Object(a.jsxs)("footer",{children:[Object(a.jsx)(V,{name:"imprint",href:"https://www.voltdeutschland.org/impressum",children:Object(a.jsx)(x,{id:"link_imprint"})}),"\xa0 \u2022 \xa0",Object(a.jsx)(V,{name:"privacy_policy",href:"https://www.voltdeutschland.org/datenschutz",children:Object(a.jsx)(x,{id:"link_privacy_policy"})}),"\xa0 \u2022 \xa0",Object(a.jsx)(V,{name:"source_code",href:"https://github.com/voltbonn/profile-picture-generator",children:Object(a.jsx)(x,{id:"link_source_code"})}),"\xa0 \u2022 \xa0",Object(a.jsx)(V,{name:"contact",href:"mailto:thomas.rosen@volteuropa.org",children:Object(a.jsx)(x,{id:"link_app_contact"})})]})]}))}));var G=m((function(){var e=Object(c.useState)(navigator.languages),t=Object(O.a)(e,2),n=t[0],r=t[1],o=Object(c.useState)(null),s=Object(O.a)(o,2),u=s[0],h=s[1];Object(c.useEffect)((function(){var e=navigator.languages;if(e||Array.isArray(e)){var t,n=Object(i.a)(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;window.umami.trackEvent("L: "+a)}}catch(c){n.e(c)}finally{n.f()}}}),[]);var l=Object(c.useCallback)((function(e){r([e.target.dataset.locale])}),[r]),d=Object(c.useCallback)((function(e){h(e.length>0?e[0]:"")}),[h]);return Object(a.jsx)(I,{userLocales:n,onLocaleChange:d,children:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Y,{}),Object(a.jsx)("div",{className:"locale_chooser",children:Object.entries(K).map((function(e){var t=Object(O.a)(e,2),n=t[0],c=t[1];return Object(a.jsx)("button",{className:n===u?"isInRow choosen":"isInRow","data-locale":n,onClick:l,children:c},n)}))})]})},"AppLocalizationProvider")})),z=function(e){e&&e instanceof Function&&n.e(12).then(n.bind(null,91)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,o=t.getTTFB;n(e),a(e),c(e),r(e),o(e)}))};s.a.render(Object(a.jsx)(r.a.StrictMode,{children:Object(a.jsx)(G,{})}),document.getElementById("root")),z()}},[[49,1,2]]]);
|
|
//# sourceMappingURL=main.10966aa1.chunk.js.map
|