move tests and replace by mode production

This commit is contained in:
Didictateur 2025-04-12 14:40:37 +02:00
parent 0061183e37
commit 18be98aa2a
20 changed files with 19 additions and 1735 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,66 +1 @@
/* (()=>{"use strict";const n=document.getElementById("myCanvas"),t=n.getContext("2d");n.width=1050,n.height=1050;const e=document.createElement("canvas");e.getContext("2d"),e.width=n.width,e.height=n.height,"undefined"!=typeof window&&function(){return n=this,e=void 0,i=function*(){t?console.log("Load begining\n"):console.error("Context canvas indisponible")},new((o=void 0)||(o=Promise))((function(t,c){function a(n){try{r(i.next(n))}catch(n){c(n)}}function d(n){try{r(i.throw(n))}catch(n){c(n)}}function r(n){var e;n.done?t(n.value):(e=n.value,e instanceof o?e:new o((function(n){n(e)}))).then(a,d)}r((i=i.apply(n,e||[])).next())}));var n,e,o,i}().catch(console.error)})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/display/dp5.ts":
/*!****************************!*\
!*** ./src/display/dp5.ts ***!
\****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cleanup: () => (/* binding */ cleanup),\n/* harmony export */ initDisplay: () => (/* binding */ initDisplay)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// Configuration globale\nconst CANVAS_ID = \"myCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 1050, h: 1050 };\nvar MOUSE = { x: 0, y: 0 };\nconst FPS = 30;\nconst FRAME_INTERVAL = 1000 / FPS;\n// variables globales\nconst DECKS = [];\nconst HANDS = [];\nvar GAME;\n// Optimisation des références\nlet animationFrameId;\nlet lastFrameTime = 0;\nconst callbacks = [];\n// Pré-calcul des dimensions\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\n// Cache statique\nconst staticCanvas = document.createElement('canvas');\nconst staticCtx = staticCanvas.getContext(\"2d\");\nstaticCanvas.width = canvas.width;\nstaticCanvas.height = canvas.height;\nfunction drawFrame() {\n if (!ctx)\n return;\n GAME === null || GAME === void 0 ? void 0 : GAME.draw(MOUSE);\n}\nfunction animationLoop(currentTime) {\n animationFrameId = requestAnimationFrame(animationLoop);\n const deltaTime = currentTime - lastFrameTime;\n if (deltaTime < FRAME_INTERVAL)\n return;\n lastFrameTime = currentTime - (deltaTime % FRAME_INTERVAL);\n drawFrame();\n}\nfunction initEventListeners() {\n const handlers = {\n mousedown: (e) => {\n GAME === null || GAME === void 0 ? void 0 : GAME.click(e);\n },\n mousemove: (e) => {\n MOUSE.x = e.x;\n MOUSE.y = e.y;\n }\n };\n callbacks.push(() => {\n canvas.removeEventListener('mousemove', handlers.mousemove);\n });\n canvas.addEventListener('mousedown', handlers.mousedown);\n}\nfunction preloadDeck(deck) {\n return __awaiter(this, void 0, void 0, function* () {\n yield deck.preload();\n });\n}\nfunction preloadHand(hand) {\n return __awaiter(this, void 0, void 0, function* () {\n yield hand.preload();\n });\n}\nfunction cleanup() {\n cancelAnimationFrame(animationFrameId);\n callbacks.forEach(fn => fn());\n}\nfunction initDisplay() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!ctx) {\n console.error(\"Context canvas indisponible\");\n return;\n }\n console.log(\"Load begining\\n\");\n // Préchargement des ressources si nécessaire\n // const deck = new Deck();\n // await preloadDeck(deck);\n });\n}\n// Initialisation automatique si le script est chargé directement\nif (typeof window !== 'undefined') {\n initDisplay().catch(console.error);\n}\n\n\n//# sourceURL=webpack:///./src/display/dp5.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./src/display/dp5.ts"](0, __webpack_exports__, __webpack_require__);
/******/
/******/ })()
;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,96 +1 @@
/* (()=>{"use strict";const t=document.getElementById("myTextCanvas"),n=t.getContext("2d");t.width=800,t.height=1050,n.fillStyle="#007733",n.fillRect(0,0,800,1050),function(t,n){return e=this,o=void 0,f=function*(){console.log(t,"\n");const e=yield fetch(t).then((t=>t.text())),o="#ffffff";n.fillStyle=o,n.font="30px Garamond";let l=!1,f="",i="",c="",a=1,r=0;for(var d of e)"*"===d?(i=""===i?"bold ":"",n.font=c+i+30+"px Garamond"):"~"===d?(c=""===c?"italic ":"",n.font=c+i+30+"px Garamond"):"#"===d?(f="#",l=!0):"{"===d?(l=!1,n.fillStyle=f):"}"===d?(f="",n.fillStyle=o):l?f+=d:"\n"===d?(a++,r=0):(n.fillText(d,10+r,50+35*a),r+=n.measureText(d).width)},new((l=void 0)||(l=Promise))((function(t,n){function i(t){try{a(f.next(t))}catch(t){n(t)}}function c(t){try{a(f.throw(t))}catch(t){n(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof l?e:new l((function(t){t(e)}))).then(i,c)}a((f=f.apply(e,o||[])).next())}));var e,o,l,f}("src/text/txt0.txt",n).catch((t=>console.error(t)))})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/text/parse.ts":
/*!***************************!*\
!*** ./src/text/parse.ts ***!
\***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawText: () => (/* binding */ drawText)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nfunction drawText(filePath, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(filePath, \"\\n\");\n const fileContent = yield fetch(filePath)\n .then(response => response.text());\n const size = 30;\n const dl = 5;\n const ll = 50;\n const xx = 10;\n const defaultColor = \"#ffffff\";\n ctx.fillStyle = defaultColor;\n ctx.font = size + \"px Garamond\";\n let readingColor = false;\n let color = \"\";\n let gras = \"\";\n let italic = \"\";\n let line = 1;\n let x = 0;\n for (var c of fileContent) {\n if (c === '*') {\n if (gras === \"\") {\n gras = \"bold \";\n }\n else {\n gras = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '~') {\n if (italic === \"\") {\n italic = \"italic \";\n }\n else {\n italic = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '#') {\n color = \"#\";\n readingColor = true;\n }\n else if (c === '{') {\n readingColor = false;\n ctx.fillStyle = color;\n }\n else if (c === '}') {\n color = \"\";\n ctx.fillStyle = defaultColor;\n }\n else if (readingColor) {\n color += c;\n }\n else if (c === '\\n') {\n line++;\n x = 0;\n }\n else {\n ctx.fillText(c, xx + x, ll + line * (size + dl));\n x += ctx.measureText(c).width;\n }\n }\n });\n}\n\n\n//# sourceURL=webpack:///./src/text/parse.ts?");
/***/ }),
/***/ "./src/text/txt0.ts":
/*!**************************!*\
!*** ./src/text/txt0.ts ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./src/text/parse.ts\");\n\nconst CANVAS_ID = \"myTextCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 800, h: 1050, color: \"#007733\" };\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\nconst path = \"src/text/\";\nctx.fillStyle = BG_RECT.color;\nctx.fillRect(BG_RECT.x, BG_RECT.y, BG_RECT.w, BG_RECT.h);\n(0,_parse__WEBPACK_IMPORTED_MODULE_0__.drawText)(path + \"txt0.txt\", ctx).catch(error => console.error(error));\n\n\n//# sourceURL=webpack:///./src/text/txt0.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/text/txt0.ts");
/******/
/******/ })()
;

