@azuro-org/images-generator 1.3.9 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -107,7 +107,7 @@ function __generator(thisArg, body) {
107
107
  fs.mkdirSync(output);
108
108
  }
109
109
  filePath = "".concat(output.replace(/\/$/, ''), "/").concat(filename.replace(/\..+$/, ''), ".").concat(type);
110
- return [4 /*yield*/, content.screenshot({ path: filePath })];
110
+ return [4 /*yield*/, content.screenshot({ path: filePath, type: type })];
111
111
  case 9:
112
112
  _d.sent();
113
113
  return [4 /*yield*/, page.close()];
@@ -3,22 +3,50 @@ declare const cardTypes: {
3
3
  readonly business: {
4
4
  readonly bottomImg: "images/business.png";
5
5
  readonly bgImg: "images/bg-business.png";
6
+ readonly stampImg: "images/stamp.png";
7
+ readonly additionalClassName: "";
6
8
  };
7
9
  readonly culture: {
8
10
  readonly bottomImg: "images/culture.png";
9
11
  readonly bgImg: "images/bg-culture.png";
12
+ readonly stampImg: "images/stamp.png";
13
+ readonly additionalClassName: "";
10
14
  };
11
15
  readonly crypto: {
12
16
  readonly bottomImg: "images/crypto.png";
13
17
  readonly bgImg: "images/bg-crypto.png";
18
+ readonly stampImg: "images/stamp.png";
19
+ readonly additionalClassName: "";
14
20
  };
15
21
  readonly politics: {
16
22
  readonly bottomImg: "images/politics.png";
17
23
  readonly bgImg: "images/bg-politics.png";
24
+ readonly stampImg: "images/stamp.png";
25
+ readonly additionalClassName: "";
18
26
  };
19
27
  readonly fomo: {
20
28
  readonly bottomImg: "images/fomo.png";
21
29
  readonly bgImg: "images/bg-fomo.png";
30
+ readonly stampImg: "images/stamp.png";
31
+ readonly additionalClassName: "";
32
+ };
33
+ readonly 'monad-1': {
34
+ readonly bottomImg: "images/monad-1.png";
35
+ readonly bgImg: "images/bg-monad-1.png";
36
+ readonly stampImg: "images/stamp-monad.png";
37
+ readonly additionalClassName: "monad";
38
+ };
39
+ readonly 'monad-2': {
40
+ readonly bottomImg: "images/monad-2.png";
41
+ readonly bgImg: "images/bg-monad-2.png";
42
+ readonly stampImg: "images/stamp-monad.png";
43
+ readonly additionalClassName: "monad";
44
+ };
45
+ readonly 'monad-3': {
46
+ readonly bottomImg: "images/monad-3.png";
47
+ readonly bgImg: "images/bg-monad-3.png";
48
+ readonly stampImg: "images/stamp-monad.png";
49
+ readonly additionalClassName: "monad";
22
50
  };
23
51
  };
24
52
  export type Props = {
@@ -203,10 +203,19 @@
203
203
  height: 100%;
204
204
  mix-blend-mode: multiply;
205
205
  }
206
+
207
+ .monad .bottom-img {
208
+ mix-blend-mode: unset;
209
+ }
210
+
211
+ .monad .username {
212
+ box-shadow: 0px -4px 23px 0px rgba(136, 0, 255, 1) inset;
213
+ border-radius: 40px;
214
+ }
206
215
  </style>
207
216
  </head>
208
217
  <body>
209
- <div class="wrapper flex justify-center">
218
+ <div class="wrapper flex justify-center {additionalClassName}">
210
219
  <img src="{wrapperImg}" alt="" class="wrapper__img">
211
220
  <div class="card">
212
221
  <img src="{bgImg}" alt="" class="bg">
