diff --git a/README.md b/README.md index 5e3cf32..885c122 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,8 @@ const fs = require('fs') Minimal({ avatar: "https://cdn.discordapp.com/avatars/786504767358238720/f65e8322c0c290e7fc1d9ad20322256b.webp", name: "FLAMEFACE", - type: "WELCOME" + type: "WELCOME", + message: "YOUR ARE 100TH MEMBER" }).then(x => { fs.writeFileSync("greetify.png", x) }) diff --git a/package.json b/package.json index a789643..7076efd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "deploy": "npm publish", "deploy:beta": "npm publish --tag beta", "test:m": "cd tests && node index.mjs", - "test:c": "cd tests && node --watch index.js" + "test:c": "cd tests && node index.js" }, "keywords": [ "welcome-card", @@ -51,4 +51,4 @@ "@napi-rs/canvas": "^0.1.51", "cropify": "latest" } -} +} \ No newline at end of file diff --git a/src/themes/minimal.ts b/src/themes/minimal.ts index 588c394..793dbf4 100644 --- a/src/themes/minimal.ts +++ b/src/themes/minimal.ts @@ -3,13 +3,13 @@ import { cropImage } from "cropify" import { registerFont } from "../functions/registerFont"; import { minimalType } from "../typings/types"; -registerFont("PlusJakartaSans-Bold.ttf", "pjs-bold") -registerFont("PlusJakartaSans-ExtraBold.ttf", "pjs-ebold") -registerFont("PlusJakartaSans-ExtraLight.ttf", "pjs-elight") -registerFont("PlusJakartaSans-Light.ttf", "pjs-light") -registerFont("PlusJakartaSans-Medium.ttf", "pjs-medium") -registerFont("PlusJakartaSans-Regular.ttf", "pjs-regular") -registerFont("PlusJakartaSans-SemiBold.ttf", "pjs-sbold") +registerFont("PlusJakartaSans-Bold.ttf", "bold") +registerFont("PlusJakartaSans-ExtraBold.ttf", "extrabold") +registerFont("PlusJakartaSans-ExtraLight.ttf", "extralight") +registerFont("PlusJakartaSans-Light.ttf", "light") +registerFont("PlusJakartaSans-Medium.ttf", "medium") +registerFont("PlusJakartaSans-Regular.ttf", "regular") +registerFont("PlusJakartaSans-SemiBold.ttf", "semibold") const Minimal = async (option: minimalType) => { if (!option.backgroundImage) { @@ -45,7 +45,7 @@ const Minimal = async (option: minimalType) => { imagePath: option.backgroundImage, borderRadius: 100, cropCenter: true, - width: 1280, + width: 1280, height: 720 }) @@ -63,17 +63,17 @@ const Minimal = async (option: minimalType) => { ctx.drawImage(await loadImage(avatar), 505, 56) ctx.fillStyle = option.nameColor - ctx.font = "100px pjs-ebold" + ctx.font = "100px extrabold" ctx.textAlign = 'center'; ctx.fillText(option.name.toUpperCase(), centerX, 440) ctx.fillStyle = option.typeColor - ctx.font = "65px pjs-bold" + ctx.font = "65px bold" ctx.textAlign = 'center'; ctx.fillText(option.type.toUpperCase(), centerX, 530) ctx.fillStyle = option.messageColor - ctx.font = "40px pjs-light" + ctx.font = "40px light" ctx.textAlign = 'center'; ctx.fillText(option.message.toUpperCase(), centerX, 655) diff --git a/src/themes/panorama.ts b/src/themes/panorama.ts index f1a46e8..8e7eb71 100644 --- a/src/themes/panorama.ts +++ b/src/themes/panorama.ts @@ -3,13 +3,13 @@ import { cropImage } from "cropify" import { registerFont } from "../functions/registerFont"; import { panoramaType } from "../typings/types"; -registerFont("PlusJakartaSans-Bold.ttf", "pjs-bold") -registerFont("PlusJakartaSans-ExtraBold.ttf", "pjs-ebold") -registerFont("PlusJakartaSans-ExtraLight.ttf", "pjs-elight") -registerFont("PlusJakartaSans-Light.ttf", "pjs-light") -registerFont("PlusJakartaSans-Medium.ttf", "pjs-medium") -registerFont("PlusJakartaSans-Regular.ttf", "pjs-regular") -registerFont("PlusJakartaSans-SemiBold.ttf", "pjs-sbold") +registerFont("PlusJakartaSans-Bold.ttf", "bold") +registerFont("PlusJakartaSans-ExtraBold.ttf", "extrabold") +registerFont("PlusJakartaSans-ExtraLight.ttf", "extralight") +registerFont("PlusJakartaSans-Light.ttf", "light") +registerFont("PlusJakartaSans-Medium.ttf", "medium") +registerFont("PlusJakartaSans-Regular.ttf", "regular") +registerFont("PlusJakartaSans-SemiBold.ttf", "semibold") const Panorama = async (option: panoramaType) => { if (!option.backgroundImage) { @@ -57,14 +57,14 @@ const Panorama = async (option: panoramaType) => { ctx.drawImage(await loadImage(avatar), 90, 60) ctx.fillStyle = option.nameColor - ctx.font = "80px pjs-ebold" + ctx.font = "80px extrabold" ctx.fillText(option.name.toUpperCase(), 420, centerY + 75) ctx.fillStyle = option.typeColor - ctx.font = "65px pjs-light" + ctx.font = "65px light" ctx.fillText(option.type.toUpperCase(), 420, centerY - 25) return canvas.toBuffer("image/png") } -export { Panorama } +export { Panorama } \ No newline at end of file diff --git a/tests/greetify.png b/tests/greetify.png index f1979c8..831fa18 100644 Binary files a/tests/greetify.png and b/tests/greetify.png differ diff --git a/tests/index.js b/tests/index.js index c674cbf..e92743f 100644 --- a/tests/index.js +++ b/tests/index.js @@ -2,7 +2,10 @@ const { Minimal } = require("../dist/index"); const fs = require('fs') Minimal({ - + avatar: "https://cdn.discordapp.com/avatars/786504767358238720/f65e8322c0c290e7fc1d9ad20322256b.webp", + name: "FLAMEFACE", + type: "WELCOME", + message: "YOUR ARE 100TH MEMBER" }).then(x => { fs.writeFileSync("greetify.png", x) }) \ No newline at end of file diff --git a/tests/index.mjs b/tests/index.mjs new file mode 100644 index 0000000..86f9f61 --- /dev/null +++ b/tests/index.mjs @@ -0,0 +1,11 @@ +import { Minimal } from "../dist/index.mjs"; +import fs from 'fs' + +Minimal({ + avatar: "https://cdn.discordapp.com/avatars/786504767358238720/f65e8322c0c290e7fc1d9ad20322256b.webp", + name: "FLAMEFACE", + type: "WELCOME", + message: "YOUR ARE 100TH MEMBER" +}).then(x => { + fs.writeFileSync("greetify.png", x) +}) \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 309c0ae..d38dce2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { - "target": "ES2016", - "module": "CommonJS", + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", "esModuleInterop": true, "strict": true, "outDir": "dist", diff --git a/tsup.config.ts b/tsup.config.ts index 042915f..b857cf0 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -6,5 +6,5 @@ export default defineConfig({ dts: true, shims: true, skipNodeModulesBundle: true, - clean: ['./src/index.ts'] + clean: true }); \ No newline at end of file