View file

@ -1,96 +1 @@
/* (()=>{"use strict";const t=document.getElementById("myTextCanvas"),n=t.getContext("2d");t.width=800,t.height=1050,n.fillStyle="#007733",n.fillRect(0,0,800,1050),function(t,n){return e=this,o=void 0,f=function*(){console.log(t,"\n");const e=yield fetch(t).then((t=>t.text())),o="#ffffff";n.fillStyle=o,n.font="30px Garamond";let l=!1,f="",i="",c="",a=1,r=0;for(var d of e)"*"===d?(i=""===i?"bold ":"",n.font=c+i+30+"px Garamond"):"~"===d?(c=""===c?"italic ":"",n.font=c+i+30+"px Garamond"):"#"===d?(f="#",l=!0):"{"===d?(l=!1,n.fillStyle=f):"}"===d?(f="",n.fillStyle=o):l?f+=d:"\n"===d?(a++,r=0):(n.fillText(d,10+r,50+35*a),r+=n.measureText(d).width)},new((l=void 0)||(l=Promise))((function(t,n){function i(t){try{a(f.next(t))}catch(t){n(t)}}function c(t){try{a(f.throw(t))}catch(t){n(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof l?e:new l((function(t){t(e)}))).then(i,c)}a((f=f.apply(e,o||[])).next())}));var e,o,l,f}("src/text/txt1.txt",n).catch((t=>console.error(t)))})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/text/parse.ts":
/*!***************************!*\
!*** ./src/text/parse.ts ***!
\***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawText: () => (/* binding */ drawText)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nfunction drawText(filePath, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(filePath, \"\\n\");\n const fileContent = yield fetch(filePath)\n .then(response => response.text());\n const size = 30;\n const dl = 5;\n const ll = 50;\n const xx = 10;\n const defaultColor = \"#ffffff\";\n ctx.fillStyle = defaultColor;\n ctx.font = size + \"px Garamond\";\n let readingColor = false;\n let color = \"\";\n let gras = \"\";\n let italic = \"\";\n let line = 1;\n let x = 0;\n for (var c of fileContent) {\n if (c === '*') {\n if (gras === \"\") {\n gras = \"bold \";\n }\n else {\n gras = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '~') {\n if (italic === \"\") {\n italic = \"italic \";\n }\n else {\n italic = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '#') {\n color = \"#\";\n readingColor = true;\n }\n else if (c === '{') {\n readingColor = false;\n ctx.fillStyle = color;\n }\n else if (c === '}') {\n color = \"\";\n ctx.fillStyle = defaultColor;\n }\n else if (readingColor) {\n color += c;\n }\n else if (c === '\\n') {\n line++;\n x = 0;\n }\n else {\n ctx.fillText(c, xx + x, ll + line * (size + dl));\n x += ctx.measureText(c).width;\n }\n }\n });\n}\n\n\n//# sourceURL=webpack:///./src/text/parse.ts?");
/***/ }),
/***/ "./src/text/txt1.ts":
/*!**************************!*\
!*** ./src/text/txt1.ts ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./src/text/parse.ts\");\n\nconst CANVAS_ID = \"myTextCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 800, h: 1050, color: \"#007733\" };\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\nconst path = \"src/text/\";\nctx.fillStyle = BG_RECT.color;\nctx.fillRect(BG_RECT.x, BG_RECT.y, BG_RECT.w, BG_RECT.h);\n(0,_parse__WEBPACK_IMPORTED_MODULE_0__.drawText)(path + \"txt1.txt\", ctx).catch(error => console.error(error));\n\n\n//# sourceURL=webpack:///./src/text/txt1.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/text/txt1.ts");
/******/
/******/ })()
;

