@anywayseo/tools 1.5.3 → 2.0.0

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 (60) hide show
  1. package/dist/components/base/center/index.d.ts +1 -3
  2. package/dist/components/{expert → base/expert}/bio/index.d.ts +1 -1
  3. package/dist/components/{expert → base/expert}/index.d.ts +1 -1
  4. package/dist/components/base/grid/index.d.ts +3 -11
  5. package/dist/components/base/index.d.ts +2 -0
  6. package/dist/components/base/link-button/index.d.ts +2 -2
  7. package/dist/components/base/pulse-button/index.d.ts +8 -0
  8. package/dist/components/bonus-card/index.d.ts +1 -3
  9. package/dist/components/contact-form/index.d.ts +3 -1
  10. package/dist/components/expert-tip/index.d.ts +2 -3
  11. package/dist/components/faq/index.d.ts +2 -4
  12. package/dist/components/feature-card/index.d.ts +5 -0
  13. package/dist/components/features/index.d.ts +2 -3
  14. package/dist/components/game-card/index.d.ts +1 -3
  15. package/dist/components/game-demo/index.d.ts +3 -4
  16. package/dist/components/game-demo/preview/index.d.ts +3 -3
  17. package/dist/components/how-to/index.d.ts +2 -3
  18. package/dist/components/index.cjs +4 -1
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.mjs +12 -9
  21. package/dist/components/layout/footer/navigation/index.d.ts +5 -1
  22. package/dist/components/layout/header/{navbar/navigation → navigation}/desktop/item/index.d.ts +1 -1
  23. package/dist/components/layout/header/{navbar/navigation → navigation}/mobile/item/index.d.ts +1 -1
  24. package/dist/components/layout/header/{navbar/navigation → navigation}/types.d.ts +1 -1
  25. package/dist/components/list/index.d.ts +1 -2
  26. package/dist/components/pros-cons/index.d.ts +2 -3
  27. package/dist/components/table/index.d.ts +0 -1
  28. package/dist/components/tabs/index.d.ts +1 -2
  29. package/dist/index-BNb-P8a6.mjs +17 -0
  30. package/dist/index-BhsXlbd8.js +16 -0
  31. package/dist/{index-jvxaXXE3.js → index-BrTxsE2A.js} +18 -0
  32. package/dist/{index-DZkjaSoV.mjs → index-CHSIkTv7.mjs} +138 -141
  33. package/dist/index-CnohyDGd.js +965 -0
  34. package/dist/{index-CJvs4SfG.mjs → index-j8Vo42fz.mjs} +18 -0
  35. package/dist/index.cjs +9 -5
  36. package/dist/index.mjs +17 -13
  37. package/dist/providers/index.cjs +3 -3
  38. package/dist/providers/index.d.ts +1 -1
  39. package/dist/providers/index.mjs +3 -3
  40. package/dist/providers/site-provider/index.d.ts +11 -0
  41. package/dist/types/components/image/index.d.ts +2 -0
  42. package/dist/types/components/index.d.ts +1 -0
  43. package/dist/types/index.d.ts +1 -1
  44. package/dist/types/site/index.d.ts +32 -0
  45. package/dist/utils/animation/index.d.ts +8 -0
  46. package/dist/utils/index.cjs +2 -1
  47. package/dist/utils/index.d.ts +1 -0
  48. package/dist/utils/index.mjs +2 -1
  49. package/package.json +104 -105
  50. package/dist/components/layout/header/navbar/index.d.ts +0 -6
  51. package/dist/index-Bs4zA1wD.mjs +0 -17
  52. package/dist/index-C5pGuMKq.js +0 -968
  53. package/dist/index-D96zh94V.js +0 -16
  54. package/dist/providers/site-metadata-provider/index.d.ts +0 -14
  55. package/dist/types/site-metadata/index.d.ts +0 -10
  56. /package/dist/components/layout/header/{navbar/brand → brand}/index.d.ts +0 -0
  57. /package/dist/components/layout/header/{navbar/navigation → navigation}/desktop/index.d.ts +0 -0
  58. /package/dist/components/layout/header/{navbar/navigation → navigation}/index.d.ts +0 -0
  59. /package/dist/components/layout/header/{navbar/navigation → navigation}/mobile/index.d.ts +0 -0
  60. /package/dist/components/layout/header/{navbar/theme-toggler → theme-toggler}/index.d.ts +0 -0
