diff --git a/asset-manifest.json b/asset-manifest.json
index f00ba4e..5408ff8 100644
--- a/asset-manifest.json
+++ b/asset-manifest.json
@@ -1,8 +1,8 @@
{
"files": {
"main.css": "/static/css/main.015bbd8f.chunk.css",
- "main.js": "/static/js/main.f98f9ce2.chunk.js",
- "main.js.map": "/static/js/main.f98f9ce2.chunk.js.map",
+ "main.js": "/static/js/main.48425b08.chunk.js",
+ "main.js.map": "/static/js/main.48425b08.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.f6e93472.js",
"runtime-main.js.map": "/static/js/runtime-main.f6e93472.js.map",
"static/js/2.1a3cb35a.chunk.js": "/static/js/2.1a3cb35a.chunk.js",
@@ -45,6 +45,6 @@
"static/js/runtime-main.f6e93472.js",
"static/js/2.1a3cb35a.chunk.js",
"static/css/main.015bbd8f.chunk.css",
- "static/js/main.f98f9ce2.chunk.js"
+ "static/js/main.48425b08.chunk.js"
]
}
\ No newline at end of file
diff --git a/index.html b/index.html
index dd9302b..c031a25 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
Volt Social Media Frame Generator You need to enable JavaScript to run this app.
\ No newline at end of file
+Volt Social Media Frame Generator You need to enable JavaScript to run this app.
\ No newline at end of file
diff --git a/static/js/main.48425b08.chunk.js b/static/js/main.48425b08.chunk.js
new file mode 100644
index 0000000..0a054dd
--- /dev/null
+++ b/static/js/main.48425b08.chunk.js
@@ -0,0 +1,2 @@
+(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{17:function(e,t,r){},19:function(e,t,r){var a={"./ProfileFrame B&G Bars.png":[21,4],"./ProfileFrame Blue Bars.png":[22,5],"./ProfileFrame Green Bars.png":[23,6],"./ProfileFrame Mixed Bars.png":[24,7],"./ProfileFrame Purple.png":[25,8],"./ProfileFrame R&Y Bars.png":[26,9],"./ProfileFrame Red Bars.png":[27,10],"./ProfileFrame White Bars.png":[28,11],"./ProfileFrame Yellow Bars.png":[29,12]};function n(e){if(!r.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],n=t[0];return r.e(t[1]).then((function(){return r(n)}))}n.keys=function(){return Object.keys(a)},n.id=19,e.exports=n},20:function(e,t,r){"use strict";r.r(t);var a=r(0),n=r(1),c=r.n(n),o=r(9),i=r.n(o),s=r(8),l=r(2),u=(r(17),r(10)),f=r.n(u),h=r(4),d=r.n(h),m=r(7);var j=function(e){var t=e.onFrameChange,c=Object(n.useState)([]),o=Object(l.a)(c,2),i=o[0],s=o[1],u=Object(n.useState)(null),f=Object(l.a)(u,2),h=f[0],j=f[1];Object(n.useEffect)((function(){function e(){return(e=Object(m.a)(d.a.mark((function e(){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all(["ProfileFrame Purple","ProfileFrame Yellow Bars","ProfileFrame Red Bars","ProfileFrame Blue Bars","ProfileFrame Green Bars","ProfileFrame White Bars","ProfileFrame Mixed Bars","ProfileFrame R&Y Bars","ProfileFrame B&G Bars"].map(function(){var e=Object(m.a)(d.a.mark((function e(t){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,r(19)("./".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){s(e),j(e[0].src.default)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var b=Object(n.useCallback)((function(e){j(e.target.dataset.src)}),[j]);return Object(n.useEffect)((function(){t(h)}),[t,h]),Object(a.jsxs)("div",{className:"FrameChooser",children:[Object(a.jsx)("h2",{children:"Choose a frame:"}),i.map((function(e){var t=e.src.default,r=h===t;return Object(a.jsx)("img",{alt:e.name,"data-src":t,src:t,className:r?"frame choosen":"frame",onClick:b},t)}))]})},b=r.p+"static/media/HeaderImage.f98423dd.svg",p=r(11),g=1080;var O=function(){var e=Object(n.useState)(null),t=Object(l.a)(e,2),r=t[0],c=t[1],o=Object(n.useState)(null),i=Object(l.a)(o,2),u=i[0],h=i[1],d=Object(n.useState)(null),m=Object(l.a)(d,2),O=m[0],F=m[1],P=Object(n.useState)(null),v=Object(l.a)(P,2),x=v[0],B=v[1],w=Object(n.useCallback)((function(e){c(e)}),[c]),C=Object(n.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=g,e.height=g;var r,a,n=e.getContext("2d",{alpha:!0});t.width {\n async function loadFrames(){\n Promise.all(\n [\n 'ProfileFrame Purple',\n 'ProfileFrame Yellow Bars',\n 'ProfileFrame Red Bars',\n 'ProfileFrame Blue Bars',\n 'ProfileFrame Green Bars',\n 'ProfileFrame White Bars',\n 'ProfileFrame Mixed Bars',\n 'ProfileFrame R&Y Bars',\n 'ProfileFrame B&G Bars',\n ]\n .map(async frame_filename => {\n return {\n name: frame_filename,\n src: await import(`./frames/${frame_filename}.png`),\n }\n })\n )\n .then(new_frames => {\n setFrames(new_frames)\n setChoosenFrame(new_frames[0].src.default)\n })\n }\n loadFrames()\n }, [])\n\n const handleImageChoosing = useCallback(event => {\n setChoosenFrame(event.target.dataset.src)\n }, [setChoosenFrame])\n\n useEffect(() => {\n onFrameChange(choosenFrame)\n }, [onFrameChange, choosenFrame])\n\n return (\n \n
Choose a frame: \n {\n frames.map(frame => {\n const frame_src_path = frame.src.default\n const isChoosen = choosenFrame === frame_src_path\n return
\n })\n } \n
\n )\n}\n\nexport default FrameChooser;\n","export default __webpack_public_path__ + \"static/media/HeaderImage.f98423dd.svg\";","import { useState, useEffect, useCallback } from 'react'\nimport './App.css'\nimport download from 'downloadjs'\nimport FrameChooser from './FrameChooser.js'\nimport HeaderImage from './HeaderImage.svg'\n\nimport mergeImages from 'merge-images'\n\nconst frameSize = 1080\n\nfunction App() {\n const [frameURL, setFrameURL] = useState(null)\n const [originalPhoto, setOriginalPhoto] = useState(null)\n const [photo, setPhoto] = useState(null)\n const [combinedImage, setCombinedImage] = useState(null)\n\n const handleFrameURL = useCallback(newFrameURL => {\n setFrameURL(newFrameURL)\n }, [setFrameURL])\n\n const handleImage = useCallback(files_event => {\n const reader = new FileReader()\n reader.onload = reader_event => {\n const img = new Image()\n img.onload = function () {\n const offscreenCanvas = document.createElement('canvas')\n offscreenCanvas.width = frameSize\n offscreenCanvas.height = frameSize\n\n const offscreenCanvas_ctx = offscreenCanvas.getContext('2d', { alpha: true })\n\n let width, height;\n if (img.width < img.height) {\n height = (img.height / img.width) * frameSize\n width = frameSize\n } else {\n height = frameSize\n width = (img.width / img.height) * frameSize\n }\n \n offscreenCanvas_ctx.drawImage(\n img,\n (frameSize - width) / 2,\n (frameSize - height) / 2,\n width,\n height,\n );\n\n const pngUrl = offscreenCanvas.toDataURL()\n setPhoto(pngUrl)\n }\n img.src = reader_event.target.result\n setOriginalPhoto(reader_event.target.result)\n }\n reader.readAsDataURL(files_event.target.files[0])\n }, [setPhoto])\n\n useEffect(() => {\n mergeImages([\n ...(photo ? [photo] : []),\n ...(frameURL ? [frameURL] : []),\n ])\n .then(b64 => setCombinedImage(b64))\n }, [photo, frameURL])\n\n\n\nreturn (\n \n
\n\n
Choose your Photo: \n
It should best be a square image or your face in the middle. The photo is not saved and never leaves your computer.
\n\n
\n {!!photo ? : null}\n {!!photo ? 'Change Photo' : 'Load Photo'} \n \n \n\n
\n \n
Download your Photo: \n
\n
download(combinedImage, \"volt-profile-picture.png\", \"image/png\")}>Download Profile Picture \n
\n)\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/static/js/main.f98f9ce2.chunk.js b/static/js/main.f98f9ce2.chunk.js
deleted file mode 100644
index d96c649..0000000
--- a/static/js/main.f98f9ce2.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{17:function(e,t,r){},19:function(e,t,r){var a={"./ProfileFrame B&G Bars.png":[21,4],"./ProfileFrame Blue Bars.png":[22,5],"./ProfileFrame Green Bars.png":[23,6],"./ProfileFrame Mixed Bars.png":[24,7],"./ProfileFrame Purple.png":[25,8],"./ProfileFrame R&Y Bars.png":[26,9],"./ProfileFrame Red Bars.png":[27,10],"./ProfileFrame White Bars.png":[28,11],"./ProfileFrame Yellow Bars.png":[29,12]};function n(e){if(!r.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],n=t[0];return r.e(t[1]).then((function(){return r(n)}))}n.keys=function(){return Object.keys(a)},n.id=19,e.exports=n},20:function(e,t,r){"use strict";r.r(t);var a=r(0),n=r(1),c=r.n(n),o=r(9),s=r.n(o),i=r(8),l=r(2),u=(r(17),r(10)),f=r.n(u),h=r(4),d=r.n(h),m=r(7);var j=function(e){var t=e.onFrameChange,c=Object(n.useState)([]),o=Object(l.a)(c,2),s=o[0],i=o[1],u=Object(n.useState)(null),f=Object(l.a)(u,2),h=f[0],j=f[1];Object(n.useEffect)((function(){function e(){return(e=Object(m.a)(d.a.mark((function e(){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all(["ProfileFrame Purple","ProfileFrame Yellow Bars","ProfileFrame Red Bars","ProfileFrame Blue Bars","ProfileFrame Green Bars","ProfileFrame White Bars","ProfileFrame Mixed Bars","ProfileFrame R&Y Bars","ProfileFrame B&G Bars"].map(function(){var e=Object(m.a)(d.a.mark((function e(t){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,r(19)("./".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){console.log(e),i(e),j(e[0].src.default)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var b=Object(n.useCallback)((function(e){j(e.target.dataset.src)}),[j]);return Object(n.useEffect)((function(){t(h)}),[t,h]),Object(a.jsxs)("div",{className:"FrameChooser",children:[Object(a.jsx)("h2",{children:"Choose a frame:"}),s.map((function(e){var t=e.src.default,r=h===t;return Object(a.jsx)("img",{alt:e.name,"data-src":t,src:t,className:r?"frame choosen":"frame",onClick:b},t)}))]})},b=r.p+"static/media/HeaderImage.f98423dd.svg",p=r(11),g=1080;var O=function(){var e=Object(n.useState)(null),t=Object(l.a)(e,2),r=t[0],c=t[1],o=Object(n.useState)(null),s=Object(l.a)(o,2),u=s[0],h=s[1],d=Object(n.useState)(null),m=Object(l.a)(d,2),O=m[0],F=m[1],P=Object(n.useState)(null),v=Object(l.a)(P,2),x=v[0],B=v[1],w=Object(n.useCallback)((function(e){c(e)}),[c]),C=Object(n.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=g,e.height=g;var r,a,n=e.getContext("2d",{alpha:!0});t.width {\n async function loadFrames(){\n Promise.all(\n [\n 'ProfileFrame Purple',\n 'ProfileFrame Yellow Bars',\n 'ProfileFrame Red Bars',\n 'ProfileFrame Blue Bars',\n 'ProfileFrame Green Bars',\n 'ProfileFrame White Bars',\n 'ProfileFrame Mixed Bars',\n 'ProfileFrame R&Y Bars',\n 'ProfileFrame B&G Bars',\n ]\n .map(async frame_filename => {\n return {\n name: frame_filename,\n src: await import(`./frames/${frame_filename}.png`),\n }\n })\n )\n .then(new_frames => {\n console.log(new_frames)\n setFrames(new_frames)\n setChoosenFrame(new_frames[0].src.default)\n })\n }\n loadFrames()\n }, [])\n\n const handleImageChoosing = useCallback(event => {\n setChoosenFrame(event.target.dataset.src)\n }, [setChoosenFrame])\n\n useEffect(() => {\n onFrameChange(choosenFrame)\n }, [onFrameChange, choosenFrame])\n\n return (\n \n
Choose a frame: \n {\n frames.map(frame => {\n const frame_src_path = frame.src.default\n const isChoosen = choosenFrame === frame_src_path\n return
\n })\n } \n
\n )\n}\n\nexport default FrameChooser;\n","export default __webpack_public_path__ + \"static/media/HeaderImage.f98423dd.svg\";","import { useState, useEffect, useCallback } from 'react'\nimport './App.css'\nimport download from 'downloadjs'\nimport FrameChooser from './FrameChooser.js'\nimport HeaderImage from './HeaderImage.svg'\n\nimport mergeImages from 'merge-images'\n\nconst frameSize = 1080\n\nfunction App() {\n const [frameURL, setFrameURL] = useState(null)\n const [originalPhoto, setOriginalPhoto] = useState(null)\n const [photo, setPhoto] = useState(null)\n const [combinedImage, setCombinedImage] = useState(null)\n\n const handleFrameURL = useCallback(newFrameURL => {\n setFrameURL(newFrameURL)\n }, [setFrameURL])\n\n const handleImage = useCallback(files_event => {\n const reader = new FileReader()\n reader.onload = reader_event => {\n const img = new Image()\n img.onload = function () {\n const offscreenCanvas = document.createElement('canvas')\n offscreenCanvas.width = frameSize\n offscreenCanvas.height = frameSize\n\n const offscreenCanvas_ctx = offscreenCanvas.getContext('2d', { alpha: true })\n\n let width, height;\n if (img.width < img.height) {\n height = (img.height / img.width) * frameSize\n width = frameSize\n } else {\n height = frameSize\n width = (img.width / img.height) * frameSize\n }\n \n offscreenCanvas_ctx.drawImage(\n img,\n (frameSize - width) / 2,\n (frameSize - height) / 2,\n width,\n height,\n );\n\n const pngUrl = offscreenCanvas.toDataURL()\n setPhoto(pngUrl)\n }\n img.src = reader_event.target.result\n setOriginalPhoto(reader_event.target.result)\n }\n reader.readAsDataURL(files_event.target.files[0])\n }, [setPhoto])\n\n useEffect(() => {\n mergeImages([\n ...(photo ? [photo] : []),\n ...(frameURL ? [frameURL] : []),\n ])\n .then(b64 => setCombinedImage(b64))\n }, [photo, frameURL])\n\n\n\nreturn (\n \n
\n\n
Choose your Photo: \n
It should best be a square image or your face in the middle. The photo is not saved and never leaves your computer.
\n\n
\n {!!photo ? : null}\n {!!photo ? 'Change Photo' : 'Load Photo'} \n \n \n\n
\n \n
Download your Photo: \n
\n
download(combinedImage, \"volt-profile-picture.png\", \"image/png\")}>Download Profile Picture \n
\n)\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}
\ No newline at end of file