View file

@ -1,96 +1 @@
/* (()=>{"use strict";const t=document.getElementById("myTextCanvas"),n=t.getContext("2d");t.width=800,t.height=1050,n.fillStyle="#007733",n.fillRect(0,0,800,1050),function(t,n){return e=this,o=void 0,f=function*(){console.log(t,"\n");const e=yield fetch(t).then((t=>t.text())),o="#ffffff";n.fillStyle=o,n.font="30px Garamond";let l=!1,f="",i="",c="",a=1,r=0;for(var d of e)"*"===d?(i=""===i?"bold ":"",n.font=c+i+30+"px Garamond"):"~"===d?(c=""===c?"italic ":"",n.font=c+i+30+"px Garamond"):"#"===d?(f="#",l=!0):"{"===d?(l=!1,n.fillStyle=f):"}"===d?(f="",n.fillStyle=o):l?f+=d:"\n"===d?(a++,r=0):(n.fillText(d,10+r,50+35*a),r+=n.measureText(d).width)},new((l=void 0)||(l=Promise))((function(t,n){function i(t){try{a(f.next(t))}catch(t){n(t)}}function c(t){try{a(f.throw(t))}catch(t){n(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof l?e:new l((function(t){t(e)}))).then(i,c)}a((f=f.apply(e,o||[])).next())}));var e,o,l,f}("src/text/txt2.txt",n).catch((t=>console.error(t)))})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/text/parse.ts":
/*!***************************!*\
!*** ./src/text/parse.ts ***!
\***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawText: () => (/* binding */ drawText)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nfunction drawText(filePath, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(filePath, \"\\n\");\n const fileContent = yield fetch(filePath)\n .then(response => response.text());\n const size = 30;\n const dl = 5;\n const ll = 50;\n const xx = 10;\n const defaultColor = \"#ffffff\";\n ctx.fillStyle = defaultColor;\n ctx.font = size + \"px Garamond\";\n let readingColor = false;\n let color = \"\";\n let gras = \"\";\n let italic = \"\";\n let line = 1;\n let x = 0;\n for (var c of fileContent) {\n if (c === '*') {\n if (gras === \"\") {\n gras = \"bold \";\n }\n else {\n gras = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '~') {\n if (italic === \"\") {\n italic = \"italic \";\n }\n else {\n italic = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '#') {\n color = \"#\";\n readingColor = true;\n }\n else if (c === '{') {\n readingColor = false;\n ctx.fillStyle = color;\n }\n else if (c === '}') {\n color = \"\";\n ctx.fillStyle = defaultColor;\n }\n else if (readingColor) {\n color += c;\n }\n else if (c === '\\n') {\n line++;\n x = 0;\n }\n else {\n ctx.fillText(c, xx + x, ll + line * (size + dl));\n x += ctx.measureText(c).width;\n }\n }\n });\n}\n\n\n//# sourceURL=webpack:///./src/text/parse.ts?");
/***/ }),
/***/ "./src/text/txt2.ts":
/*!**************************!*\
!*** ./src/text/txt2.ts ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./src/text/parse.ts\");\n\nconst CANVAS_ID = \"myTextCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 800, h: 1050, color: \"#007733\" };\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\nconst path = \"src/text/\";\nctx.fillStyle = BG_RECT.color;\nctx.fillRect(BG_RECT.x, BG_RECT.y, BG_RECT.w, BG_RECT.h);\n(0,_parse__WEBPACK_IMPORTED_MODULE_0__.drawText)(path + \"txt2.txt\", ctx).catch(error => console.error(error));\n\n\n//# sourceURL=webpack:///./src/text/txt2.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/text/txt2.ts");
/******/
/******/ })()
;

