From 31310fcdd1a95eebaf19e0d87396ac8eb5a5f798 Mon Sep 17 00:00:00 2001 From: Rizina Date: Tue, 31 Oct 2023 23:14:08 +0545 Subject: [PATCH] feat: added 'JokeOverHead' and 'Delete' methods missing from the original code --- src/assets/TemplateFactory.ts | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/assets/TemplateFactory.ts b/src/assets/TemplateFactory.ts index 3ebede5..c8be5ce 100644 --- a/src/assets/TemplateFactory.ts +++ b/src/assets/TemplateFactory.ts @@ -589,5 +589,66 @@ export const TemplateFactory = { } ] }; + }), + JokeOverHead: createTemplate((image: ImageSource) => { + return { + steps: [ + { + preprocess(_canvas, ctx) { + ctx.globalCompositeOperation = 'color'; + ctx.fillStyle = 'black'; + ctx.fillRect(0, 0, 425, 404); + } + }, + { + image: [ + { + source: new TemplateImage(image), + x: 125, + y: 130, + width: 140, + height: 135 + } + ] + }, + { + image: [ + { + source: new TemplateImage(ImageFactory.JOKEOVERHEAD), + x: 0, + y: 0, + width: 425, + height: 404 + } + ] + } + ] + }; + }), + Delete: createTemplate((image: ImageSource) => { + return { + steps: [ + { + image: [ + { + source: new TemplateImage(ImageFactory.DELETE), + x: 0, + y: 0 + } + ] + }, + { + image: [ + { + source: new TemplateImage(image), + x: 120, + y: 135, + width: 195, + height: 195 + } + ] + } + ] + }; }) };