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