@@ -2,22 +2,50 @@ import {_ as __awaiter,a as __generator,g as getFile,b as getBase64Image,d as do
2
2
  'business': {
3
3
  bottomImg: 'images/business.png',
4
4
  bgImg: 'images/bg-business.png',
5
+ stampImg: 'images/stamp.png',
6
+ additionalClassName: ''
5
7
  },
6
8
  'culture': {
7
9
  bottomImg: 'images/culture.png',
8
10
  bgImg: 'images/bg-culture.png',
11
+ stampImg: 'images/stamp.png',
12
+ additionalClassName: ''
9
13
  },
10
14
  'crypto': {
11
15
  bottomImg: 'images/crypto.png',
12
16
  bgImg: 'images/bg-crypto.png',
17
+ stampImg: 'images/stamp.png',
18
+ additionalClassName: ''
13
19
  },
14
20
  'politics': {
15
21
  bottomImg: 'images/politics.png',
16
22
  bgImg: 'images/bg-politics.png',
23
+ stampImg: 'images/stamp.png',
24
+ additionalClassName: ''
17
25
  },
18
26
  'fomo': {
19
27
  bottomImg: 'images/fomo.png',
20
28
  bgImg: 'images/bg-fomo.png',
29
+ stampImg: 'images/stamp.png',
30
+ additionalClassName: ''
31
+ },
32
+ 'monad-1': {
33
+ bottomImg: 'images/monad-1.png',
34
+ bgImg: 'images/bg-monad-1.png',
35
+ stampImg: 'images/stamp-monad.png',
36
+ additionalClassName: 'monad'
37
+ },
38
+ 'monad-2': {
39
+ bottomImg: 'images/monad-2.png',
40
+ bgImg: 'images/bg-monad-2.png',
41
+ stampImg: 'images/stamp-monad.png',
42
+ additionalClassName: 'monad'
43
+ },
44
+ 'monad-3': {
45
+ bottomImg: 'images/monad-3.png',
46
+ bgImg: 'images/bg-monad-3.png',
47
+ stampImg: 'images/stamp-monad.png',
48
+ additionalClassName: 'monad'
21
49
  },
22
50
  };
23
51
  // 2020