View file

@ -1,96 +1 @@
/* (()=>{"use strict";const t=document.getElementById("myTextCanvas"),n=t.getContext("2d");t.width=800,t.height=1050,n.fillStyle="#007733",n.fillRect(0,0,800,1050),function(t,n){return e=this,o=void 0,f=function*(){console.log(t,"\n");const e=yield fetch(t).then((t=>t.text())),o="#ffffff";n.fillStyle=o,n.font="30px Garamond";let l=!1,f="",i="",c="",a=1,r=0;for(var d of e)"*"===d?(i=""===i?"bold ":"",n.font=c+i+30+"px Garamond"):"~"===d?(c=""===c?"italic ":"",n.font=c+i+30+"px Garamond"):"#"===d?(f="#",l=!0):"{"===d?(l=!1,n.fillStyle=f):"}"===d?(f="",n.fillStyle=o):l?f+=d:"\n"===d?(a++,r=0):(n.fillText(d,10+r,50+35*a),r+=n.measureText(d).width)},new((l=void 0)||(l=Promise))((function(t,n){function i(t){try{a(f.next(t))}catch(t){n(t)}}function c(t){try{a(f.throw(t))}catch(t){n(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof l?e:new l((function(t){t(e)}))).then(i,c)}a((f=f.apply(e,o||[])).next())}));var e,o,l,f}("src/text/txt3.txt",n).catch((t=>console.error(t)))})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/text/parse.ts":
/*!***************************!*\
!*** ./src/text/parse.ts ***!
\***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawText: () => (/* binding */ drawText)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nfunction drawText(filePath, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(filePath, \"\\n\");\n const fileContent = yield fetch(filePath)\n .then(response => response.text());\n const size = 30;\n const dl = 5;\n const ll = 50;\n const xx = 10;\n const defaultColor = \"#ffffff\";\n ctx.fillStyle = defaultColor;\n ctx.font = size + \"px Garamond\";\n let readingColor = false;\n let color = \"\";\n let gras = \"\";\n let italic = \"\";\n let line = 1;\n let x = 0;\n for (var c of fileContent) {\n if (c === '*') {\n if (gras === \"\") {\n gras = \"bold \";\n }\n else {\n gras = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '~') {\n if (italic === \"\") {\n italic = \"italic \";\n }\n else {\n italic = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '#') {\n color = \"#\";\n readingColor = true;\n }\n else if (c === '{') {\n readingColor = false;\n ctx.fillStyle = color;\n }\n else if (c === '}') {\n color = \"\";\n ctx.fillStyle = defaultColor;\n }\n else if (readingColor) {\n color += c;\n }\n else if (c === '\\n') {\n line++;\n x = 0;\n }\n else {\n ctx.fillText(c, xx + x, ll + line * (size + dl));\n x += ctx.measureText(c).width;\n }\n }\n });\n}\n\n\n//# sourceURL=webpack:///./src/text/parse.ts?");
/***/ }),
/***/ "./src/text/txt3.ts":
/*!**************************!*\
!*** ./src/text/txt3.ts ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./src/text/parse.ts\");\n\nconst CANVAS_ID = \"myTextCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 800, h: 1050, color: \"#007733\" };\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\nconst path = \"src/text/\";\nctx.fillStyle = BG_RECT.color;\nctx.fillRect(BG_RECT.x, BG_RECT.y, BG_RECT.w, BG_RECT.h);\n(0,_parse__WEBPACK_IMPORTED_MODULE_0__.drawText)(path + \"txt3.txt\", ctx).catch(error => console.error(error));\n\n\n//# sourceURL=webpack:///./src/text/txt3.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/text/txt3.ts");
/******/
/******/ })()
;