@@ -1,968 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const react$1 = require("@chakra-ui/react");
4
- const reactI18next = require("react-i18next");
5
- const icons = require("@chakra-ui/icons");
6
- const gatsbyPluginImage = require("gatsby-plugin-image");
7
- require("@mdx-js/react");
8
- const index = require("./index-D96zh94V.js");
9
- const react = require("react");
10
- const index$1 = require("./index-IpSV-c71.js");
11
- const react$2 = require("@emotion/react");
12
- const i18n = require("./index-DCIXk-YH.js");
13
- const i18n$1 = require("i18next");
14
- const index$2 = require("./index-jvxaXXE3.js");
15
- require("@ctrl/tinycolor");
16
- const gatsby = require("gatsby");
17
- const ONE_LINE_HEIGHT = 24;
18
- const Bio = ({ content, maxLines = 1 }) => {
19
- const ref = react.useRef(null);
20
- const [showToggle, setShowToggle] = react.useState(false);
21
- const [isExpanded, setIsExpanded] = react.useState(false);
22
- const { t } = reactI18next.useTranslation("author");
23
- react.useLayoutEffect(() => {
24
- if (ref.current) {
25
- const { scrollWidth, clientWidth, scrollHeight, clientHeight } = ref.current;
26
- const isClamped = scrollWidth > clientWidth || scrollHeight > clientHeight;
27
- setShowToggle(isClamped);
28
- }
29
- return () => {
30
- setShowToggle(false);
31
- };
32
- }, []);
33
- function handleClick() {
34
- setIsExpanded((prev) => !prev);
35
- }
36
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { children: [
37
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isExpanded, startingHeight: ONE_LINE_HEIGHT * maxLines, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { ref, fontSize: "md", noOfLines: isExpanded ? void 0 : maxLines, children: content }) }),
38
- showToggle && /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { size: "sm", variant: "link", colorScheme: "blue", onClick: handleClick, children: isExpanded ? t("action.collapse") : t("action.expand") })
39
- ] });
40
- };
41
- const Expert = ({ expert, variant }) => {
42
- const { firstName, lastName, jobTitle, bio } = expert;
43
- const { expertImageData } = index.useSiteMetadataContext();
44
- const image = gatsbyPluginImage.getImage(expertImageData);
45
- const fullName = `${firstName} ${lastName}`;
46
- if (variant === "short") {
47
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "article", align: "center", gap: 4, children: [
48
- !!image && /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { w: 12, h: 12, children: /* @__PURE__ */ jsxRuntime.jsx(gatsbyPluginImage.GatsbyImage, { image, alt: fullName, style: { borderRadius: "50%" } }) }),
49
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { fontWeight: "semibold", children: [
50
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: fullName }),
51
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { color: "gray.500", children: expert.jobTitle })
52
- ] })
53
- ] });
54
- }
55
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
56
- !!image && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { grow: 1, maxW: { base: 48, sm: 32 }, children: /* @__PURE__ */ jsxRuntime.jsx(gatsbyPluginImage.GatsbyImage, { image, alt: fullName, style: { borderRadius: "50%" } }) }),
57
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { w: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { children: [
58
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { fontSize: "lg", fontWeight: 600, children: [
59
- `${fullName}, `,
60
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", color: "gray.500", children: jobTitle })
61
- ] }),
62
- /* @__PURE__ */ jsxRuntime.jsx(Bio, { content: bio })
63
- ] }) })
64
- ] });
65
- };
66
- const Author = ({ author, ...cardProps }) => {
67
- const { t } = reactI18next.useTranslation("author");
68
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Card, { as: "article", variant: "filled", ...cardProps, children: [
69
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CardHeader, { pb: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Heading, { size: "md", children: t("title") }) }),
70
- /* @__PURE__ */ jsxRuntime.jsx(
71
- react$1.CardBody,
72
- {
73
- display: "flex",
74
- flexDirection: { base: "column", sm: "row" },
75
- alignItems: { base: "center", sm: "flex-start" },
76
- gap: 4,
77
- children: /* @__PURE__ */ jsxRuntime.jsx(Expert, { expert: author, variant: "full" })
78
- }
79
- )
80
- ] });
81
- };
82
- const Center = ({ children, className, ...boxProps }) => {
83
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Center, { className, ...boxProps, children });
84
- };
85
- const defaultColumns = { base: 1, sm: 2, md: 3, lg: 4, xl: 5 };
86
- const Grid = ({ items, columns = defaultColumns, gap, render, getKey, className, ...boxProps }) => {
87
- return /* @__PURE__ */ jsxRuntime.jsx(
88
- react$1.SimpleGrid,
89
- {
90
- as: "ul",
91
- columns,
92
- spacing: gap,
93
- p: 0,
94
- m: 0,
95
- listStyleType: "none",
96
- className,
97
- ...boxProps,
98
- children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index2))
99
- }
100
- );
101
- };
102
- const LinkButton = ({ label, url, width = "auto" }) => {
103
- return /* @__PURE__ */ jsxRuntime.jsx(
104
- react$1.Button,
105
- {
106
- as: react$1.Link,
107
- href: url,
108
- w: width,
109
- bg: "brand.600",
110
- textTransform: "uppercase",
111
- _hover: { textDecoration: "none", bg: "brand.300" },
112
- _active: { transform: "scale(0.95)" },
113
- children: label
114
- }
115
- );
116
- };
117
- const BonusCardContent = ({ content }) => {
118
- const { t } = reactI18next.useTranslation("author");
119
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Popover, { flip: false, matchWidth: false, placement: "bottom", children: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
120
- /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { size: "sm", variant: "link", color: "white", children: isOpen ? t("action.collapse") : t("action.expand") }) }),
121
- /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverContent, { w: 60, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverBody, { children: Array.isArray(content) ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { children: content.map((paragraph, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", children: paragraph }, index2)) }) : /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: content }) }) })
122
- ] }) });
123
- };
124
- const BonusCardTitle = ({ content }) => {
125
- return /* @__PURE__ */ jsxRuntime.jsx(
126
- react$1.Text,
127
- {
128
- as: "h3",
129
- display: "inline-block",
130
- py: 1,
131
- px: 2,
132
- borderRadius: "md",
133
- bg: "yellow",
134
- color: "black",
135
- fontWeight: "bold",
136
- fontSize: "lg",
137
- children: content
138
- }
139
- );
140
- };
141
- const BonusCard = ({ title, subtitle, content, link, image, className }) => {
142
- return /* @__PURE__ */ jsxRuntime.jsxs(
143
- react$1.Card,
144
- {
145
- as: "article",
146
- h: "full",
147
- bg: "linear-gradient(90deg, #3b1f47, #731d58)",
148
- overflow: "hidden",
149
- _before: image ? {
150
- content: '""',
151
- position: "absolute",
152
- top: 0,
153
- left: 0,
154
- w: "100%",
155
- h: "100%",
156
- bgImage: `url(${image})`,
157
- bgSize: "cover",
158
- bgPosition: "center",
159
- filter: "blur(0.05em) opacity(50%)",
160
- zIndex: 0
161
- } : void 0,
162
- className,
163
- children: [
164
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.CardBody, { as: "section", pb: 0, flex: 1, children: [
165
- /* @__PURE__ */ jsxRuntime.jsx(BonusCardTitle, { content: title }),
166
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: "2xl", fontWeight: "bold", my: 2, children: subtitle }),
167
- /* @__PURE__ */ jsxRuntime.jsx(BonusCardContent, { content })
168
- ] }),
169
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CardFooter, { as: "footer", p: 4, children: /* @__PURE__ */ jsxRuntime.jsx(LinkButton, { ...link, width: "full" }) })
170
- ]
171
- }
172
- );
173
- };
174
- const ContactForm = () => {
175
- const toast = react$1.useToast();
176
- const { t } = reactI18next.useTranslation("contactForm");
177
- function handleSubmit(event) {
178
- event.preventDefault();
179
- const form = event.currentTarget;
180
- const formData = new FormData(form);
181
- const name = formData.get("name");
182
- const email = formData.get("email");
183
- const message = formData.get("message");
184
- if (name && email && message) {
185
- form.reset();
186
- toast({
187
- title: t("notification.title", { name }),
188
- description: t("notification.description", { email }),
189
- colorScheme: "brand",
190
- status: "success",
191
- duration: 5e3,
192
- isClosable: true
193
- });
194
- } else {
195
- console.error("Please fill out both fields");
196
- }
197
- }
198
- return /* @__PURE__ */ jsxRuntime.jsx(
199
- react$1.Box,
200
- {
201
- as: "form",
202
- borderRadius: "lg",
203
- p: 8,
204
- color: react$1.useColorModeValue("gray.700", "whiteAlpha.900"),
205
- bg: react$1.useColorModeValue("white", "gray.700"),
206
- shadow: "base",
207
- onSubmit: handleSubmit,
208
- children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.VStack, { spacing: 4, children: [
209
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.FormControl, { isRequired: true, children: [
210
- /* @__PURE__ */ jsxRuntime.jsx(react$1.FormLabel, { children: t("field.name.label") }),
211
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.InputGroup, { children: [
212
- /* @__PURE__ */ jsxRuntime.jsx(react$1.InputLeftElement, { children: /* @__PURE__ */ jsxRuntime.jsx(
213
- "svg",
214
- {
215
- xmlns: "http://www.w3.org/2000/svg",
216
- width: "16",
217
- height: "16",
218
- fill: "currentColor",
219
- className: "bi bi-person-fill",
220
- viewBox: "0 0 16 16",
221
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6" })
222
- }
223
- ) }),
224
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Input, { type: "text", name: "name", placeholder: t("field.name.placeholder") })
225
- ] })
226
- ] }),
227
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.FormControl, { isRequired: true, children: [
228
- /* @__PURE__ */ jsxRuntime.jsx(react$1.FormLabel, { children: t("field.email.label") }),
229
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.InputGroup, { children: [
230
- /* @__PURE__ */ jsxRuntime.jsx(react$1.InputLeftElement, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.EmailIcon, {}) }),
231
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Input, { type: "email", name: "email", placeholder: t("field.email.placeholder") })
232
- ] })
233
- ] }),
234
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.FormControl, { isRequired: true, children: [
235
- /* @__PURE__ */ jsxRuntime.jsx(react$1.FormLabel, { children: t("field.message.label") }),
236
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Textarea, { name: "message", placeholder: t("field.message.placeholder"), rows: 6, resize: "none" })
237
- ] }),
238
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { type: "submit", colorScheme: "brand", width: "full", children: t("action.send") })
239
- ] })
240
- }
241
- );
242
- };
243
- const ExpertTip = ({ tip, expert, ...boxProps }) => {
244
- return /* @__PURE__ */ jsxRuntime.jsxs(
245
- react$1.Card,
246
- {
247
- variant: "filled",
248
- p: 4,
249
- borderLeft: "4px solid gray",
250
- gap: 4,
251
- _before: {
252
- content: '"❛❛"',
253
- position: "absolute",
254
- top: -8,
255
- left: -2,
256
- fontSize: "6rem",
257
- fontStyle: "italic",
258
- color: react$1.useColorModeValue("blackAlpha.300", "whiteAlpha.300")
259
- },
260
- ...boxProps,
261
- children: [
262
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CardBody, { as: "blockquote", p: 0, fontStyle: "italic", children: tip }),
263
- !!expert && /* @__PURE__ */ jsxRuntime.jsx(react$1.CardFooter, { alignItems: "center", justify: "flex-end", p: 0, children: /* @__PURE__ */ jsxRuntime.jsx(Expert, { expert, variant: "short" }) })
264
- ]
265
- }
266
- );
267
- };
268
- const Faq = ({ items, mb }) => {
269
- const { bgColor, color } = index$1.usePrimaryColors();
270
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Accordion, { allowToggle: true, mb, children: items.map(({ question, answer }) => {
271
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.AccordionItem, { border: 0, children: [
272
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "h3", children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.AccordionButton, { _hover: { color, bgColor }, children: [
273
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "span", flex: "1", textAlign: "left", fontWeight: "bold", children: question }),
274
- /* @__PURE__ */ jsxRuntime.jsx(react$1.AccordionIcon, {})
275
- ] }) }),
276
- /* @__PURE__ */ jsxRuntime.jsx(react$1.AccordionPanel, { children: answer })
277
- ] }, question);
278
- }) });
279
- };
280
- const Features = ({ features, ...boxProps }) => {
281
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.SimpleGrid, { as: "ul", columns: { base: 1, md: 2, lg: 3 }, spacing: 10, p: 0, ...boxProps, children: features.map(({ title, description }) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Card, { as: "article", variant: "outline", textAlign: "center", h: "100%", children: [
282
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.CardHeader, { as: "header", display: "flex", alignItems: "center", justifyContent: "center", gap: 2, pb: 2, children: [
283
- /* @__PURE__ */ jsxRuntime.jsx(icons.StarIcon, { w: 8, h: 8, color: "yellow.400" }),
284
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontWeight: 600, children: title }),
285
- /* @__PURE__ */ jsxRuntime.jsx(icons.StarIcon, { w: 8, h: 8, color: "yellow.400" })
286
- ] }),
287
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CardBody, { as: "section", pt: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { color: "gray.600", children: description }) })
288
- ] }) }, title)) });
289
- };
290
- const GameCard = ({ name, image, link, className }) => {
291
- return /* @__PURE__ */ jsxRuntime.jsxs(
292
- react$1.LinkBox,
293
- {
294
- as: "article",
295
- rounded: "md",
296
- borderWidth: 1,
297
- transition: "transform 0.2s ease",
298
- cursor: link ? "pointer" : "default",
299
- overflow: "hidden",
300
- bg: "blackAlpha.400",
301
- _hover: { transform: "scale(1.1)" },
302
- className,
303
- children: [
304
- typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Image, { src: image, alt: name, w: "100%", aspectRatio: "16/9", objectFit: "cover", objectPosition: "center" }) : !!image && /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { w: "100%", aspectRatio: "16/9", children: image }),
305
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "section", rounded: "md", p: 4, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", children: link ? /* @__PURE__ */ jsxRuntime.jsx(react$1.LinkOverlay, { href: link, children: name }) : name }) })
306
- ]
307
- }
308
- );
309
- };
310
- const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscreen }) => {
311
- const { t } = reactI18next.useTranslation("gameDemo");
312
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
313
- /* @__PURE__ */ jsxRuntime.jsx(
314
- react$1.Box,
315
- {
316
- as: "iframe",
317
- src,
318
- sandbox: "allow-scripts allow-same-origin",
319
- loading: "lazy",
320
- w: "100%",
321
- h: "100%",
322
- allowFullScreen: true,
323
- onLoad,
324
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: t("warning") })
325
- }
326
- ),
327
- /* @__PURE__ */ jsxRuntime.jsx(
328
- react$1.IconButton,
329
- {
330
- icon: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w: 3, h: 3 }) : /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLinkIcon, { w: 4, h: 4 }),
331
- size: "sm",
332
- variant: "outline",
333
- title: t(isFullscreen ? "action.deactivateFullscreen" : "action.activateFullscreen"),
334
- "aria-label": "Fullscreen mode Toggle",
335
- isRound: true,
336
- disabled: !isLoaded,
337
- position: "absolute",
338
- top: 2,
339
- left: 2,
340
- border: "none",
341
- color: "white",
342
- _hover: { bgColor: "whiteAlpha.400" },
343
- onClick: onToggleFullscreen
344
- }
345
- ),
346
- /* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Spinner, { size: "xl", thickness: "0.6rem", display: isLoaded ? "none" : "block", color: "brand.100" }) })
347
- ] });
348
- };
349
- const pulse = react$2.keyframes`
350
- 0% {
351
- box-shadow: 0 0 0 0 var(--chakra-colors-brand-100);
352
- }
353
-
354
- 50% {
355
- box-shadow: 0 0 0 0.8rem rgba(0, 0, 0, 0);
356
- }
357
-
358
- 100% {
359
- box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
360
- }
361
- `;
362
- const GameDemoPreview = ({ gameName, onPlay }) => {
363
- const { gamePreviewImageData } = index.useSiteMetadataContext();
364
- const { t } = reactI18next.useTranslation("gameDemo");
365
- const image = gatsbyPluginImage.getImage(gamePreviewImageData);
366
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
367
- !!image && /* @__PURE__ */ jsxRuntime.jsx(gatsbyPluginImage.GatsbyImage, { image, alt: `Play ${gameName} online`, objectFit: "contain" }),
368
- /* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(
369
- react$1.Button,
370
- {
371
- size: { base: "sm", md: "lg" },
372
- color: "gray.200",
373
- bgColor: "brand.500",
374
- animation: `${pulse} 2s infinite linear`,
375
- _hover: { bgColor: "brand.200", color: "gray.700" },
376
- onClick: onPlay,
377
- children: t("action.playForFree")
378
- }
379
- ) })
380
- ] });
381
- };
382
- const GameDemo = ({ name, src, previewImageFit, ...boxProps }) => {
383
- const [isRunning, setIsRunning] = react.useState(false);
384
- const [isLoaded, setIsLoaded] = react.useState(false);
385
- const { isOpen: isFullscreen, onToggle } = react$1.useDisclosure({ defaultIsOpen: false });
386
- function handlePlay() {
387
- setIsRunning(true);
388
- }
389
- function onLoad() {
390
- setIsLoaded(true);
391
- }
392
- function handleToggleFullscreen() {
393
- document.body.style.overflowY = isFullscreen ? "auto" : "hidden";
394
- onToggle();
395
- }
396
- return /* @__PURE__ */ jsxRuntime.jsx(
397
- react$1.Box,
398
- {
399
- as: "article",
400
- display: "grid",
401
- w: "100%",
402
- aspectRatio: "16/9 auto",
403
- ...isFullscreen ? { zIndex: 100, inset: 0, position: "fixed", h: "100dvh" } : { position: "relative" },
404
- ...boxProps,
405
- children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(
406
- GameDemoContent,
407
- {
408
- src,
409
- isFullscreen,
410
- isLoaded,
411
- onLoad,
412
- onToggleFullscreen: handleToggleFullscreen
413
- }
414
- ) : /* @__PURE__ */ jsxRuntime.jsx(GameDemoPreview, { gameName: name, previewImageFit, onPlay: handlePlay })
415
- }
416
- );
417
- };
418
- const GameInfoItem = ({ title, value }) => {
419
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { gap: 2, children: [
420
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { w: "50%", color: "gray.500", textTransform: "capitalize", children: [
421
- title,
422
- ":"
423
- ] }),
424
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { w: "50%", textTransform: "capitalize", children: value })
425
- ] });
426
- };
427
- const VISIBLE_LANGUAGE_NUMBER = 5;
428
- function stringifyHasFeature(value) {
429
- return i18n$1.t(`gameInfo:value.boolean.${value}`);
430
- }
431
- function stringifyVolatility(value) {
432
- return i18n$1.t(`gameInfo:value.volatility.${value}`);
433
- }
434
- function stringifyArray(array) {
435
- return array.join(", ");
436
- }
437
- function stringifyLanguageArray(languages) {
438
- return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
439
- }
440
- function getGameInfoItemValue(key, value, currency) {
441
- let formattedValue = "";
442
- if (key === i18n.GameCharacteristic.Rtp) {
443
- formattedValue = index$2.formatNumber(value, { percent: "real", precision: 3 });
444
- }
445
- if ((key === i18n.GameCharacteristic.MinBet || key === i18n.GameCharacteristic.MaxBet || key === i18n.GameCharacteristic.MaxWin) && typeof value === "number") {
446
- if (Array.isArray(currency)) {
447
- const [primary, ...secondaries] = currency || ["USD"];
448
- const primaryValue = index$2.formatNumber(value, { currency: primary });
449
- formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$2.getCurrencySymbol(currency2)).join(", ")})` : primaryValue;
450
- } else {
451
- formattedValue = index$2.formatNumber(value, { currency });
452
- }
453
- }
454
- if (key === i18n.GameCharacteristic.Compatibility || key === i18n.GameCharacteristic.BonusFeatures && typeof value !== "string") {
455
- formattedValue = stringifyArray(value);
456
- }
457
- if (key === i18n.GameCharacteristic.Languages) {
458
- formattedValue = stringifyLanguageArray(value);
459
- }
460
- if (key === i18n.GameCharacteristic.ReleaseDate) {
461
- formattedValue = index$2.formatDate({ value, options: { year: "numeric", month: "long" } });
462
- }
463
- if (key === i18n.GameCharacteristic.Volatility) {
464
- formattedValue = stringifyVolatility(value);
465
- }
466
- if (typeof value === "boolean") {
467
- formattedValue = stringifyHasFeature(value);
468
- }
469
- if (!formattedValue) {
470
- formattedValue = value.toLocaleString();
471
- }
472
- return formattedValue;
473
- }
474
- const GameInfo = ({ info }) => {
475
- const { siteMetadata } = index.useSiteMetadataContext();
476
- const { currency } = siteMetadata;
477
- const { t } = reactI18next.useTranslation("gameInfo");
478
- return /* @__PURE__ */ jsxRuntime.jsx(
479
- react$1.Box,
480
- {
481
- as: "aside",
482
- float: { base: "none", lg: "right" },
483
- w: { base: "100%", lg: "xs" },
484
- ml: { base: 0, lg: 4 },
485
- mb: { base: 0, lg: 4 },
486
- children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Card, { as: "article", variant: "outline", h: "100%", p: 2, children: [
487
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CardHeader, { as: "header", p: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Heading, { as: "h2", fontSize: "xl", children: t("title") }) }),
488
- /* @__PURE__ */ jsxRuntime.jsx(react$1.CardBody, { as: "section", p: 0, children: Object.entries(info).map(([group, items]) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
489
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Divider, { my: 2 }),
490
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontWeight: "semibold", mb: 2, children: t(`group.${group}`) }),
491
- Object.entries(items).map(([itemKey, itemValue]) => {
492
- const feature = itemKey;
493
- const value = getGameInfoItemValue(feature, itemValue, currency);
494
- return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
495
- })
496
- ] }, group)) })
497
- ] })
498
- }
499
- );
500
- };
501
- const HowTo = ({ steps, ...boxProps }) => {
502
- const { color, bgColor } = index$1.usePrimaryColors();
503
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description }, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
504
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Circle, { size: 12, bgColor, color, fontSize: "lg", fontWeight: "bold", children: String(index2 + 1) }),
505
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { flex: 1, children: [
506
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: "lg", fontWeight: "bold", children: title }),
507
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: description })
508
- ] })
509
- ] }, index2)) });
510
- };
511
- const Container = ({ children }) => {
512
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Container, { maxW: "container.xl", children });
513
- };
514
- const Content = ({ children }) => {
515
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "section", py: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children }) });
516
- };
517
- const Logo = () => {
518
- const { logoImageData } = index.useSiteMetadataContext();
519
- const image = gatsbyPluginImage.getImage(logoImageData);
520
- if (!image) {
521
- return null;
522
- }
523
- return /* @__PURE__ */ jsxRuntime.jsx(gatsbyPluginImage.GatsbyImage, { image, objectFit: "contain", alt: "Logo" });
524
- };
525
- const Brand$1 = ({ brand }) => {
526
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { position: "relative", my: 2, py: 8, children: [
527
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Divider, {}),
528
- /* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { display: "flex", bgColor: react$1.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: gatsby.Link, to: "/", children: brand }) })
529
- ] });
530
- };
531
- const Copyright = () => {
532
- const { siteMetadata } = index.useSiteMetadataContext();
533
- const { siteUrl } = siteMetadata;
534
- const { t } = reactI18next.useTranslation("footer");
535
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t("copyright", { year: index$2.getCurrentYear(), domain: index$2.getDomain(siteUrl) }) });
536
- };
537
- const Disclaimer = () => {
538
- const { siteMetadata } = index.useSiteMetadataContext();
539
- const { siteUrl } = siteMetadata;
540
- const { t } = reactI18next.useTranslation("footer");
541
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { as: "small", colorScheme: "gray", fontSize: "sm", children: [
542
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", fontWeight: "bold", color: "red.600", children: t("disclaimer.title") }),
543
- t("disclaimer.description", { domain: index$2.getDomain(siteUrl) })
544
- ] });
545
- };
546
- const Navigation$1 = () => {
547
- const { siteMetadata } = index.useSiteMetadataContext();
548
- const { footerMenuLinks } = siteMetadata;
549
- return /* @__PURE__ */ jsxRuntime.jsx(
550
- react$1.SimpleGrid,
551
- {
552
- columns: { base: 1, sm: 2, md: 4 },
553
- pt: 4,
554
- pb: 6,
555
- spacing: 4,
556
- justifyItems: { base: "flex-start", md: "center" },
557
- justifyContent: "space-between",
558
- children: footerMenuLinks.map(({ url, title }) => /* @__PURE__ */ jsxRuntime.jsx(
559
- react$1.Text,
560
- {
561
- as: gatsby.Link,
562
- to: url,
563
- fontSize: "md",
564
- fontWeight: "semibold",
565
- colorScheme: "gray",
566
- _hover: { textDecoration: "none", color: "brand.400" },
567
- children: title
568
- },
569
- url
570
- ))
571
- }
572
- );
573
- };
574
- const Footer = () => {
575
- return /* @__PURE__ */ jsxRuntime.jsx(
576
- react$1.Box,
577
- {
578
- as: "footer",
579
- bg: react$1.useColorModeValue("gray.50", "gray.900"),
580
- color: react$1.useColorModeValue("gray.700", "gray.200"),
581
- py: 4,
582
- children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
583
- /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, {}),
584
- /* @__PURE__ */ jsxRuntime.jsx(Disclaimer, {}),
585
- /* @__PURE__ */ jsxRuntime.jsx(Brand$1, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
586
- /* @__PURE__ */ jsxRuntime.jsx(Copyright, {})
587
- ] })
588
- }
589
- );
590
- };
591
- const Brand = ({ brand }) => {
592
- return /* @__PURE__ */ jsxRuntime.jsx(
593
- react$1.Box,
594
- {
595
- as: gatsby.Link,
596
- to: "/",
597
- display: "flex",
598
- h: { base: "40px", md: "60px" },
599
- fontFamily: "heading",
600
- color: react$1.useColorModeValue("gray.800", "white"),
601
- children: brand
602
- }
603
- );
604
- };
605
- const DesktopNavItem = ({ title, url, children }) => {
606
- const background = react$1.useColorModeValue("white", "gray.800");
607
- const backgroundHover = react$1.useColorModeValue("brand.50", "gray.900");
608
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Popover, { trigger: "hover", placement: "bottom-start", children: [
609
- /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
610
- react$1.Text,
611
- {
612
- as: gatsby.Link,
613
- to: url,
614
- p: 2,
615
- fontSize: "sm",
616
- fontWeight: 500,
617
- _hover: { textDecoration: "none", color: "brand.400" },
618
- children: title
619
- }
620
- ) }),
621
- !!children && /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverContent, { p: 4, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { as: "ul", children: children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
622
- react$1.Box,
623
- {
624
- as: "li",
625
- role: "group",
626
- display: "block",
627
- p: 2,
628
- cursor: "pointer",
629
- rounded: "md",
630
- _hover: { bg: backgroundHover },
631
- children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { direction: "row", children: [
632
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { children: [
633
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.title }),
634
- !!child.subtitle && /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: "sm", children: child.subtitle })
635
- ] }),
636
- /* @__PURE__ */ jsxRuntime.jsx(
637
- react$1.Flex,
638
- {
639
- flex: 1,
640
- justify: "flex-end",
641
- align: "center",
642
- opacity: 0,
643
- transition: "all .3s ease",
644
- transform: "translateX(-10px)",
645
- _groupHover: { opacity: 1, transform: "translateX(0)" },
646
- children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
647
- }
648
- )
649
- ] })
650
- },
651
- child.url
652
- )) }) })
653
- ] });
654
- };
655
- const DesktopNavigation = ({ menu }) => {
656
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { as: "ul", direction: "row", spacing: 4, children: menu.map((item) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(DesktopNavItem, { ...item }) }, item.url)) });
657
- };
658
- const MobileNavItem = ({ title, children, url }) => {
659
- const { isOpen, onToggle } = react$1.useDisclosure();
660
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { w: "100%", p: 2, children: [
661
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { align: "center", gap: 2, justify: "space-between", children: [
662
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: gatsby.Link, to: url, isTruncated: true, fontWeight: 600, children: title }),
663
- !!children && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "button", onClick: onToggle, children: /* @__PURE__ */ jsxRuntime.jsx(
664
- react$1.Icon,
665
- {
666
- as: icons.ChevronDownIcon,
667
- w: 6,
668
- h: 6,
669
- transform: isOpen ? "rotate(180deg)" : "",
670
- transition: "all .25s ease-in-out"
671
- }
672
- ) })
673
- ] }),
674
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsxRuntime.jsx(
675
- react$1.Stack,
676
- {
677
- as: "ul",
678
- pl: 2,
679
- borderLeft: 1,
680
- borderStyle: "solid",
681
- borderColor: react$1.useColorModeValue("gray.200", "gray.700"),
682
- children: !!children && children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: gatsby.Link, to: `${url}${child.url}`, py: 2, children: child.title }) }, child.url))
683
- }
684
- ) })
685
- ] });
686
- };
687
- const MobileNavigation = ({ menu }) => {
688
- const { isOpen, onToggle } = react$1.useDisclosure();
689
- const background = react$1.useColorModeValue("white", "gray.800");
690
- return menu.length ? /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { children: [
691
- /* @__PURE__ */ jsxRuntime.jsx(
692
- react$1.IconButton,
693
- {
694
- icon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w: 3, h: 3 }) : /* @__PURE__ */ jsxRuntime.jsx(icons.HamburgerIcon, {}),
695
- size: "md",
696
- variant: "ghost",
697
- "aria-label": "Toggle Navigation",
698
- onClick: onToggle
699
- }
700
- ),
701
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { position: "absolute", top: 14, right: 0, w: "100vw", px: 2, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Stack, { as: "ul", spacing: 2, p: 2, w: "100%", borderRadius: "md", boxShadow: "md", bg: background, children: menu.map((item) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { ...item }) }, item.url)) }) }) })
702
- ] }) : null;
703
- };
704
- const Navigation = ({ menu }) => {
705
- const isDesktop = react$1.useBreakpointValue({ base: false, md: true });
706
- return isDesktop ? /* @__PURE__ */ jsxRuntime.jsx(DesktopNavigation, { menu }) : /* @__PURE__ */ jsxRuntime.jsx(MobileNavigation, { menu });
707
- };
708
- const Navbar = ({ brand }) => {
709
- const menu = [];
710
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "nav", gap: 2, py: 1, children: [
711
- /* @__PURE__ */ jsxRuntime.jsx(Brand, { brand }),
712
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "section", flex: 1, align: "center", justifyContent: "flex-end", gap: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu }) })
713
- ] });
714
- };
715
- const Header = () => {
716
- return /* @__PURE__ */ jsxRuntime.jsx(
717
- react$1.Box,
718
- {
719
- as: "header",
720
- position: "sticky",
721
- top: 0,
722
- bg: react$1.useColorModeValue("white", "gray.900"),
723
- color: react$1.useColorModeValue("gray.700", "gray.200"),
724
- boxShadow: "sm",
725
- zIndex: 100,
726
- children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsx(Navbar, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }) })
727
- }
728
- );
729
- };
730
- const Hero = ({ title, subtitle, content, link, image }) => {
731
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { as: "section", bg: "gray.900", children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { direction: { base: "column", md: "row" }, children: [
732
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { align: "center", justify: { base: "center", md: "flex-start" }, flex: 1, py: 8, pe: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { spacing: 6, w: "full", maxW: "lg", children: [
733
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Heading, { as: "h1", fontSize: { base: "3xl", md: "4xl", lg: "5xl" }, children: [
734
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { as: "span", display: "block", children: [
735
- title,
736
- " —"
737
- ] }),
738
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", display: "block", color: "brand.400", children: subtitle })
739
- ] }),
740
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: { base: "md", lg: "lg" }, color: "gray.500", children: content }),
741
- !!link && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { direction: { base: "column", md: "row" }, children: /* @__PURE__ */ jsxRuntime.jsx(LinkButton, { ...link }) })
742
- ] }) }),
743
- image && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { display: { base: "none", md: "flex" }, flex: 1, children: image })
744
- ] }) }) });
745
- };
746
- const Main = ({ children }) => {
747
- return /* @__PURE__ */ jsxRuntime.jsx(
748
- react$1.Flex,
749
- {
750
- as: "main",
751
- direction: "column",
752
- flexGrow: 1,
753
- bg: react$1.useColorModeValue("white", "gray.800"),
754
- color: react$1.useColorModeValue("gray.700", "gray.200"),
755
- children
756
- }
757
- );
758
- };
759
- const ScrollToTop = () => {
760
- const [isVisible, setIsVisible] = react.useState(false);
761
- react.useEffect(() => {
762
- const toggleVisibility = () => {
763
- setIsVisible(window.scrollY > 300);
764
- };
765
- window.addEventListener("scroll", toggleVisibility);
766
- return () => {
767
- window.removeEventListener("scroll", toggleVisibility);
768
- };
769
- }, []);
770
- function handleClick() {
771
- window.scrollTo({
772
- top: 0,
773
- behavior: "smooth"
774
- });
775
- }
776
- return /* @__PURE__ */ jsxRuntime.jsx(
777
- react$1.Box,
778
- {
779
- position: "fixed",
780
- bottom: { base: 4, md: 8, lg: 16 },
781
- right: { base: 4, md: 8, lg: 16 },
782
- zIndex: "1000",
783
- opacity: isVisible ? 1 : 0,
784
- transform: isVisible ? "translateY(0)" : "translateY(0.5rem)",
785
- transition: "opacity 0.4s ease, transform 0.4s ease",
786
- pointerEvents: isVisible ? "auto" : "none",
787
- children: /* @__PURE__ */ jsxRuntime.jsx(
788
- react$1.IconButton,
789
- {
790
- "aria-label": "Scroll to top",
791
- icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronUpIcon, { w: 6, h: 6 }),
792
- size: "lg",
793
- shadow: "lg",
794
- colorScheme: "brand",
795
- isRound: true,
796
- onClick: handleClick
797
- }
798
- )
799
- }
800
- );
801
- };
802
- const Layout = ({ children }) => {
803
- const content = typeof children === "function" ? children({ Hero, Content }) : /* @__PURE__ */ jsxRuntime.jsx(Content, { children });
804
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { spacing: 0, position: "relative", w: "100%", minH: "100dvh", children: [
805
- /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
806
- /* @__PURE__ */ jsxRuntime.jsx(Main, { children: content }),
807
- /* @__PURE__ */ jsxRuntime.jsx(Footer, {}),
808
- /* @__PURE__ */ jsxRuntime.jsx(ScrollToTop, {})
809
- ] });
810
- };
811
- const List = ({ items, bullet = "—", render, className, ...boxProps }) => {
812
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { pl: 0, ml: 2, mb: 4, className, ...boxProps, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.ListItem, { display: "flex", gap: 1, children: [
813
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { children: bullet }),
814
- render ? render(item) : item
815
- ] }, index2)) });
816
- };
817
- const TitleMap = {
818
- pros: "advantages",
819
- cons: "disadvantages"
820
- };
821
- const IconMap = {
822
- pros: icons.CheckCircleIcon,
823
- cons: icons.WarningIcon
824
- };
825
- const IconColorMap = {
826
- pros: "green.500",
827
- cons: "red.500"
828
- };
829
- const BgColorMap = {
830
- pros: "green",
831
- cons: "red"
832
- };
833
- const ProsConsCard = ({ itemType, items }) => {
834
- const { t } = reactI18next.useTranslation("prosCons");
835
- return /* @__PURE__ */ jsxRuntime.jsxs(
836
- react$1.Card,
837
- {
838
- as: "article",
839
- flex: 1,
840
- p: 2,
841
- bgColor: react$1.useColorModeValue(`${BgColorMap[itemType]}.100`, `${BgColorMap[itemType]}.800`),
842
- children: [
843
- /* @__PURE__ */ jsxRuntime.jsx(
844
- react$1.CardHeader,
845
- {
846
- as: "header",
847
- p: 2,
848
- borderTopRadius: "md",
849
- bgColor: react$1.useColorModeValue("whiteAlpha.800", "blackAlpha.800"),
850
- children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Heading, { as: "h3", textTransform: "uppercase", fontSize: "xl", children: t(TitleMap[itemType]) })
851
- }
852
- ),
853
- /* @__PURE__ */ jsxRuntime.jsx(
854
- react$1.CardBody,
855
- {
856
- as: "section",
857
- p: 2,
858
- borderBottomRadius: "md",
859
- bgColor: react$1.useColorModeValue("whiteAlpha.800", "blackAlpha.800"),
860
- children: /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { spacing: 4, p: 0, children: items.map(({ title, description }) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.ListItem, { display: "flex", children: [
861
- /* @__PURE__ */ jsxRuntime.jsx(react$1.ListIcon, { as: IconMap[itemType], w: 6, h: 6, color: IconColorMap[itemType] }),
862
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { fontWeight: "semibold", fontSize: "md", children: [
863
- title,
864
- !!description && /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { as: "span", fontWeight: "normal", children: [
865
- ": ",
866
- description
867
- ] })
868
- ] })
869
- ] }, title)) })
870
- }
871
- )
872
- ]
873
- }
874
- );
875
- };
876
- const ProsCons = ({ items, ...boxProps }) => {
877
- const { pros, cons } = items;
878
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "section", direction: { base: "column", md: "row" }, gap: 4, ...boxProps, children: [
879
- /* @__PURE__ */ jsxRuntime.jsx(ProsConsCard, { itemType: "pros", items: pros }),
880
- /* @__PURE__ */ jsxRuntime.jsx(ProsConsCard, { itemType: "cons", items: cons })
881
- ] });
882
- };
883
- const Seo = ({ children, siteMetadata, title, description, lang }) => {
884
- const { title: defaultTitle, description: defaultDescription, lang: defaultLang, siteUrl } = siteMetadata;
885
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
886
- /* @__PURE__ */ jsxRuntime.jsx("html", { lang: lang ?? defaultLang }),
887
- /* @__PURE__ */ jsxRuntime.jsx("title", { children: title ? typeof title === "string" ? title : title({
888
- domain: index$2.getDomain(siteUrl),
889
- currentYear: index$2.getCurrentYear(),
890
- currentMonth: index$2.getCurrentMonth()
891
- }) : defaultTitle }),
892
- /* @__PURE__ */ jsxRuntime.jsx(
893
- "meta",
894
- {
895
- name: "description",
896
- content: description ? typeof description === "string" ? description : description({
897
- domain: index$2.getDomain(siteUrl),
898
- currentYear: index$2.getCurrentYear(),
899
- currentMonth: index$2.getCurrentMonth()
900
- }) : defaultDescription
901
- }
902
- ),
903
- children
904
- ] });
905
- };
906
- const Table = ({
907
- columnNumber,
908
- items,
909
- caption,
910
- bordered = false,
911
- striped = true,
912
- scrollable,
913
- className,
914
- ...boxProps
915
- }) => {
916
- const headerItems = items.slice(0, columnNumber);
917
- const bodyItems = items.slice(columnNumber);
918
- return /* @__PURE__ */ jsxRuntime.jsxs(
919
- react$1.TableContainer,
920
- {
921
- border: bordered ? void 0 : "none",
922
- ...scrollable ? { maxH: "50vh", overflowY: "auto" } : {},
923
- className,
924
- ...boxProps,
925
- children: [
926
- /* @__PURE__ */ jsxRuntime.jsxs(react$1.Table, { variant: striped ? "striped" : "simple", children: [
927
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Thead, { ...scrollable ? { position: "sticky", top: 0, zIndex: 1, bg: "gray.800" } : {}, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Tr, { children: headerItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Th, { children: item }, index2)) }) }),
928
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Tbody, { children: Array.from({ length: Math.ceil(bodyItems.length / columnNumber) }, (_, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Tr, { children: Array.from({ length: columnNumber }, (_2, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Td, { children: bodyItems[rowIndex * columnNumber + colIndex] || "" }, colIndex)) }, rowIndex)) })
929
- ] }),
930
- !!caption && /* @__PURE__ */ jsxRuntime.jsx(react$1.TableCaption, { children: caption })
931
- ]
932
- }
933
- );
934
- };
935
- const Tabs = ({ items, className, render, ...boxProps }) => {
936
- const { tabs, panels } = react.useMemo(() => {
937
- const tabs2 = [];
938
- const panels2 = [];
939
- items.forEach(({ content, ...tab }) => {
940
- tabs2.push(tab);
941
- panels2.push(content);
942
- });
943
- return { tabs: tabs2, panels: panels2 };
944
- }, []);
945
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Tabs, { overflow: "hidden", colorScheme: "brand", className, ...boxProps, children: [
946
- /* @__PURE__ */ jsxRuntime.jsx(react$1.TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Tab, { children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index2)) }),
947
- /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.TabPanel, { children: render(panel) }, index2)) })
948
- ] });
949
- };
950
- exports.Author = Author;
951
- exports.BonusCard = BonusCard;
952
- exports.Center = Center;
953
- exports.ContactForm = ContactForm;
954
- exports.ExpertTip = ExpertTip;
955
- exports.Faq = Faq;
956
- exports.Features = Features;
957
- exports.GameCard = GameCard;
958
- exports.GameDemo = GameDemo;
959
- exports.GameInfo = GameInfo;
960
- exports.Grid = Grid;
961
- exports.HowTo = HowTo;
962
- exports.Layout = Layout;
963
- exports.LinkButton = LinkButton;
964
- exports.List = List;
965
- exports.ProsCons = ProsCons;
966
- exports.Seo = Seo;
967
- exports.Table = Table;
968
- exports.Tabs = Tabs;