@opexa/portal-components 0.0.262 → 0.0.263

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.
Files changed (36) hide show
  1. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  2. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  3. package/dist/components/KYC/IdentityVerification.js +20 -15
  4. package/dist/components/KYC/KYC.d.ts +1 -1
  5. package/dist/components/KYC/KYC.js +3 -3
  6. package/dist/components/KYC/KYC.lazy.js +1 -3
  7. package/dist/components/KYC/useKYC.d.ts +0 -2
  8. package/dist/components/KYC/useKYC.js +0 -4
  9. package/dist/components/KYC/utils.js +18 -18
  10. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +2 -2
  11. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +3 -3
  12. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +1 -1
  13. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
  14. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
  15. package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
  16. package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
  17. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  18. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  19. package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +1 -1
  20. package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +1 -1
  21. package/dist/components/shared/SelfieImageField/useSelfieImageField.js +19 -17
  22. package/dist/handlers/postTransformIdFrontImage.js +21 -6
  23. package/dist/handlers/postTransformSelfieImage.js +20 -9
  24. package/dist/services/queries.js +2570 -2570
  25. package/dist/styles/theme.css +694 -694
  26. package/package.json +166 -166
  27. package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
  28. package/dist/components/shared/IdDocumentField.client.js +0 -204
  29. package/dist/components/shared/IdDocumentField.d.ts +0 -2
  30. package/dist/components/shared/IdDocumentField.js +0 -11
  31. package/dist/components/shared/SelfieField.client.d.ts +0 -20
  32. package/dist/components/shared/SelfieField.client.js +0 -327
  33. package/dist/components/shared/SelfieField.d.ts +0 -2
  34. package/dist/components/shared/SelfieField.js +0 -11
  35. package/dist/handlers.d.ts +0 -43
  36. package/dist/handlers.js +0 -297
