webs-sdk 0.18.28 → 0.18.30
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/README.md +1 -1
- package/dist/components/ARFilters/ARFilters.d.ts +1 -2
- package/dist/components/ARFilters/ARFilters.d.ts.map +1 -1
- package/dist/components/ARFilters/ARFilters.js +7 -67
- package/dist/components/ARFilters/ARFilters.js.map +1 -1
- package/dist/components/ARFilters/FilterCarousel.d.ts +1 -2
- package/dist/components/ARFilters/FilterCarousel.d.ts.map +1 -1
- package/dist/components/ARFilters/FilterCarousel.js +10 -58
- package/dist/components/ARFilters/FilterCarousel.js.map +1 -1
- package/dist/components/ARFilters/Popups.d.ts +3 -4
- package/dist/components/ARFilters/Popups.d.ts.map +1 -1
- package/dist/components/ARFilters/Popups.js +5 -23
- package/dist/components/ARFilters/Popups.js.map +1 -1
- package/dist/components/AvatarAI.d.ts +3 -4
- package/dist/components/AvatarAI.d.ts.map +1 -1
- package/dist/components/AvatarAI.js +117 -232
- package/dist/components/AvatarAI.js.map +1 -1
- package/dist/components/CookieConsent/CookieConsent.d.ts +1 -2
- package/dist/components/CookieConsent/CookieConsent.d.ts.map +1 -1
- package/dist/components/CookieConsent/CookieConsent.js +4 -66
- package/dist/components/CookieConsent/CookieConsent.js.map +1 -1
- package/dist/components/CreativeFaceSwap.d.ts +3 -4
- package/dist/components/CreativeFaceSwap.d.ts.map +1 -1
- package/dist/components/CreativeFaceSwap.js +56 -203
- package/dist/components/CreativeFaceSwap.js.map +1 -1
- package/dist/components/MemeGenerator.d.ts +2 -3
- package/dist/components/MemeGenerator.d.ts.map +1 -1
- package/dist/components/MemeGenerator.js +62 -162
- package/dist/components/MemeGenerator.js.map +1 -1
- package/dist/components/Quiz.d.ts +2 -3
- package/dist/components/Quiz.d.ts.map +1 -1
- package/dist/components/Quiz.js +260 -345
- package/dist/components/Quiz.js.map +1 -1
- package/dist/components/Ringtone.d.ts +2 -3
- package/dist/components/Ringtone.d.ts.map +1 -1
- package/dist/components/Ringtone.js +17 -78
- package/dist/components/Ringtone.js.map +1 -1
- package/dist/components/SpinningWheel/SpinningWheel.d.ts +1 -2
- package/dist/components/SpinningWheel/SpinningWheel.d.ts.map +1 -1
- package/dist/components/SpinningWheel/SpinningWheel.js +307 -427
- package/dist/components/SpinningWheel/SpinningWheel.js.map +1 -1
- package/dist/components/Stickers.d.ts +2 -3
- package/dist/components/Stickers.d.ts.map +1 -1
- package/dist/components/Stickers.js +108 -164
- package/dist/components/Stickers.js.map +1 -1
- package/dist/components/Wallpapers.d.ts +3 -4
- package/dist/components/Wallpapers.d.ts.map +1 -1
- package/dist/components/Wallpapers.js +162 -225
- package/dist/components/Wallpapers.js.map +1 -1
- package/dist/components/WallpapersName.d.ts +4 -5
- package/dist/components/WallpapersName.d.ts.map +1 -1
- package/dist/components/WallpapersName.js +98 -180
- package/dist/components/WallpapersName.js.map +1 -1
- package/dist/components/esports/live/EsportsLive.d.ts +1 -2
- package/dist/components/esports/live/EsportsLive.d.ts.map +1 -1
- package/dist/components/esports/live/EsportsLive.js +16 -93
- package/dist/components/esports/live/EsportsLive.js.map +1 -1
- package/dist/components/esports/news/EsportsNews.d.ts +1 -2
- package/dist/components/esports/news/EsportsNews.d.ts.map +1 -1
- package/dist/components/esports/news/EsportsNews.js +9 -55
- package/dist/components/esports/news/EsportsNews.js.map +1 -1
- package/dist/components/esports/news/EsportsNewsDetail.d.ts +1 -2
- package/dist/components/esports/news/EsportsNewsDetail.d.ts.map +1 -1
- package/dist/components/esports/news/EsportsNewsDetail.js +5 -36
- package/dist/components/esports/news/EsportsNewsDetail.js.map +1 -1
- package/dist/components/esports/videos/EsportsVideos.d.ts +1 -2
- package/dist/components/esports/videos/EsportsVideos.d.ts.map +1 -1
- package/dist/components/esports/videos/EsportsVideos.js +9 -67
- package/dist/components/esports/videos/EsportsVideos.js.map +1 -1
- package/dist/components/ui/VideoPlayer.d.ts +1 -2
- package/dist/components/ui/VideoPlayer.d.ts.map +1 -1
- package/dist/components/ui/VideoPlayer.js +5 -61
- package/dist/components/ui/VideoPlayer.js.map +1 -1
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +70 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +16 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +87 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +21 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +43 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +75 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +6 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +23 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +14 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +48 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +32 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +7 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +58 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/cards.d.ts +12 -0
- package/dist/components/ui/cards.d.ts.map +1 -0
- package/dist/components/ui/cards.js +44 -0
- package/dist/components/ui/cards.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +28 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +136 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +44 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +64 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +115 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +14 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +79 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +125 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/dropdown.d.ts +19 -0
- package/dist/components/ui/dropdown.d.ts.map +1 -0
- package/dist/components/ui/dropdown.js +99 -0
- package/dist/components/ui/dropdown.js.map +1 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +62 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +51 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/index.d.ts +32 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +48 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +13 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +50 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +8 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +91 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +43 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +88 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +80 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +43 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +21 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +55 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +8 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +5 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +13 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +55 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -53
- package/dist/index.js.map +1 -1
- package/dist/libraries/networking.d.ts +4 -1
- package/dist/libraries/networking.d.ts.map +1 -1
- package/dist/libraries/networking.js +27 -8
- package/dist/libraries/networking.js.map +1 -1
- package/dist/libraries/session.d.ts +1 -10
- package/dist/libraries/session.d.ts.map +1 -1
- package/dist/libraries/session.js +1 -57
- package/dist/libraries/session.js.map +1 -1
- package/dist/libraries/utils.d.ts +2 -0
- package/dist/libraries/utils.d.ts.map +1 -1
- package/dist/libraries/utils.js +6 -0
- package/dist/libraries/utils.js.map +1 -1
- package/package.json +41 -6
package/dist/components/Quiz.js
CHANGED
|
@@ -1,41 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.Quiz = Quiz;
|
|
37
4
|
exports.QuizForYouCard = QuizForYouCard;
|
|
38
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
39
7
|
function parseMeta(raw) {
|
|
40
8
|
if (!raw)
|
|
41
9
|
return {};
|
|
@@ -186,7 +154,7 @@ function normalizeResponse(json) {
|
|
|
186
154
|
}
|
|
187
155
|
function QuizCard({ quiz, index, theme, texts, onClick }) {
|
|
188
156
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
189
|
-
return (
|
|
157
|
+
return ((0, jsx_runtime_1.jsxs)("div", { onClick: onClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), style: {
|
|
190
158
|
backgroundColor: theme.cardBackground,
|
|
191
159
|
border: `1.5px solid ${hovered ? theme.primaryColor : theme.cardBorderColor}`,
|
|
192
160
|
borderRadius: '16px',
|
|
@@ -197,62 +165,57 @@ function QuizCard({ quiz, index, theme, texts, onClick }) {
|
|
|
197
165
|
boxShadow: hovered ? '0 8px 24px rgba(0,0,0,0.12)' : '0 2px 8px rgba(0,0,0,0.06)',
|
|
198
166
|
display: 'flex',
|
|
199
167
|
flexDirection: 'column',
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
backgroundColor: theme.backgroundColor,
|
|
205
|
-
overflow: 'hidden',
|
|
206
|
-
position: 'relative',
|
|
207
|
-
display: 'flex',
|
|
208
|
-
alignItems: 'center',
|
|
209
|
-
justifyContent: 'center',
|
|
210
|
-
} }, quiz.thumbnail ? (react_1.default.createElement("img", { src: quiz.thumbnail, alt: quiz.title, style: { width: '100%', height: '100%', objectFit: 'cover' } })) : (react_1.default.createElement("div", { style: {
|
|
211
|
-
width: '56px',
|
|
212
|
-
height: '56px',
|
|
213
|
-
borderRadius: '50%',
|
|
214
|
-
backgroundColor: theme.primaryColor,
|
|
215
|
-
display: 'flex',
|
|
216
|
-
alignItems: 'center',
|
|
217
|
-
justifyContent: 'center',
|
|
218
|
-
color: theme.buttonTextColor,
|
|
219
|
-
fontSize: '24px',
|
|
220
|
-
fontWeight: 700,
|
|
221
|
-
} }, index + 1))),
|
|
222
|
-
react_1.default.createElement("div", { style: { padding: '16px', flex: 1, display: 'flex', flexDirection: 'column', gap: '8px' } },
|
|
223
|
-
react_1.default.createElement("p", { style: {
|
|
224
|
-
color: theme.textColor,
|
|
225
|
-
fontSize: '15px',
|
|
226
|
-
lineHeight: 1.4,
|
|
227
|
-
margin: 0,
|
|
228
|
-
fontWeight: 700,
|
|
229
|
-
display: '-webkit-box',
|
|
230
|
-
WebkitLineClamp: 2,
|
|
231
|
-
WebkitBoxOrient: 'vertical',
|
|
232
|
-
overflow: 'hidden',
|
|
233
|
-
} }, quiz.title),
|
|
234
|
-
quiz.description && (react_1.default.createElement("p", { style: {
|
|
235
|
-
color: theme.neutralMid,
|
|
236
|
-
fontSize: '13px',
|
|
237
|
-
lineHeight: 1.4,
|
|
238
|
-
margin: 0,
|
|
239
|
-
display: '-webkit-box',
|
|
240
|
-
WebkitLineClamp: 2,
|
|
241
|
-
WebkitBoxOrient: 'vertical',
|
|
168
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
169
|
+
width: '100%',
|
|
170
|
+
aspectRatio: '16/9',
|
|
171
|
+
backgroundColor: theme.backgroundColor,
|
|
242
172
|
overflow: 'hidden',
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
173
|
+
position: 'relative',
|
|
174
|
+
display: 'flex',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
justifyContent: 'center',
|
|
177
|
+
}, children: quiz.thumbnail ? ((0, jsx_runtime_1.jsx)("img", { src: quiz.thumbnail, alt: quiz.title, style: { width: '100%', height: '100%', objectFit: 'cover' } })) : ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
178
|
+
width: '56px',
|
|
179
|
+
height: '56px',
|
|
180
|
+
borderRadius: '50%',
|
|
181
|
+
backgroundColor: theme.primaryColor,
|
|
182
|
+
display: 'flex',
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
justifyContent: 'center',
|
|
185
|
+
color: theme.buttonTextColor,
|
|
186
|
+
fontSize: '24px',
|
|
187
|
+
fontWeight: 700,
|
|
188
|
+
}, children: index + 1 })) }), (0, jsx_runtime_1.jsxs)("div", { style: { padding: '16px', flex: 1, display: 'flex', flexDirection: 'column', gap: '8px' }, children: [(0, jsx_runtime_1.jsx)("p", { style: {
|
|
189
|
+
color: theme.textColor,
|
|
190
|
+
fontSize: '15px',
|
|
191
|
+
lineHeight: 1.4,
|
|
192
|
+
margin: 0,
|
|
193
|
+
fontWeight: 700,
|
|
194
|
+
display: '-webkit-box',
|
|
195
|
+
WebkitLineClamp: 2,
|
|
196
|
+
WebkitBoxOrient: 'vertical',
|
|
197
|
+
overflow: 'hidden',
|
|
198
|
+
}, children: quiz.title }), quiz.description && ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
199
|
+
color: theme.neutralMid,
|
|
200
|
+
fontSize: '13px',
|
|
201
|
+
lineHeight: 1.4,
|
|
202
|
+
margin: 0,
|
|
203
|
+
display: '-webkit-box',
|
|
204
|
+
WebkitLineClamp: 2,
|
|
205
|
+
WebkitBoxOrient: 'vertical',
|
|
206
|
+
overflow: 'hidden',
|
|
207
|
+
}, children: quiz.description })), (0, jsx_runtime_1.jsx)("button", { style: {
|
|
208
|
+
marginTop: 'auto',
|
|
209
|
+
padding: '8px 16px',
|
|
210
|
+
borderRadius: '20px',
|
|
211
|
+
border: 'none',
|
|
212
|
+
backgroundColor: theme.buttonColor,
|
|
213
|
+
color: theme.buttonTextColor,
|
|
214
|
+
fontSize: '13px',
|
|
215
|
+
fontWeight: 600,
|
|
216
|
+
cursor: 'pointer',
|
|
217
|
+
transition: 'opacity 0.2s',
|
|
218
|
+
}, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.85'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '1'; }, children: texts.startQuiz })] })] }));
|
|
256
219
|
}
|
|
257
220
|
function QuizModal({ questions, results, startIndex, theme, texts, onClose }) {
|
|
258
221
|
var _a;
|
|
@@ -343,9 +306,67 @@ function QuizModal({ questions, results, startIndex, theme, texts, onClose }) {
|
|
|
343
306
|
const matchedResult = results.find(r => score >= r.minPoints && score <= r.maxPoints);
|
|
344
307
|
resultMessage = matchedResult === null || matchedResult === void 0 ? void 0 : matchedResult.description;
|
|
345
308
|
}
|
|
346
|
-
return (
|
|
347
|
-
|
|
348
|
-
|
|
309
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: overlayStyle, onClick: handleOverlayClick, children: (0, jsx_runtime_1.jsxs)("div", { style: modalStyle, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onClose, "aria-label": texts.closeButton, style: {
|
|
310
|
+
position: 'absolute',
|
|
311
|
+
top: '16px',
|
|
312
|
+
right: '16px',
|
|
313
|
+
background: 'none',
|
|
314
|
+
border: 'none',
|
|
315
|
+
cursor: 'pointer',
|
|
316
|
+
color: theme.neutralMid,
|
|
317
|
+
fontSize: '20px',
|
|
318
|
+
lineHeight: 1,
|
|
319
|
+
}, children: "\u2715" }), (0, jsx_runtime_1.jsxs)("div", { style: { textAlign: 'center', paddingTop: '8px' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
320
|
+
width: '80px',
|
|
321
|
+
height: '80px',
|
|
322
|
+
borderRadius: '50%',
|
|
323
|
+
backgroundColor: theme.primaryColor,
|
|
324
|
+
margin: '0 auto 20px',
|
|
325
|
+
display: 'flex',
|
|
326
|
+
alignItems: 'center',
|
|
327
|
+
justifyContent: 'center',
|
|
328
|
+
fontSize: '32px',
|
|
329
|
+
color: theme.buttonTextColor,
|
|
330
|
+
}, children: "\uD83C\uDFC6" }), isQuizPointsBased ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { style: {
|
|
331
|
+
fontSize: '18px',
|
|
332
|
+
fontWeight: 600,
|
|
333
|
+
color: theme.textColor,
|
|
334
|
+
margin: '0 0 16px',
|
|
335
|
+
}, children: formatLabel(texts.scoreLabel, { score, total: score }) }), resultMessage && ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
336
|
+
fontSize: '15px',
|
|
337
|
+
lineHeight: 1.6,
|
|
338
|
+
color: theme.neutralMid,
|
|
339
|
+
margin: 0,
|
|
340
|
+
textAlign: 'left',
|
|
341
|
+
}, children: resultMessage }))] })) : ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
342
|
+
fontSize: '22px',
|
|
343
|
+
fontWeight: 700,
|
|
344
|
+
color: theme.textColor,
|
|
345
|
+
margin: '0 0 8px',
|
|
346
|
+
}, children: formatLabel(texts.scoreLabel, { score, total }) }))] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: '12px', marginTop: '8px' }, children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleRetry, style: {
|
|
347
|
+
flex: 1,
|
|
348
|
+
padding: '12px',
|
|
349
|
+
borderRadius: '12px',
|
|
350
|
+
border: `1.5px solid ${theme.primaryColor}`,
|
|
351
|
+
backgroundColor: 'transparent',
|
|
352
|
+
color: theme.primaryColor,
|
|
353
|
+
fontWeight: 600,
|
|
354
|
+
cursor: 'pointer',
|
|
355
|
+
fontSize: '14px',
|
|
356
|
+
}, children: texts.retryButton }), (0, jsx_runtime_1.jsx)("button", { onClick: onClose, style: {
|
|
357
|
+
flex: 1,
|
|
358
|
+
padding: '12px',
|
|
359
|
+
borderRadius: '12px',
|
|
360
|
+
border: 'none',
|
|
361
|
+
backgroundColor: theme.primaryColor,
|
|
362
|
+
color: theme.buttonTextColor,
|
|
363
|
+
fontWeight: 600,
|
|
364
|
+
cursor: 'pointer',
|
|
365
|
+
fontSize: '14px',
|
|
366
|
+
}, children: texts.closeButton })] })] }) }));
|
|
367
|
+
}
|
|
368
|
+
const isCorrect = !isPointsBased && selectedOption !== null && selectedOption === current.correctIndex;
|
|
369
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: overlayStyle, onClick: handleOverlayClick, children: (0, jsx_runtime_1.jsxs)("div", { style: modalStyle, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onClose, "aria-label": texts.closeButton, style: {
|
|
349
370
|
position: 'absolute',
|
|
350
371
|
top: '16px',
|
|
351
372
|
right: '16px',
|
|
@@ -355,185 +376,98 @@ function QuizModal({ questions, results, startIndex, theme, texts, onClose }) {
|
|
|
355
376
|
color: theme.neutralMid,
|
|
356
377
|
fontSize: '20px',
|
|
357
378
|
lineHeight: 1,
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
fontSize: '18px',
|
|
375
|
-
fontWeight: 600,
|
|
376
|
-
color: theme.textColor,
|
|
377
|
-
margin: '0 0 16px',
|
|
378
|
-
} }, formatLabel(texts.scoreLabel, { score, total: score })),
|
|
379
|
-
resultMessage && (react_1.default.createElement("p", { style: {
|
|
380
|
-
fontSize: '15px',
|
|
381
|
-
lineHeight: 1.6,
|
|
382
|
-
color: theme.neutralMid,
|
|
383
|
-
margin: 0,
|
|
384
|
-
textAlign: 'left',
|
|
385
|
-
} }, resultMessage)))) : (react_1.default.createElement("p", { style: {
|
|
386
|
-
fontSize: '22px',
|
|
387
|
-
fontWeight: 700,
|
|
388
|
-
color: theme.textColor,
|
|
389
|
-
margin: '0 0 8px',
|
|
390
|
-
} }, formatLabel(texts.scoreLabel, { score, total })))),
|
|
391
|
-
react_1.default.createElement("div", { style: { display: 'flex', gap: '12px', marginTop: '8px' } },
|
|
392
|
-
react_1.default.createElement("button", { onClick: handleRetry, style: {
|
|
393
|
-
flex: 1,
|
|
394
|
-
padding: '12px',
|
|
395
|
-
borderRadius: '12px',
|
|
396
|
-
border: `1.5px solid ${theme.primaryColor}`,
|
|
397
|
-
backgroundColor: 'transparent',
|
|
398
|
-
color: theme.primaryColor,
|
|
399
|
-
fontWeight: 600,
|
|
400
|
-
cursor: 'pointer',
|
|
401
|
-
fontSize: '14px',
|
|
402
|
-
} }, texts.retryButton),
|
|
403
|
-
react_1.default.createElement("button", { onClick: onClose, style: {
|
|
404
|
-
flex: 1,
|
|
405
|
-
padding: '12px',
|
|
406
|
-
borderRadius: '12px',
|
|
407
|
-
border: 'none',
|
|
408
|
-
backgroundColor: theme.primaryColor,
|
|
409
|
-
color: theme.buttonTextColor,
|
|
410
|
-
fontWeight: 600,
|
|
411
|
-
cursor: 'pointer',
|
|
412
|
-
fontSize: '14px',
|
|
413
|
-
} }, texts.closeButton)))));
|
|
414
|
-
}
|
|
415
|
-
const isCorrect = !isPointsBased && selectedOption !== null && selectedOption === current.correctIndex;
|
|
416
|
-
return (react_1.default.createElement("div", { style: overlayStyle, onClick: handleOverlayClick },
|
|
417
|
-
react_1.default.createElement("div", { style: modalStyle },
|
|
418
|
-
react_1.default.createElement("button", { onClick: onClose, "aria-label": texts.closeButton, style: {
|
|
419
|
-
position: 'absolute',
|
|
420
|
-
top: '16px',
|
|
421
|
-
right: '16px',
|
|
422
|
-
background: 'none',
|
|
423
|
-
border: 'none',
|
|
424
|
-
cursor: 'pointer',
|
|
425
|
-
color: theme.neutralMid,
|
|
426
|
-
fontSize: '20px',
|
|
427
|
-
lineHeight: 1,
|
|
428
|
-
} }, "\u2715"),
|
|
429
|
-
react_1.default.createElement("div", { style: { paddingTop: '4px' } },
|
|
430
|
-
react_1.default.createElement("div", { style: {
|
|
431
|
-
display: 'flex',
|
|
432
|
-
justifyContent: 'space-between',
|
|
433
|
-
alignItems: 'center',
|
|
434
|
-
marginBottom: '8px',
|
|
435
|
-
} },
|
|
436
|
-
react_1.default.createElement("span", { style: { fontSize: '12px', color: theme.neutralMid } }, formatLabel(texts.questionLabel, { current: currentIndex + 1, total }))),
|
|
437
|
-
react_1.default.createElement("div", { style: {
|
|
438
|
-
height: '4px',
|
|
439
|
-
borderRadius: '2px',
|
|
440
|
-
backgroundColor: theme.cardBorderColor,
|
|
441
|
-
overflow: 'hidden',
|
|
442
|
-
} },
|
|
443
|
-
react_1.default.createElement("div", { style: {
|
|
444
|
-
height: '100%',
|
|
445
|
-
width: `${((currentIndex + 1) / total) * 100}%`,
|
|
446
|
-
backgroundColor: theme.primaryColor,
|
|
447
|
-
transition: 'width 0.3s',
|
|
448
|
-
} }))),
|
|
449
|
-
current.thumbnail && (react_1.default.createElement("div", { style: {
|
|
450
|
-
borderRadius: '12px',
|
|
451
|
-
overflow: 'hidden',
|
|
452
|
-
aspectRatio: '16/9',
|
|
453
|
-
} },
|
|
454
|
-
react_1.default.createElement("img", { src: current.thumbnail, alt: current.question, style: { width: '100%', height: '100%', objectFit: 'cover' } }))),
|
|
455
|
-
react_1.default.createElement("p", { style: {
|
|
456
|
-
fontSize: '18px',
|
|
457
|
-
fontWeight: 700,
|
|
458
|
-
color: theme.textColor,
|
|
459
|
-
margin: 0,
|
|
460
|
-
lineHeight: 1.45,
|
|
461
|
-
} }, current.question),
|
|
462
|
-
react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' } }, current.options.map((option, idx) => {
|
|
463
|
-
let bg = theme.cardBackground;
|
|
464
|
-
let border = theme.cardBorderColor;
|
|
465
|
-
let color = theme.textColor;
|
|
466
|
-
const hasAnswer = selectedOption !== null;
|
|
467
|
-
if (hasAnswer && !isPointsBased) {
|
|
468
|
-
if (idx === current.correctIndex) {
|
|
469
|
-
bg = '#E8F5E9';
|
|
470
|
-
border = '#4CAF50';
|
|
471
|
-
color = '#1B5E20';
|
|
472
|
-
}
|
|
473
|
-
else if (idx === selectedOption) {
|
|
474
|
-
bg = '#FFEBEE';
|
|
475
|
-
border = '#F44336';
|
|
476
|
-
color = '#B71C1C';
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
else if (idx === selectedOption) {
|
|
480
|
-
bg = theme.primaryColor;
|
|
481
|
-
color = theme.buttonTextColor;
|
|
482
|
-
border = theme.primaryColor;
|
|
483
|
-
}
|
|
484
|
-
return (react_1.default.createElement("button", { key: idx, onClick: () => handleSelect(idx), style: {
|
|
485
|
-
padding: '12px 16px',
|
|
486
|
-
borderRadius: '12px',
|
|
487
|
-
border: `1.5px solid ${border}`,
|
|
488
|
-
backgroundColor: bg,
|
|
489
|
-
color,
|
|
490
|
-
fontSize: '14px',
|
|
491
|
-
fontWeight: 500,
|
|
492
|
-
textAlign: 'left',
|
|
493
|
-
cursor: 'pointer',
|
|
494
|
-
transition: 'all 0.2s',
|
|
495
|
-
lineHeight: 1.5,
|
|
496
|
-
} }, option.text));
|
|
497
|
-
})),
|
|
498
|
-
selectedOption !== null && !isPointsBased && (react_1.default.createElement("p", { style: {
|
|
499
|
-
fontSize: '14px',
|
|
500
|
-
fontWeight: 600,
|
|
501
|
-
color: isCorrect ? '#2E7D32' : '#C62828',
|
|
502
|
-
margin: 0,
|
|
503
|
-
} },
|
|
504
|
-
isCorrect ? texts.correctAnswer : texts.wrongAnswer,
|
|
505
|
-
current.explanation && (react_1.default.createElement("span", { style: { fontWeight: 400, display: 'block', marginTop: 4 } }, current.explanation)))),
|
|
506
|
-
react_1.default.createElement("div", { style: { display: 'flex', gap: '12px' } },
|
|
507
|
-
currentIndex > 0 && (react_1.default.createElement("button", { onClick: handlePrevious, style: {
|
|
508
|
-
flex: 1,
|
|
509
|
-
padding: '14px',
|
|
379
|
+
}, children: "\u2715" }), (0, jsx_runtime_1.jsxs)("div", { style: { paddingTop: '4px' }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
380
|
+
display: 'flex',
|
|
381
|
+
justifyContent: 'space-between',
|
|
382
|
+
alignItems: 'center',
|
|
383
|
+
marginBottom: '8px',
|
|
384
|
+
}, children: (0, jsx_runtime_1.jsx)("span", { style: { fontSize: '12px', color: theme.neutralMid }, children: formatLabel(texts.questionLabel, { current: currentIndex + 1, total }) }) }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
385
|
+
height: '4px',
|
|
386
|
+
borderRadius: '2px',
|
|
387
|
+
backgroundColor: theme.cardBorderColor,
|
|
388
|
+
overflow: 'hidden',
|
|
389
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
390
|
+
height: '100%',
|
|
391
|
+
width: `${((currentIndex + 1) / total) * 100}%`,
|
|
392
|
+
backgroundColor: theme.primaryColor,
|
|
393
|
+
transition: 'width 0.3s',
|
|
394
|
+
} }) })] }), current.thumbnail && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
510
395
|
borderRadius: '12px',
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
fontSize: '15px',
|
|
516
|
-
cursor: 'pointer',
|
|
517
|
-
transition: 'opacity 0.2s',
|
|
518
|
-
}, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.85'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '1'; } },
|
|
519
|
-
"\u2190 ",
|
|
520
|
-
texts.previousButton)),
|
|
521
|
-
react_1.default.createElement("button", { onClick: handleNext, disabled: selectedOption === null, style: {
|
|
522
|
-
flex: currentIndex > 0 ? 1 : 'auto',
|
|
523
|
-
width: currentIndex === 0 ? '100%' : 'auto',
|
|
524
|
-
padding: '14px',
|
|
525
|
-
borderRadius: '12px',
|
|
526
|
-
border: 'none',
|
|
527
|
-
backgroundColor: selectedOption === null ? theme.neutralMid : theme.primaryColor,
|
|
528
|
-
color: theme.buttonTextColor,
|
|
396
|
+
overflow: 'hidden',
|
|
397
|
+
aspectRatio: '16/9',
|
|
398
|
+
}, children: (0, jsx_runtime_1.jsx)("img", { src: current.thumbnail, alt: current.question, style: { width: '100%', height: '100%', objectFit: 'cover' } }) })), (0, jsx_runtime_1.jsx)("p", { style: {
|
|
399
|
+
fontSize: '18px',
|
|
529
400
|
fontWeight: 700,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
401
|
+
color: theme.textColor,
|
|
402
|
+
margin: 0,
|
|
403
|
+
lineHeight: 1.45,
|
|
404
|
+
}, children: current.question }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: current.options.map((option, idx) => {
|
|
405
|
+
let bg = theme.cardBackground;
|
|
406
|
+
let border = theme.cardBorderColor;
|
|
407
|
+
let color = theme.textColor;
|
|
408
|
+
const hasAnswer = selectedOption !== null;
|
|
409
|
+
if (hasAnswer && !isPointsBased) {
|
|
410
|
+
if (idx === current.correctIndex) {
|
|
411
|
+
bg = '#E8F5E9';
|
|
412
|
+
border = '#4CAF50';
|
|
413
|
+
color = '#1B5E20';
|
|
414
|
+
}
|
|
415
|
+
else if (idx === selectedOption) {
|
|
416
|
+
bg = '#FFEBEE';
|
|
417
|
+
border = '#F44336';
|
|
418
|
+
color = '#B71C1C';
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
else if (idx === selectedOption) {
|
|
422
|
+
bg = theme.primaryColor;
|
|
423
|
+
color = theme.buttonTextColor;
|
|
424
|
+
border = theme.primaryColor;
|
|
425
|
+
}
|
|
426
|
+
return ((0, jsx_runtime_1.jsx)("button", { onClick: () => handleSelect(idx), style: {
|
|
427
|
+
padding: '12px 16px',
|
|
428
|
+
borderRadius: '12px',
|
|
429
|
+
border: `1.5px solid ${border}`,
|
|
430
|
+
backgroundColor: bg,
|
|
431
|
+
color,
|
|
432
|
+
fontSize: '14px',
|
|
433
|
+
fontWeight: 500,
|
|
434
|
+
textAlign: 'left',
|
|
435
|
+
cursor: 'pointer',
|
|
436
|
+
transition: 'all 0.2s',
|
|
437
|
+
lineHeight: 1.5,
|
|
438
|
+
}, children: option.text }, idx));
|
|
439
|
+
}) }), selectedOption !== null && !isPointsBased && ((0, jsx_runtime_1.jsxs)("p", { style: {
|
|
440
|
+
fontSize: '14px',
|
|
441
|
+
fontWeight: 600,
|
|
442
|
+
color: isCorrect ? '#2E7D32' : '#C62828',
|
|
443
|
+
margin: 0,
|
|
444
|
+
}, children: [isCorrect ? texts.correctAnswer : texts.wrongAnswer, current.explanation && ((0, jsx_runtime_1.jsx)("span", { style: { fontWeight: 400, display: 'block', marginTop: 4 }, children: current.explanation }))] })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: '12px' }, children: [currentIndex > 0 && ((0, jsx_runtime_1.jsxs)("button", { onClick: handlePrevious, style: {
|
|
445
|
+
flex: 1,
|
|
446
|
+
padding: '14px',
|
|
447
|
+
borderRadius: '12px',
|
|
448
|
+
border: `1.5px solid ${theme.primaryColor}`,
|
|
449
|
+
backgroundColor: 'transparent',
|
|
450
|
+
color: theme.primaryColor,
|
|
451
|
+
fontWeight: 700,
|
|
452
|
+
fontSize: '15px',
|
|
453
|
+
cursor: 'pointer',
|
|
454
|
+
transition: 'opacity 0.2s',
|
|
455
|
+
}, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.85'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '1'; }, children: ["\u2190 ", texts.previousButton] })), (0, jsx_runtime_1.jsx)("button", { onClick: handleNext, disabled: selectedOption === null, style: {
|
|
456
|
+
flex: currentIndex > 0 ? 1 : 'auto',
|
|
457
|
+
width: currentIndex === 0 ? '100%' : 'auto',
|
|
458
|
+
padding: '14px',
|
|
459
|
+
borderRadius: '12px',
|
|
460
|
+
border: 'none',
|
|
461
|
+
backgroundColor: selectedOption === null ? theme.neutralMid : theme.primaryColor,
|
|
462
|
+
color: theme.buttonTextColor,
|
|
463
|
+
fontWeight: 700,
|
|
464
|
+
fontSize: '15px',
|
|
465
|
+
cursor: selectedOption === null ? 'not-allowed' : 'pointer',
|
|
466
|
+
transition: 'opacity 0.2s',
|
|
467
|
+
opacity: selectedOption === null ? 0.5 : 1,
|
|
468
|
+
}, onMouseEnter: (e) => { if (selectedOption !== null)
|
|
469
|
+
e.currentTarget.style.opacity = '0.85'; }, onMouseLeave: (e) => { if (selectedOption !== null)
|
|
470
|
+
e.currentTarget.style.opacity = '1'; }, children: currentIndex + 1 >= total ? texts.submitButton : texts.nextButton })] })] }) }));
|
|
537
471
|
}
|
|
538
472
|
const DEFAULT_THEME = {
|
|
539
473
|
primaryColor: '#FF2273',
|
|
@@ -659,87 +593,68 @@ function Quiz({ config, theme: themeP, texts: textsP, onQuizStart, onQuizComplet
|
|
|
659
593
|
}, []);
|
|
660
594
|
const visible = quizItems.slice(0, visibleCount);
|
|
661
595
|
const hasMore = visibleCount < quizItems.length;
|
|
662
|
-
return (
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
alignItems: 'center',
|
|
708
|
-
justifyContent: 'center',
|
|
709
|
-
} },
|
|
710
|
-
react_1.default.createElement("div", { style: {
|
|
711
|
-
backgroundColor: theme.cardBackground,
|
|
712
|
-
borderRadius: '20px',
|
|
713
|
-
padding: '40px',
|
|
714
|
-
textAlign: 'center',
|
|
715
|
-
color: theme.textColor,
|
|
716
|
-
} }, texts.loadingQuestions))),
|
|
717
|
-
activeQuiz && !loadingQuestions && activeQuestions.length > 0 && (react_1.default.createElement(QuizModal, { questions: activeQuestions, results: activeResults, startIndex: 0, theme: theme, texts: texts, onClose: handleCloseModal }))));
|
|
596
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { backgroundColor: theme.backgroundColor, minHeight: '100vh' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { padding: '40px 16px', maxWidth: '1200px', margin: '0 auto' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { textAlign: 'center', marginBottom: '32px' }, children: [(0, jsx_runtime_1.jsx)("h2", { style: {
|
|
597
|
+
fontSize: '28px',
|
|
598
|
+
fontWeight: 700,
|
|
599
|
+
color: theme.titleDarkColor,
|
|
600
|
+
margin: '0 0 8px',
|
|
601
|
+
}, children: texts.title }), texts.subtitle && ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
602
|
+
fontSize: '16px',
|
|
603
|
+
color: theme.neutralMid,
|
|
604
|
+
margin: 0,
|
|
605
|
+
}, children: texts.subtitle }))] }), loading ? ((0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', padding: '40px', color: theme.neutralMid }, children: texts.loading })) : quizItems.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', padding: '40px', color: theme.neutralMid }, children: texts.noItems })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
606
|
+
display: 'grid',
|
|
607
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))',
|
|
608
|
+
gap: '20px',
|
|
609
|
+
marginBottom: '32px',
|
|
610
|
+
}, children: visible.map((quiz, idx) => ((0, jsx_runtime_1.jsx)(QuizCard, { quiz: quiz, index: idx, theme: theme, texts: texts, onClick: () => handleCardClick(quiz) }, quiz.id))) }), hasMore && ((0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center' }, children: (0, jsx_runtime_1.jsx)("button", { onClick: () => setVisibleCount(v => v + loadMoreCount), style: {
|
|
611
|
+
padding: '12px 32px',
|
|
612
|
+
borderRadius: '24px',
|
|
613
|
+
border: `1.5px solid ${theme.primaryColor}`,
|
|
614
|
+
backgroundColor: 'transparent',
|
|
615
|
+
color: theme.primaryColor,
|
|
616
|
+
fontWeight: 600,
|
|
617
|
+
fontSize: '15px',
|
|
618
|
+
cursor: 'pointer',
|
|
619
|
+
transition: 'all 0.2s',
|
|
620
|
+
}, onMouseEnter: (e) => {
|
|
621
|
+
e.currentTarget.style.backgroundColor = theme.primaryColor;
|
|
622
|
+
e.currentTarget.style.color = theme.buttonTextColor;
|
|
623
|
+
}, onMouseLeave: (e) => {
|
|
624
|
+
e.currentTarget.style.backgroundColor = 'transparent';
|
|
625
|
+
e.currentTarget.style.color = theme.primaryColor;
|
|
626
|
+
}, children: texts.loadMore }) }))] }))] }), activeQuiz && loadingQuestions && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
627
|
+
position: 'fixed',
|
|
628
|
+
inset: 0,
|
|
629
|
+
zIndex: 9999,
|
|
630
|
+
backgroundColor: 'rgba(0,0,0,0.6)',
|
|
631
|
+
display: 'flex',
|
|
632
|
+
alignItems: 'center',
|
|
633
|
+
justifyContent: 'center',
|
|
634
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
635
|
+
backgroundColor: theme.cardBackground,
|
|
636
|
+
borderRadius: '20px',
|
|
637
|
+
padding: '40px',
|
|
638
|
+
textAlign: 'center',
|
|
639
|
+
color: theme.textColor,
|
|
640
|
+
}, children: texts.loadingQuestions }) })), activeQuiz && !loadingQuestions && activeQuestions.length > 0 && ((0, jsx_runtime_1.jsx)(QuizModal, { questions: activeQuestions, results: activeResults, startIndex: 0, theme: theme, texts: texts, onClose: handleCloseModal }))] }));
|
|
718
641
|
}
|
|
719
642
|
function QuizForYouCard({ title, description, ctaText, ctaHref, desktopImage, mobileImage, imageAlt = '', imageOnRight = false, titleColor = '#210F5C', descriptionColor = '#0F1F35', ctaColor = '#FF2273', ctaHoverColor = '#E81F69', backgroundColor = '#FFFFFF', paddingClass = '', }) {
|
|
720
|
-
return (
|
|
721
|
-
react_1.default.createElement("div", { style: {
|
|
643
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { backgroundColor, width: '100%' }, className: paddingClass, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
722
644
|
display: 'flex',
|
|
723
645
|
flexDirection: imageOnRight ? 'row-reverse' : 'row',
|
|
724
646
|
minHeight: '420px',
|
|
725
647
|
alignItems: 'stretch',
|
|
726
|
-
} },
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
color: '#fff',
|
|
737
|
-
textDecoration: 'none',
|
|
738
|
-
fontWeight: 600,
|
|
739
|
-
transition: 'background-color 0.2s',
|
|
740
|
-
}, onMouseEnter: (e) => { e.currentTarget.style.backgroundColor = ctaHoverColor; }, onMouseLeave: (e) => { e.currentTarget.style.backgroundColor = ctaColor; } }, ctaText))),
|
|
741
|
-
react_1.default.createElement("div", { style: { flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px' } },
|
|
742
|
-
react_1.default.createElement("img", { src: desktopImage, alt: imageAlt, style: { maxWidth: '100%', height: 'auto' } })))));
|
|
648
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '40px' }, children: (0, jsx_runtime_1.jsxs)("div", { style: { maxWidth: '400px', textAlign: 'center' }, children: [(0, jsx_runtime_1.jsx)("h2", { style: { color: titleColor, fontSize: '32px', fontWeight: 700, marginBottom: '16px' }, children: title }), (0, jsx_runtime_1.jsx)("p", { style: { color: descriptionColor, fontSize: '16px', marginBottom: '24px' }, children: description }), (0, jsx_runtime_1.jsx)("a", { href: ctaHref, style: {
|
|
649
|
+
display: 'inline-block',
|
|
650
|
+
padding: '12px 32px',
|
|
651
|
+
borderRadius: '24px',
|
|
652
|
+
backgroundColor: ctaColor,
|
|
653
|
+
color: '#fff',
|
|
654
|
+
textDecoration: 'none',
|
|
655
|
+
fontWeight: 600,
|
|
656
|
+
transition: 'background-color 0.2s',
|
|
657
|
+
}, onMouseEnter: (e) => { e.currentTarget.style.backgroundColor = ctaHoverColor; }, onMouseLeave: (e) => { e.currentTarget.style.backgroundColor = ctaColor; }, children: ctaText })] }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px' }, children: (0, jsx_runtime_1.jsx)("img", { src: desktopImage, alt: imageAlt, style: { maxWidth: '100%', height: 'auto' } }) })] }) }));
|
|
743
658
|
}
|
|
744
659
|
exports.default = Quiz;
|
|
745
660
|
//# sourceMappingURL=Quiz.js.map
|