1
0
Fork 0
mirror of https://github.com/voltbonn/profile-picture-generator.git synced 2025-01-09 08:26:58 +00:00
profile.volt.link/static/js/main.1dd29bf9.chunk.js
2021-01-21 16:00:26 +00:00

2 lines
No EOL
1.7 KiB
JavaScript

(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{15:function(e,t,n){},16:function(e,t,n){},17:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n(1),r=n.n(c),i=n(7),o=n.n(i),l=(n(15),n(5)),s=n(6),u=(n(16),n(8)),d=n.n(u),j=n.p+"static/media/ProfileFrame Mixed Bars.2624625f.png",p=n(9),b=1080;var f=function(){var e=Object(c.useState)(null),t=Object(s.a)(e,2),n=t[0],r=t[1],i=Object(c.useState)(null),o=Object(s.a)(i,2),u=o[0],f=o[1],g=Object(c.useCallback)((function(e){var t=new FileReader;t.onload=function(e){var t=new Image;t.onload=function(){var e=document.createElement("canvas");e.width=b,e.height=b;var n=e.getContext("2d",{alpha:!1}),a=t.height/t.width*b;n.drawImage(t,0,(b-a)/2,1080,a);var c=e.toDataURL();r(c)},t.src=e.target.result},t.readAsDataURL(e.target.files[0])}),[r]);return Object(c.useEffect)((function(){Object(p.a)([].concat(Object(l.a)(n?[n]:[]),Object(l.a)(j?[j]:[]))).then((function(e){return f(e)}))}),[n]),Object(a.jsx)("div",{className:"App",children:Object(a.jsxs)("header",{className:"App-header",children:[Object(a.jsx)("label",{children:"Load an Image:"}),Object(a.jsx)("input",{type:"file",onChange:g}),Object(a.jsx)("img",{src:u,className:"App-logo",alt:"Finished Frame"}),Object(a.jsx)("button",{onClick:function(){return d()(u,"volt-profile-picture.png","image/png")},children:"Download Profile Picture"})]})})},g=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,18)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,i=t.getTTFB;n(e),a(e),c(e),r(e),i(e)}))};o.a.render(Object(a.jsx)(r.a.StrictMode,{children:Object(a.jsx)(f,{})}),document.getElementById("root")),g()}},[[17,1,2]]]);
//# sourceMappingURL=main.1dd29bf9.chunk.js.map