@@ -1,184 +1,184 @@
1
- @keyframes arrow-green-flash {
2
- 0% {
3
- color: #abefc6;
4
- }
5
- 100% {
6
- color: #079455;
7
- }
8
- }
9
-
10
- .animate-arrow-green-flash-1 {
11
- animation: arrow-green-flash 0.4s infinite;
12
- animation-delay: -0.2s;
13
- }
14
-
15
- .animate-arrow-green-flash-2 {
16
- animation: arrow-green-flash 0.4s infinite;
17
- animation-delay: -0.1s;
18
- }
19
-
20
- .animate-arrow-green-flash-3 {
21
- animation: arrow-green-flash 0.4s infinite;
22
- }
23
-
24
- @keyframes arrow-red-flash {
25
- 0%,
26
- 100% {
27
- color: #f97066;
28
- }
29
- 50% {
30
- color: #fecdca;
31
- }
32
- }
33
-
34
- .animate-arrow-red-flash-1 {
35
- animation: arrow-red-flash 0.4s infinite;
36
- }
37
-
38
- .animate-arrow-red-flash-2 {
39
- animation: arrow-red-flash 0.4s infinite;
40
- animation-delay: -0.1s;
41
- }
42
-
43
- .animate-arrow-red-flash-3 {
44
- animation: arrow-red-flash 0.4s infinite;
45
- animation-delay: -0.2s;
46
- }
47
-
48
- /* Animated BG */
49
- @keyframes rotate {
50
- to {
51
- transform: rotate(1turn);
52
- }
53
- }
54
-
55
- .light-rays {
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
- right: 0;
60
- bottom: 0;
61
- overflow: hidden;
62
-
63
- --first: var(--color-bg-tertiary);
64
- --second: var(--color-bg-quaternary);
65
- }
66
-
67
- .light-rays::before,
68
- .light-rays::after {
69
- content: '';
70
- position: absolute;
71
- top: var(--light-rays-top, 150px);
72
- left: calc(50% - 90px);
73
- margin: -100vmax;
74
- width: 200vmax;
75
- height: 200vmax;
76
- opacity: 0.6;
77
- transform-origin: center;
78
- }
79
-
80
- .light-rays::before {
81
- background: conic-gradient(
82
- var(--first) 0deg 7.2deg,
83
- var(--second) 7.2deg 14.4deg,
84
- var(--first) 14.4deg 21.6deg,
85
- var(--second) 21.6deg 28.8deg,
86
- var(--first) 28.8deg 36deg,
87
- var(--second) 36deg 43.2deg,
88
- var(--first) 43.2deg 50.4deg,
89
- var(--second) 50.4deg 57.6deg,
90
- var(--first) 57.6deg 64.8deg,
91
- var(--second) 64.8deg 72deg,
92
- var(--first) 72deg 79.2deg,
93
- var(--second) 79.2deg 86.4deg,
94
- var(--first) 86.4deg 93.6deg,
95
- var(--second) 93.6deg 100.8deg,
96
- var(--first) 100.8deg 108deg,
97
- var(--second) 108deg 115.2deg,
98
- var(--first) 115.2deg 122.4deg,
99
- var(--second) 122.4deg 129.6deg,
100
- var(--first) 129.6deg 136.8deg,
101
- var(--second) 136.8deg 144deg,
102
- var(--first) 144deg 151.2deg,
103
- var(--second) 151.2deg 158.4deg,
104
- var(--first) 158.4deg 165.6deg,
105
- var(--second) 165.6deg 172.8deg,
106
- var(--first) 172.8deg 180deg,
107
- var(--second) 180deg 187.2deg,
108
- var(--first) 187.2deg 194.4deg,
109
- var(--second) 194.4deg 201.6deg,
110
- var(--first) 201.6deg 208.8deg,
111
- var(--second) 208.8deg 216deg,
112
- var(--first) 216deg 223.2deg,
113
- var(--second) 223.2deg 230.4deg,
114
- var(--first) 230.4deg 237.6deg,
115
- var(--second) 237.6deg 244.8deg,
116
- var(--first) 244.8deg 252deg,
117
- var(--second) 252deg 259.2deg,
118
- var(--first) 259.2deg 266.4deg,
119
- var(--second) 266.4deg 273.6deg,
120
- var(--first) 273.6deg 280.8deg,
121
- var(--second) 280.8deg 288deg,
122
- var(--first) 288deg 295.2deg,
123
- var(--second) 295.2deg 302.4deg,
124
- var(--first) 302.4deg 309.6deg,
125
- var(--second) 309.6deg 316.8deg,
126
- var(--first) 316.8deg 324deg,
127
- var(--second) 324deg 331.2deg,
128
- var(--first) 331.2deg 338.4deg,
129
- var(--second) 338.4deg 345.6deg,
130
- var(--first) 345.6deg 352.8deg,
131
- var(--second) 352.8deg 360deg
132
- );
133
- animation: rotate 20s linear infinite;
134
- }
135
-
136
- @media (max-width: 1024px) {
137
- .light-rays::before,
138
- .light-rays::after {
139
- left: auto;
140
- right: 11%;
141
- }
142
- }
143
-
144
- /* ScrollArea.module.css */
145
- .scrollArea {
146
- overflow-y: scroll;
147
- padding-right: 4px;
148
- }
149
-
150
- /* WebKit-based browsers */
151
- .scrollArea::-webkit-scrollbar {
152
- width: 8px;
153
- }
154
-
155
- .scrollArea::-webkit-scrollbar-track {
156
- background: var(--color-bg-primary-alt);
157
- border-radius: 9999px;
158
- }
159
-
160
- .scrollArea::-webkit-scrollbar-thumb {
161
- background-color: var(--color-bg-quaternary);
162
- border-radius: 9999px;
163
- }
164
-
165
- @keyframes waveColor {
166
- 0%,
167
- 2.5% {
168
- color: var(--wave-highlight-color);
169
- }
170
- 2.51%,
171
- 100% {
172
- color: var(--color-brand-300);
173
- }
174
- }
175
-
176
- .animate-wave-color-success {
177
- --wave-highlight-color: var(--color-success-800);
178
- animation: waveColor 4s ease-in-out infinite;
179
- }
180
-
181
- .animate-wave-color-error {
182
- --wave-highlight-color: var(--color-error-600);
183
- animation: waveColor 4s ease-in-out infinite;
184
- }
1
+ @keyframes arrow-green-flash {
2
+ 0% {
3
+ color: #abefc6;
4
+ }
5
+ 100% {
6
+ color: #079455;
7
+ }
8
+ }
9
+
10
+ .animate-arrow-green-flash-1 {
11
+ animation: arrow-green-flash 0.4s infinite;
12
+ animation-delay: -0.2s;
13
+ }
14
+
15
+ .animate-arrow-green-flash-2 {
16
+ animation: arrow-green-flash 0.4s infinite;
17
+ animation-delay: -0.1s;
18
+ }
19
+
20
+ .animate-arrow-green-flash-3 {
21
+ animation: arrow-green-flash 0.4s infinite;
22
+ }
23
+
24
+ @keyframes arrow-red-flash {
25
+ 0%,
26
+ 100% {
27
+ color: #f97066;
28
+ }
29
+ 50% {
30
+ color: #fecdca;
31
+ }
32
+ }
33
+
34
+ .animate-arrow-red-flash-1 {
35
+ animation: arrow-red-flash 0.4s infinite;
36
+ }
37
+
38
+ .animate-arrow-red-flash-2 {
39
+ animation: arrow-red-flash 0.4s infinite;
40
+ animation-delay: -0.1s;
41
+ }
42
+
43
+ .animate-arrow-red-flash-3 {
44
+ animation: arrow-red-flash 0.4s infinite;
45
+ animation-delay: -0.2s;
46
+ }
47
+
48
+ /* Animated BG */
49
+ @keyframes rotate {
50
+ to {
51
+ transform: rotate(1turn);
52
+ }
53
+ }
54
+
55
+ .light-rays {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ right: 0;
60
+ bottom: 0;
61
+ overflow: hidden;
62
+
63
+ --first: var(--color-bg-tertiary);
64
+ --second: var(--color-bg-quaternary);
65
+ }
66
+
67
+ .light-rays::before,
68
+ .light-rays::after {
69
+ content: '';
70
+ position: absolute;
71
+ top: var(--light-rays-top, 150px);
72
+ left: calc(50% - 90px);
73
+ margin: -100vmax;
74
+ width: 200vmax;
75
+ height: 200vmax;
76
+ opacity: 0.6;
77
+ transform-origin: center;
78
+ }
79
+
80
+ .light-rays::before {
81
+ background: conic-gradient(
82
+ var(--first) 0deg 7.2deg,
83
+ var(--second) 7.2deg 14.4deg,
84
+ var(--first) 14.4deg 21.6deg,
85
+ var(--second) 21.6deg 28.8deg,
86
+ var(--first) 28.8deg 36deg,
87
+ var(--second) 36deg 43.2deg,
88
+ var(--first) 43.2deg 50.4deg,
89
+ var(--second) 50.4deg 57.6deg,
90
+ var(--first) 57.6deg 64.8deg,
91
+ var(--second) 64.8deg 72deg,
92
+ var(--first) 72deg 79.2deg,
93
+ var(--second) 79.2deg 86.4deg,
94
+ var(--first) 86.4deg 93.6deg,
95
+ var(--second) 93.6deg 100.8deg,
96
+ var(--first) 100.8deg 108deg,
97
+ var(--second) 108deg 115.2deg,
98
+ var(--first) 115.2deg 122.4deg,
99
+ var(--second) 122.4deg 129.6deg,
100
+ var(--first) 129.6deg 136.8deg,
101
+ var(--second) 136.8deg 144deg,
102
+ var(--first) 144deg 151.2deg,
103
+ var(--second) 151.2deg 158.4deg,
104
+ var(--first) 158.4deg 165.6deg,
105
+ var(--second) 165.6deg 172.8deg,
106
+ var(--first) 172.8deg 180deg,
107
+ var(--second) 180deg 187.2deg,
108
+ var(--first) 187.2deg 194.4deg,
109
+ var(--second) 194.4deg 201.6deg,
110
+ var(--first) 201.6deg 208.8deg,
111
+ var(--second) 208.8deg 216deg,
112
+ var(--first) 216deg 223.2deg,
113
+ var(--second) 223.2deg 230.4deg,
114
+ var(--first) 230.4deg 237.6deg,
115
+ var(--second) 237.6deg 244.8deg,
116
+ var(--first) 244.8deg 252deg,
117
+ var(--second) 252deg 259.2deg,
118
+ var(--first) 259.2deg 266.4deg,
119
+ var(--second) 266.4deg 273.6deg,
120
+ var(--first) 273.6deg 280.8deg,
121
+ var(--second) 280.8deg 288deg,
122
+ var(--first) 288deg 295.2deg,
123
+ var(--second) 295.2deg 302.4deg,
124
+ var(--first) 302.4deg 309.6deg,
125
+ var(--second) 309.6deg 316.8deg,
126
+ var(--first) 316.8deg 324deg,
127
+ var(--second) 324deg 331.2deg,
128
+ var(--first) 331.2deg 338.4deg,
129
+ var(--second) 338.4deg 345.6deg,
130
+ var(--first) 345.6deg 352.8deg,
131
+ var(--second) 352.8deg 360deg
132
+ );
133
+ animation: rotate 20s linear infinite;
134
+ }
135
+
136
+ @media (max-width: 1024px) {
137
+ .light-rays::before,
138
+ .light-rays::after {
139
+ left: auto;
140
+ right: 11%;
141
+ }
142
+ }
143
+
144
+ /* ScrollArea.module.css */
145
+ .scrollArea {
146
+ overflow-y: scroll;
147
+ padding-right: 4px;
148
+ }
149
+
150
+ /* WebKit-based browsers */
151
+ .scrollArea::-webkit-scrollbar {
152
+ width: 8px;
153
+ }
154
+
155
+ .scrollArea::-webkit-scrollbar-track {
156
+ background: var(--color-bg-primary-alt);
157
+ border-radius: 9999px;
158
+ }
159
+
160
+ .scrollArea::-webkit-scrollbar-thumb {
161
+ background-color: var(--color-bg-quaternary);
162
+ border-radius: 9999px;
163
+ }
164
+
165
+ @keyframes waveColor {
166
+ 0%,
167
+ 2.5% {
168
+ color: var(--wave-highlight-color);
169
+ }
170
+ 2.51%,
171
+ 100% {
172
+ color: var(--color-brand-300);
173
+ }
174
+ }
175
+
176
+ .animate-wave-color-success {
177
+ --wave-highlight-color: var(--color-success-800);
178
+ animation: waveColor 4s ease-in-out infinite;
179
+ }
180
+
181
+ .animate-wave-color-error {
182
+ --wave-highlight-color: var(--color-error-600);
183
+ animation: waveColor 4s ease-in-out infinite;
184
+ }
@@ -43,7 +43,7 @@ export function IdFrontImageField__client(props) {
43
43
  }, disabled: context.field?.disabled ||