View file

@ -1,96 +1 @@
/* (()=>{"use strict";const t=document.getElementById("myTextCanvas"),n=t.getContext("2d");t.width=800,t.height=1050,n.fillStyle="#007733",n.fillRect(0,0,800,1050),function(t,n){return e=this,o=void 0,f=function*(){console.log(t,"\n");const e=yield fetch(t).then((t=>t.text())),o="#ffffff";n.fillStyle=o,n.font="30px Garamond";let l=!1,f="",i="",c="",a=1,r=0;for(var d of e)"*"===d?(i=""===i?"bold ":"",n.font=c+i+30+"px Garamond"):"~"===d?(c=""===c?"italic ":"",n.font=c+i+30+"px Garamond"):"#"===d?(f="#",l=!0):"{"===d?(l=!1,n.fillStyle=f):"}"===d?(f="",n.fillStyle=o):l?f+=d:"\n"===d?(a++,r=0):(n.fillText(d,10+r,50+35*a),r+=n.measureText(d).width)},new((l=void 0)||(l=Promise))((function(t,n){function i(t){try{a(f.next(t))}catch(t){n(t)}}function c(t){try{a(f.throw(t))}catch(t){n(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof l?e:new l((function(t){t(e)}))).then(i,c)}a((f=f.apply(e,o||[])).next())}));var e,o,l,f}("src/text/txt4.txt",n).catch((t=>console.error(t)))})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/text/parse.ts":
/*!***************************!*\
!*** ./src/text/parse.ts ***!
\***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawText: () => (/* binding */ drawText)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nfunction drawText(filePath, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(filePath, \"\\n\");\n const fileContent = yield fetch(filePath)\n .then(response => response.text());\n const size = 30;\n const dl = 5;\n const ll = 50;\n const xx = 10;\n const defaultColor = \"#ffffff\";\n ctx.fillStyle = defaultColor;\n ctx.font = size + \"px Garamond\";\n let readingColor = false;\n let color = \"\";\n let gras = \"\";\n let italic = \"\";\n let line = 1;\n let x = 0;\n for (var c of fileContent) {\n if (c === '*') {\n if (gras === \"\") {\n gras = \"bold \";\n }\n else {\n gras = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '~') {\n if (italic === \"\") {\n italic = \"italic \";\n }\n else {\n italic = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '#') {\n color = \"#\";\n readingColor = true;\n }\n else if (c === '{') {\n readingColor = false;\n ctx.fillStyle = color;\n }\n else if (c === '}') {\n color = \"\";\n ctx.fillStyle = defaultColor;\n }\n else if (readingColor) {\n color += c;\n }\n else if (c === '\\n') {\n line++;\n x = 0;\n }\n else {\n ctx.fillText(c, xx + x, ll + line * (size + dl));\n x += ctx.measureText(c).width;\n }\n }\n });\n}\n\n\n//# sourceURL=webpack:///./src/text/parse.ts?");
/***/ }),
/***/ "./src/text/txt4.ts":
/*!**************************!*\
!*** ./src/text/txt4.ts ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./src/text/parse.ts\");\n\nconst CANVAS_ID = \"myTextCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 800, h: 1050, color: \"#007733\" };\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\nconst path = \"src/text/\";\nctx.fillStyle = BG_RECT.color;\nctx.fillRect(BG_RECT.x, BG_RECT.y, BG_RECT.w, BG_RECT.h);\n(0,_parse__WEBPACK_IMPORTED_MODULE_0__.drawText)(path + \"txt4.txt\", ctx).catch(error => console.error(error));\n\n\n//# sourceURL=webpack:///./src/text/txt4.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/text/txt4.ts");
/******/
/******/ })()
;