@@ -26,21 +54,25 @@ var template = {
26
54
  height: 1060,
27
55
  type: 'jpeg',
28
56
  html: function (props) { return __awaiter(void 0, void 0, void 0, function () {
29
- var type, avatarUrl, username, _a, isWide, _b, bottomImg, bgImg, html, stampImage, bottomImage, bgImage, avatarImage;
57
+ var type, avatarUrl, username, _a, isWide, _b, bottomImg, bgImg, stampImg, additionalClassName, html, bottomImage, stampImage, bgImage, avatarImage;
30
58
  return __generator(this, function (_c) {
31
59
  switch (_c.label) {
32
60
  case 0:
33
61
  type = props.type, avatarUrl = props.avatarUrl, username = props.username, _a = props.isWide, isWide = _a === void 0 ? true : _a;
34
- _b = cardTypes[type], bottomImg = _b.bottomImg, bgImg = _b.bgImg;
62
+ _b = cardTypes[type], bottomImg = _b.bottomImg, bgImg = _b.bgImg, stampImg = _b.stampImg, additionalClassName = _b.additionalClassName;
35
63
  html = getFile(path.join(__dirname, 'index.html'));
36
- stampImage = getBase64Image(path.resolve(__dirname, 'images/stamp.png'));
37
- bottomImage = getBase64Image(path.resolve(__dirname, bottomImg));
64
+ bottomImage = '';
65
+ stampImage = getBase64Image(path.resolve(__dirname, stampImg));
38
66
  bgImage = getBase64Image(path.resolve(__dirname, bgImg));
67
+ if (bottomImg) {
68
+ bottomImage = getBase64Image(path.resolve(__dirname, bottomImg));
69
+ }
39
70
  return [4 /*yield*/, downloadImage(avatarUrl)];
40
71
  case 1:
41
72
  avatarImage = _c.sent();
42
73
  return [2 /*return*/, html
43
74
  .replace('--wrapper-width', "".concat(isWide ? 2020 : 850, "px"))
75
+ .replace('{additionalClassName}', additionalClassName)
44
76
  .replace('{bgImg}', bgImage)
45
77
  .replace('{wrapperImg}', bottomImage)
46
78
  .replace('{bottomImg}', bottomImage)
package/lib/index.js CHANGED
@@ -107,7 +107,7 @@ function __generator(thisArg, body) {
107
107
  fs__default["default"].mkdirSync(output);
108
108
  }
109
109
  filePath = "".concat(output.replace(/\/$/, ''), "/").concat(filename.replace(/\..+$/, ''), ".").concat(type);
110
- return [4 /*yield*/, content.screenshot({ path: filePath })];
110
+ return [4 /*yield*/, content.screenshot({ path: filePath, type: type })];
111
111
  case 9:
112
112
  _d.sent();
113
113
  return [4 /*yield*/, page.close()];
@@ -3,22 +3,50 @@ declare const cardTypes: {
3
3
  readonly business: {
4
4
  readonly bottomImg: "images/business.png";
5
5
  readonly bgImg: "images/bg-business.png";
6
+ readonly stampImg: "images/stamp.png";
7
+ readonly additionalClassName: "";
6
8
  };
7
9
  readonly culture: {
8
10
  readonly bottomImg: "images/culture.png";
9
11
  readonly bgImg: "images/bg-culture.png";
12
+ readonly stampImg: "images/stamp.png";
13
+ readonly additionalClassName: "";
10
14
  };
11
15
  readonly crypto: {
12
16
  readonly bottomImg: "images/crypto.png";
13
17
  readonly bgImg: "images/bg-crypto.png";
18
+ readonly stampImg: "images/stamp.png";
19
+ readonly additionalClassName: "";
14
20
  };
15
21
  readonly politics: {
16
22
  readonly bottomImg: "images/politics.png";
17
23
  readonly bgImg: "images/bg-politics.png";
24
+ readonly stampImg: "images/stamp.png";
25
+ readonly additionalClassName: "";
18
26
  };
19
27
  readonly fomo: {
20
28
  readonly bottomImg: "images/fomo.png";
21
29
  readonly bgImg: "images/bg-fomo.png";
30
+ readonly stampImg: "images/stamp.png";
31
+ readonly additionalClassName: "";
32
+ };
33
+ readonly 'monad-1': {
34
+ readonly bottomImg: "images/monad-1.png";
35
+ readonly bgImg: "images/bg-monad-1.png";
36
+ readonly stampImg: "images/stamp-monad.png";
37
+ readonly additionalClassName: "monad";
38
+ };
39
+ readonly 'monad-2': {
40
+ readonly bottomImg: "images/monad-2.png";
41
+ readonly bgImg: "images/bg-monad-2.png";
42
+ readonly stampImg: "images/stamp-monad.png";
43
+ readonly additionalClassName: "monad";
44
+ };
45
+ readonly 'monad-3': {
46
+ readonly bottomImg: "images/monad-3.png";
47
+ readonly bgImg: "images/bg-monad-3.png";
48
+ readonly stampImg: "images/stamp-monad.png";
49
+ readonly additionalClassName: "monad";
22
50
  };
23
51
  };
24
52
  export type Props = {
@@ -203,10 +203,19 @@
203
203
  height: 100%;
204
204
  mix-blend-mode: multiply;
205
205
  }
206
+
207
+ .monad .bottom-img {
208
+ mix-blend-mode: unset;
209
+ }
210
+
211
+ .monad .username {
212
+ box-shadow: 0px -4px 23px 0px rgba(136, 0, 255, 1) inset;
213
+ border-radius: 40px;
214
+ }
206
215
  </style>
207
216
  </head>
208
217
  <body>
209
- <div class="wrapper flex justify-center">
218
+ <div class="wrapper flex justify-center {additionalClassName}">
210
219
  <img src="{wrapperImg}" alt="" class="wrapper__img">
211
220
  <div class="card">
212
221
  <img src="{bgImg}" alt="" class="bg">
@@ -2,22 +2,50 @@
2
2
  'business': {
3
3
  bottomImg: 'images/business.png',
4
4
  bgImg: 'images/bg-business.png',
5
+ stampImg: 'images/stamp.png',
6
+ additionalClassName: ''
5
7
  },
6
8
  'culture': {
7
9
  bottomImg: 'images/culture.png',
8
10
  bgImg: 'images/bg-culture.png',
11
+ stampImg: 'images/stamp.png',
12
+ additionalClassName: ''
9
13
  },
10
14
  'crypto': {
11
15
  bottomImg: 'images/crypto.png',
12
16
  bgImg: 'images/bg-crypto.png',
17
+ stampImg: 'images/stamp.png',
18
+ additionalClassName: ''
13
19
  },
14
20
  'politics': {
15
21
  bottomImg: 'images/politics.png',
16
22
  bgImg: 'images/bg-politics.png',
23
+ stampImg: 'images/stamp.png',
24
+ additionalClassName: ''
17
25
  },
18
26
  'fomo': {
19
27
  bottomImg: 'images/fomo.png',
20
28
  bgImg: 'images/bg-fomo.png',
29
+ stampImg: 'images/stamp.png',
30
+ additionalClassName: ''
31
+ },
32
+ 'monad-1': {
33
+ bottomImg: 'images/monad-1.png',
34
+ bgImg: 'images/bg-monad-1.png',
35
+ stampImg: 'images/stamp-monad.png',
36
+ additionalClassName: 'monad'
37
+ },
38
+ 'monad-2': {
39
+ bottomImg: 'images/monad-2.png',
40
+ bgImg: 'images/bg-monad-2.png',
41
+ stampImg: 'images/stamp-monad.png',
42
+ additionalClassName: 'monad'
43
+ },
44
+ 'monad-3': {
45
+ bottomImg: 'images/monad-3.png',
46
+ bgImg: 'images/bg-monad-3.png',
47
+ stampImg: 'images/stamp-monad.png',
48
+ additionalClassName: 'monad'
21
49
  },
22
50
  };
23
51
  // 2020
@@ -26,21 +54,25 @@ var template = {
26
54
  height: 1060,
27
55
  type: 'jpeg',
28
56
  html: function (props) { return index._(void 0, void 0, void 0, function () {
29
- var type, avatarUrl, username, _a, isWide, _b, bottomImg, bgImg, html, stampImage, bottomImage, bgImage, avatarImage;
57
+ var type, avatarUrl, username, _a, isWide, _b, bottomImg, bgImg, stampImg, additionalClassName, html, bottomImage, stampImage, bgImage, avatarImage;
30
58
  return index.a(this, function (_c) {
31
59
  switch (_c.label) {
32
60
  case 0:
33
61
  type = props.type, avatarUrl = props.avatarUrl, username = props.username, _a = props.isWide, isWide = _a === void 0 ? true : _a;
34
- _b = cardTypes[type], bottomImg = _b.bottomImg, bgImg = _b.bgImg;
62
+ _b = cardTypes[type], bottomImg = _b.bottomImg, bgImg = _b.bgImg, stampImg = _b.stampImg, additionalClassName = _b.additionalClassName;
35
63
  html = index.g(path__default["default"].join(__dirname, 'index.html'));
36
- stampImage = index.b(path__default["default"].resolve(__dirname, 'images/stamp.png'));
37
- bottomImage = index.b(path__default["default"].resolve(__dirname, bottomImg));
64
+ bottomImage = '';
65
+ stampImage = index.b(path__default["default"].resolve(__dirname, stampImg));
38
66
  bgImage = index.b(path__default["default"].resolve(__dirname, bgImg));
67
+ if (bottomImg) {
68
+ bottomImage = index.b(path__default["default"].resolve(__dirname, bottomImg));
69
+ }
39
70
  return [4 /*yield*/, index.d(avatarUrl)];
40
71
  case 1:
41
72
  avatarImage = _c.sent();
42
73
  return [2 /*return*/, html
43
74
  .replace('--wrapper-width', "".concat(isWide ? 2020 : 850, "px"))
75
+ .replace('{additionalClassName}', additionalClassName)
44
76
  .replace('{bgImg}', bgImage)
45
77
  .replace('{wrapperImg}', bottomImage)
46
78
  .replace('{bottomImg}', bottomImage)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azuro-org/images-generator",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "license": "ISC",
5
5
  "engines": {
6
6
  "node": ">=16.15.1",