44
44
  context.query.isLoading ||
45
45
  context.mutation.isPending ||
46
- localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: _jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" }) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
46
+ localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: context.query.isLoading ? (_jsx(Spinner02Icon, { className: "text-text-placeholder-subtle size-4" })) : (_jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" })) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
47
47
  context.inputRef.current?.click();
48
48
  }, disabled: context.field?.disabled ||
49
49
  context.field?.readOnly ||
@@ -43,7 +43,7 @@ export function SelfieImageField__client(props) {
43
43
  }, disabled: context.field?.disabled ||
44
44
  context.query.isLoading ||
45
45
  context.mutation.isPending ||
46
- localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: _jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" }) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
46
+ localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.query.data?.url && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "border-border-primary shadow-xs mx-auto flex size-8 items-center justify-center rounded-sm border", children: context.query.isLoading ? (_jsx(Spinner02Icon, { className: "text-text-placeholder-subtle size-4" })) : (_jsx(UploadCloud02Icon, { className: "text-text-placeholder-subtle size-4" })) }), _jsxs("h2", { className: "text-text-tertiary-600 mt-lg", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
47
47
  context.inputRef.current?.click();
48
48
  }, disabled: context.field?.disabled ||
49
49
  context.field?.readOnly ||
@@ -43,9 +43,14 @@ export function useSelfieImageField(props) {
43
43
  const inputRef = useRef(null);
44
44
  const maskRef = useRef(null);
45
45
  const guideRef = useRef(null);
46
+ const [validatingFace, setValidatingFace] = useState(false);
46
47
  const camera = useCamera({
47
- async transform(ctx) {
48
- const hasFace = await validateFaceFromImage(ctx.image);
48
+ async transform(data) {
49
+ if (validatingFace)
50
+ return { ok: true, data };
51
+ setValidatingFace(true);
52
+ const hasFace = await validateFaceFromImage(data.image);
53
+ setValidatingFace(false);
49
54
  if (!hasFace) {
50
55
  return {
51
56
  ok: false,
@@ -57,15 +62,15 @@ export function useSelfieImageField(props) {
57
62
  }
58
63
  const body = new FormData();
59
64
  const guideRect = guideRef.current?.getBoundingClientRect();
60
- const videoRect = ctx.video.getBoundingClientRect();
65
+ const videoRect = data.video.getBoundingClientRect();
61
66
  invariant(guideRect, "'guideRef.getBoundingClientRect()' fails");
62
- const scaleX = ctx.image.width / videoRect.width;
63
- const scaleY = ctx.image.height / videoRect.height;
67
+ const scaleX = data.image.width / videoRect.width;
68
+ const scaleY = data.image.height / videoRect.height;
64
69
  const cropTop = (guideRect.top - videoRect.top) * scaleY;
65
70
  const cropLeft = (guideRect.left - videoRect.left) * scaleX;
66
71
  const cropWidth = guideRect.width * scaleX;
67
72
  const cropHeight = guideRect.height * scaleY;
68
- body.append('image', ctx.file);
73
+ body.append('image', data.file);
69
74
  body.append('cropTop', cropTop.toString());
70
75
  body.append('cropLeft', cropLeft.toString());
71
76
  body.append('cropWidth', cropWidth.toString());
@@ -75,8 +80,8 @@ export function useSelfieImageField(props) {
75
80
  body,
76
81
  });
77
82
  const blob = await response.blob();
78
- const file = new File([blob], ctx.file.name, {
79
- type: ctx.file.type,
83
+ const file = new File([blob], data.file.name, {
84
+ type: data.file.type,
80
85
  endings: 'native',
81
86
  lastModified: Date.now(),
82
87
  });
@@ -84,8 +89,8 @@ export function useSelfieImageField(props) {
84
89
  const image = new Image();
85
90
  image.src = url;
86
91
  image.alt = '';
87
- image.width = ctx.image.width;
88
- image.height = ctx.image.height;
92
+ image.width = data.image.width;
93
+ image.height = data.image.height;
89
94
  return {
90
95
  ok: true,
91
96
  data: {
@@ -110,7 +115,7 @@ export function useSelfieImageField(props) {
110
115
  }
111
116
  setFaceFound(await validateFaceFromVideo(camera.videoRef.current, guideRef.current));
112
117
  }, disclosure.open && !camera.data && !camera.error && !camera.loading
113
- ? 1000
118
+ ? 500
114
119
  : null);
115
120
  return {
116
121
  field,
@@ -137,7 +142,7 @@ async function getImageFaceDetector() {
137
142
  }
138
143
  const detector = await FaceDetector.createFromOptions(__vision__, {
139
144
  runningMode: 'IMAGE',
140
- minDetectionConfidence: 0.75,
145
+ minDetectionConfidence: 0.8,
141
146
  baseOptions: {
142
147
  delegate: 'GPU',
143
148
  modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
@@ -155,7 +160,7 @@ async function getVideoFaceDetector() {
155
160
  }
156
161
  const detector = await FaceDetector.createFromOptions(__vision__, {
157
162
  runningMode: 'VIDEO',
158
- minDetectionConfidence: 0.75,
163
+ minDetectionConfidence: 0.8,
159
164
  baseOptions: {
160
165
  delegate: 'GPU',
161
166
  modelAssetPath: 'https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite',
@@ -185,10 +190,7 @@ async function validateFaceFromVideo(video, guide) {
185
190
  const detection = result.detections.at(0);
186
191
  if (!detection)
187
192
  return false;
188
- const category = detection.categories.at(0);
189
- if (!category || category.score < 0.75)
190
- return false;
191
- const videoRect = video.getBoundingClientRect(); // DOM position & size
193
+ const videoRect = video.getBoundingClientRect();
192
194
  const guideRect = guide.getBoundingClientRect();
193
195
  if (!detection.boundingBox)
194
196
  return false;
@@ -44,19 +44,34 @@ export async function postTransformIdFrontImage(request) {
44
44
  height: parsed.data.cropHeight,
45
45
  })
46
46
  .resize({
47
+ fit: 'contain',
47
48
  width: 1200,
48
49
  height: 757,
49
50
  kernel: sharp.kernel.lanczos3,
50
51
  withoutEnlargement: true,
51
52
  })
52
53
  .modulate({
53
- brightness: 1.025,
54
- saturation: 1.025,
54
+ brightness: 1.03,
55
+ saturation: 1.05,
56
+ })
57
+ .median(1)
58
+ .blur(0.3)
59
+ .sharpen({
60
+ sigma: 1,
61
+ m1: 0.5,
62
+ m2: 1.0,
63
+ x1: 2,
64
+ y2: 10,
65
+ y3: 20,
66
+ })
67
+ .webp({
68
+ effort: 6,
69
+ quality: 100,
70
+ alphaQuality: 100,
71
+ lossless: false,
72
+ nearLossless: false,
73
+ smartSubsample: true,
55
74
  })
56
- .median(3)
57
- .blur()
58
- .sharpen()
59
- .webp()
60
75
  .toBuffer();
61
76
  return new NextResponse(cropped, {
62
77
  headers: {
@@ -44,23 +44,34 @@ export async function postTransformSelfieImage(request) {
44
44
  height: parsed.data.cropHeight,
45
45
  })
46
46
  .resize({
47
+ fit: 'contain',
47
48
  width: 1200,
48
49
  height: 1200,
49
50
  kernel: sharp.kernel.lanczos3,
50
51
  withoutEnlargement: true,
51
52
  })
53
+ .modulate({
54
+ brightness: 1.03,
55
+ saturation: 1.05,
56
+ })
57
+ .median(1)
58
+ .blur(0.3)
52
59
  .sharpen({
53
- sigma: 1.15,
54
- m1: 2.0,
55
- m2: 5.0,
60
+ sigma: 1,
61
+ m1: 0.5,
62
+ m2: 1.0,
63
+ x1: 2,
64
+ y2: 10,
65
+ y3: 20,
56
66
  })
57
- .modulate({
58
- brightness: 1.025,
59
- saturation: 1.025,
67
+ .webp({
68
+ effort: 6,
69
+ quality: 100,
70
+ alphaQuality: 100,
71
+ lossless: false,
72
+ nearLossless: false,
73
+ smartSubsample: true,
60
74
  })
61
- .median(3)
62
- .blur()
63
- .webp()
64
75
  .toBuffer();
65
76
  return new NextResponse(cropped, {
66
77
  headers: {