-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-generativo-index-js-02631bf1ccaefbca794f.js.map
1 lines (1 loc) · 4.09 KB
/
component---src-pages-generativo-index-js-02631bf1ccaefbca794f.js.map
1
{"version":3,"sources":["webpack:///./src/pages/generativo/styles.module.css","webpack:///./src/Generativo/Canvas.js","webpack:///./src/pages/generativo/index.js"],"names":["module","exports","Canvas","memo","onMount","bump","ct","useRef","useEffect","canvas","w","current","undefined","context","width","size","ref","canvasEl","getContext","dpr","window","devicePixelRatio","scale","setupCanvas","height","GenerativoPage","useState","setCurrent","Date","now","setBump","className","styles","container","animate","id","large","onChange","selectedTabId","vertical","Object","entries","generadores","map","i","key","generador","title","nombre","render","icon","onClick"],"mappings":"8EACAA,EAAOC,QAAU,CAAC,UAAY,kCAAkC,OAAS,iC,8ECwC1DC,EArBAC,gBAAK,YAA6B,IAA1BC,EAAyB,EAAzBA,QAAyB,IAAhBC,YAAgB,MAAT,GAAS,EACxCC,EAAKC,iBAAO,MASlB,OAPAC,qBAAU,WARQ,IAAC,EAAEC,EACfC,EAQe,OAAfJ,EAAGK,cAA2CC,IAAvBN,EAAGK,QAAQE,UATrB,EAUHP,EAAGK,QAVEF,EAAa,EAAbA,OACfC,EAAID,EAAOK,MACjBL,EAAOK,MAAQ,EACfL,EAAOK,MAAQJ,EAQXN,EAAQE,EAAGK,QAAQE,QAASP,EAAGK,QAAQI,SAExC,CAACX,EAASE,EAAID,IAGf,4BACEW,IAAK,SAAAC,GACgB,OAAfX,EAAGK,UAAkBL,EAAGK,QA/BhB,SAAAF,GAClB,GAAe,OAAXA,EAAJ,CAGA,IAAMI,EAAUJ,EAAOS,WAAW,MAE5BH,EAAON,EAAOK,MACdK,EAAMC,OAAOC,iBAGnB,OADAR,EAAQS,MAAMH,EAAKA,GACZ,CAAEV,SAAQI,UAASE,SAqBkBQ,CAAYN,KAEpDH,MAAO,IACPU,OAAQ,S,6CCACC,UA5BQ,WAAO,IAAD,EACGC,mBAAS,OAAhCf,EADoB,KACXgB,EADW,OAEHD,mBAASE,KAAKC,OAA/BxB,EAFoB,KAEdyB,EAFc,KAI3B,OACE,kBAAC,IAAD,KACE,yBAAKC,UAAWC,IAAOC,WACrB,kBAAC,IAAD,CACEC,SAAS,EACTC,GAAG,SACHC,OAAO,EACPC,SAAUV,EACVW,cAAe3B,EACf4B,UAAU,GAETC,OAAOC,QAAQC,KAAaC,KAAI,WAAmBC,GAAnB,IAAEC,EAAF,KAAOC,EAAP,YAC/B,kBAAC,IAAD,CAAKX,GAAIU,EAAKA,IAAKA,EAAKE,MAAUH,EAAI,EAAT,MAAgBE,EAAUE,aAG3D,yBAAKjB,UAAWC,IAAOvB,QACrB,kBAAC,EAAD,CAAQL,QAASsC,IAAY/B,GAASsC,OAAQ5C,KAAMA,IACpD,kBAAC,IAAD,CAAQ6C,KAAK,UAAUC,QAAS,kBAAMrB,EAAQF,KAAKC","file":"component---src-pages-generativo-index-js-02631bf1ccaefbca794f.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"styles-module--container--1rgkd\",\"canvas\":\"styles-module--canvas--1BPwE\"};","import React, { useEffect, useRef, memo } from \"react\"\n\nconst setupCanvas = canvas => {\n if (canvas === null) {\n return\n }\n const context = canvas.getContext(\"2d\")\n\n const size = canvas.width\n const dpr = window.devicePixelRatio\n\n context.scale(dpr, dpr)\n return { canvas, context, size }\n}\n\nconst resetCanvas = ({ canvas }) => {\n const w = canvas.width\n canvas.width = 1\n canvas.width = w\n}\nconst Canvas = memo(({ onMount, bump = \"\" }) => {\n const ct = useRef(null)\n\n useEffect(() => {\n if (ct.current !== null && ct.current.context !== undefined) {\n resetCanvas(ct.current)\n onMount(ct.current.context, ct.current.size)\n }\n }, [onMount, ct, bump])\n\n return (\n <canvas\n ref={canvasEl => {\n if (ct.current === null) ct.current = setupCanvas(canvasEl)\n }}\n width={600}\n height={600}\n />\n )\n})\n\nexport default Canvas\n","import React, { useState } from \"react\"\n\nimport Layout from \"../../components/Layout/layout\"\nimport Canvas from \"../../Generativo/Canvas\"\nimport generadores from \"../../Generativo/generadores\"\nimport { Tabs, Tab, Button } from \"@blueprintjs/core\"\nimport styles from \"./styles.module.css\"\n\nconst GenerativoPage = () => {\n const [current, setCurrent] = useState(\"uno\")\n const [bump, setBump] = useState(Date.now())\n\n return (\n <Layout>\n <div className={styles.container}>\n <Tabs\n animate={true}\n id=\"navbar\"\n large={true}\n onChange={setCurrent}\n selectedTabId={current}\n vertical={true}\n >\n {Object.entries(generadores).map(([key, generador], i) => (\n <Tab id={key} key={key} title={`${i + 1} - ${generador.nombre}`} />\n ))}\n </Tabs>\n <div className={styles.canvas}>\n <Canvas onMount={generadores[current].render} bump={bump} />\n <Button icon=\"refresh\" onClick={() => setBump(Date.now)} />\n </div>\n </div>\n </Layout>\n )\n}\n\nexport default GenerativoPage\n"],"sourceRoot":""}