View file

@ -1,96 +1 @@
/* (()=>{"use strict";const t=document.getElementById("myTextCanvas"),n=t.getContext("2d");t.width=800,t.height=1050,n.fillStyle="#007733",n.fillRect(0,0,800,1050),function(t,n){return e=this,o=void 0,f=function*(){console.log(t,"\n");const e=yield fetch(t).then((t=>t.text())),o="#ffffff";n.fillStyle=o,n.font="30px Garamond";let l=!1,f="",i="",c="",a=1,r=0;for(var d of e)"*"===d?(i=""===i?"bold ":"",n.font=c+i+30+"px Garamond"):"~"===d?(c=""===c?"italic ":"",n.font=c+i+30+"px Garamond"):"#"===d?(f="#",l=!0):"{"===d?(l=!1,n.fillStyle=f):"}"===d?(f="",n.fillStyle=o):l?f+=d:"\n"===d?(a++,r=0):(n.fillText(d,10+r,50+35*a),r+=n.measureText(d).width)},new((l=void 0)||(l=Promise))((function(t,n){function i(t){try{a(f.next(t))}catch(t){n(t)}}function c(t){try{a(f.throw(t))}catch(t){n(t)}}function a(n){var e;n.done?t(n.value):(e=n.value,e instanceof l?e:new l((function(t){t(e)}))).then(i,c)}a((f=f.apply(e,o||[])).next())}));var e,o,l,f}("src/text/txt5.txt",n).catch((t=>console.error(t)))})();
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/text/parse.ts":
/*!***************************!*\
!*** ./src/text/parse.ts ***!
\***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawText: () => (/* binding */ drawText)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nfunction drawText(filePath, ctx) {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(filePath, \"\\n\");\n const fileContent = yield fetch(filePath)\n .then(response => response.text());\n const size = 30;\n const dl = 5;\n const ll = 50;\n const xx = 10;\n const defaultColor = \"#ffffff\";\n ctx.fillStyle = defaultColor;\n ctx.font = size + \"px Garamond\";\n let readingColor = false;\n let color = \"\";\n let gras = \"\";\n let italic = \"\";\n let line = 1;\n let x = 0;\n for (var c of fileContent) {\n if (c === '*') {\n if (gras === \"\") {\n gras = \"bold \";\n }\n else {\n gras = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '~') {\n if (italic === \"\") {\n italic = \"italic \";\n }\n else {\n italic = \"\";\n }\n ctx.font = italic + gras + size + \"px Garamond\";\n }\n else if (c === '#') {\n color = \"#\";\n readingColor = true;\n }\n else if (c === '{') {\n readingColor = false;\n ctx.fillStyle = color;\n }\n else if (c === '}') {\n color = \"\";\n ctx.fillStyle = defaultColor;\n }\n else if (readingColor) {\n color += c;\n }\n else if (c === '\\n') {\n line++;\n x = 0;\n }\n else {\n ctx.fillText(c, xx + x, ll + line * (size + dl));\n x += ctx.measureText(c).width;\n }\n }\n });\n}\n\n\n//# sourceURL=webpack:///./src/text/parse.ts?");
/***/ }),
/***/ "./src/text/txt5.ts":
/*!**************************!*\
!*** ./src/text/txt5.ts ***!
\**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./src/text/parse.ts\");\n\nconst CANVAS_ID = \"myTextCanvas\";\nconst BG_RECT = { x: 0, y: 0, w: 800, h: 1050, color: \"#007733\" };\nconst canvas = document.getElementById(CANVAS_ID);\nconst ctx = canvas.getContext(\"2d\");\ncanvas.width = BG_RECT.w;\ncanvas.height = BG_RECT.h;\nconst path = \"src/text/\";\nctx.fillStyle = BG_RECT.color;\nctx.fillRect(BG_RECT.x, BG_RECT.y, BG_RECT.w, BG_RECT.h);\n(0,_parse__WEBPACK_IMPORTED_MODULE_0__.drawText)(path + \"txt5.txt\", ctx).catch(error => console.error(error));\n\n\n//# sourceURL=webpack:///./src/text/txt5.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./src/text/txt5.ts");
/******/
/******/ })()
;

View file

@ -1,4 +1,4 @@
import { Hand } from "../hand" import { Hand } from "../src/hand"
import { assert } from "./assert"; import { assert } from "./assert";
let h0 = new Hand("s1s1"); let h0 = new Hand("s1s1");

View file

@ -1,7 +1,6 @@
import { assert } from "./assert" import { assert } from "./assert"
import { yakus } from "../yakus/yaku" import { yakus } from "../src/yakus/yaku"
import { Hand } from "../hand" import { Hand } from "../src/hand"
import { Group } from "../group";
let count = 0; let count = 0;
let total = 0; let total = 0;

View file

@ -5,7 +5,7 @@ const fs = require('fs');
function getEntryPoints() { function getEntryPoints() {
const displayDir = path.resolve(__dirname, 'src', 'display'); const displayDir = path.resolve(__dirname, 'src', 'display');
const textDir = path.resolve(__dirname, 'src', 'text'); const textDir = path.resolve(__dirname, 'src', 'text');
const testDir = path.resolve(__dirname, 'src', 'tests'); const testDir = path.resolve(__dirname, '.', 'tests');
const files = fs.readdirSync(displayDir); // Lire les fichiers du répertoire const files = fs.readdirSync(displayDir); // Lire les fichiers du répertoire
const texts = fs.readdirSync(textDir); const texts = fs.readdirSync(textDir);
const tests = fs.readdirSync(testDir); const tests = fs.readdirSync(testDir);