@cuemath/leap 2.8.24-hg1 → 2.8.24-link1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +6 -6
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +73 -29
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +81 -83
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +15 -25
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js +5 -6
- package/dist/features/circle-games/game-launcher/game-launcher-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +82 -123
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js +14 -0
- package/dist/features/circle-games/games/web-view/enums/project-ids-enum.js.map +1 -0
- package/dist/features/circle-games/games/web-view/enums/project-type-enum.js +1 -1
- package/dist/features/circle-games/games/web-view/enums/project-type-enum.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view.js +83 -70
- package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +16 -17
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +10 -11
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/points/points-styled.js +6 -7
- package/dist/features/post-game-stats/points/points-styled.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js +17 -18
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/constants.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +85 -75
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +4 -0
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/index.d.ts +109 -72
- package/dist/index.js +208 -203
- package/package.json +1 -1
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js +0 -4370
- package/dist/assets/lotties/circle/tables/advance-mode-segment-lottie.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js +0 -1552
- package/dist/assets/lotties/circle/tables/infinite-button-bg.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js +0 -1795
- package/dist/assets/lotties/circle/tables/infinite-button-symbol.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js +0 -9661
- package/dist/assets/lotties/circle/tables/random-mode-segment-lottie.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js +0 -8630
- package/dist/assets/lotties/circle/tables/sequence-mode-segment-lottie.json.js.map +0 -1
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js +0 -9076
- package/dist/assets/lotties/circle/tables/table-mode-reveal.json.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js +0 -53
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js +0 -24
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js +0 -20
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js +0 -24
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +0 -83
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +0 -161
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +0 -223
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +0 -1
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
const t = E * 17.5 / 100, _ = 5, o = Math.ceil(E * 87.5 / 100), R = E / 2 * (37.5 / 100), T = E / 2 * (12.5 / 100), S = Math.PI / 180, c = Math.sin(30 * S) * (E / 2 - _);
|
1
|
+
const _ = window.innerHeight > 800 ? 400 : 296, E = _, t = E * 17.5 / 100, A = 5, n = Math.ceil(E * 87.5 / 100), o = E / 2 * (37.5 / 100), R = E / 2 * (12.5 / 100), S = Math.PI / 180, c = Math.sin(30 * S) * (E / 2 - A);
|
3
2
|
export {
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
n as ASSET_CONTAINER_SIZE,
|
4
|
+
o as ASSET_OFFSET_X,
|
5
|
+
R as ASSET_OFFSET_Y,
|
7
6
|
t as GAME_LAUNCHER_ASSET_PADDING,
|
8
|
-
|
7
|
+
A as GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH,
|
8
|
+
E as GAME_LAUNCHER_SIZE,
|
9
9
|
c as delta
|
10
10
|
};
|
11
11
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/constants.ts"],"sourcesContent":["
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/constants.ts"],"sourcesContent":["const CARD_CONTAINER_SIZE = window.innerHeight > 800 ? 400 : 296;\n\nexport const GAME_LAUNCHER_SIZE = CARD_CONTAINER_SIZE;\nexport const GAME_LAUNCHER_ASSET_PADDING = (GAME_LAUNCHER_SIZE * 17.5) / 100;\n\n// to show the stroke of the card below points, this width needs to be reduced\nexport const GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH = 5;\n\n// asset container needs to be 350/400 % of GAME LAUNCHER SIZE\nexport const ASSET_CONTAINER_SIZE = Math.ceil((GAME_LAUNCHER_SIZE * 87.5) / 100);\n\n// ASSET x-axis OFFSET needs to be 37.5 % of 1/2 of GAME LAUNCHER SIZE\nexport const ASSET_OFFSET_X = (GAME_LAUNCHER_SIZE / 2) * (37.5 / 100);\n\n// ASSET y-axis OFFSET needs to be 37.5 % of 1/2 of GAME LAUNCHER SIZE\nexport const ASSET_OFFSET_Y = (GAME_LAUNCHER_SIZE / 2) * (12.5 / 100);\n\nconst RADIAN = Math.PI / 180;\n// const BORDER_WIDTH = 2;\n\n// delta created by a segment from x axis is 30deg\n// sin30 = delta/(CARD_SIZE/2)\nexport const delta =\n Math.sin(30 * RADIAN) * (GAME_LAUNCHER_SIZE / 2 - GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH);\n"],"names":["CARD_CONTAINER_SIZE","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GAME_LAUNCHER_PROGRESS_RING_STROKE_WIDTH","ASSET_CONTAINER_SIZE","ASSET_OFFSET_X","ASSET_OFFSET_Y","RADIAN","delta"],"mappings":"AAAA,MAAMA,IAAsB,OAAO,cAAc,MAAM,MAAM,KAEhDC,IAAqBD,GACrBE,IAA+BD,IAAqB,OAAQ,KAG5DE,IAA2C,GAG3CC,IAAuB,KAAK,KAAMH,IAAqB,OAAQ,GAAG,GAGlEI,IAAkBJ,IAAqB,KAAM,OAAO,MAGpDK,IAAkBL,IAAqB,KAAM,OAAO,MAE3DM,IAAS,KAAK,KAAK,KAKZC,IACX,KAAK,IAAI,KAAKD,CAAM,KAAKN,IAAqB,IAAIE;"}
|
@@ -1,11 +1,30 @@
|
|
1
1
|
import o from "styled-components";
|
2
|
-
import
|
3
|
-
import
|
2
|
+
import d from "../../../../ui/layout/flex-view.js";
|
3
|
+
import p from "../../../../ui/text/text.js";
|
4
|
+
import { GAME_LAUNCHER_SIZE as e, GAME_LAUNCHER_ASSET_PADDING as a, delta as l, ASSET_OFFSET_X as n, ASSET_OFFSET_Y as r, ASSET_CONTAINER_SIZE as i } from "./constants.js";
|
4
5
|
const g = o.div`
|
6
|
+
position: relative;
|
7
|
+
display: flex;
|
8
|
+
justify-content: center;
|
9
|
+
`, h = o.div`
|
10
|
+
position: relative;
|
11
|
+
border-radius: ${e}px;
|
12
|
+
height: ${e}px;
|
13
|
+
width: ${e}px;
|
14
|
+
display: flex;
|
15
|
+
flex-direction: column;
|
16
|
+
justify-content: center;
|
17
|
+
align-items: center;
|
18
|
+
overflow: hidden;
|
19
|
+
align-self: center;
|
20
|
+
backdrop-filter: blur(0px);
|
21
|
+
-webkit-backdrop-filter: blur(0px);
|
22
|
+
flex-shrink: 0;
|
23
|
+
`, b = o.div`
|
5
24
|
position: absolute;
|
6
25
|
z-index: 5;
|
7
|
-
height: ${e +
|
8
|
-
width: ${e +
|
26
|
+
height: ${e + a}px;
|
27
|
+
width: ${e + a}px;
|
9
28
|
pointer-events: none;
|
10
29
|
`, s = o.div`
|
11
30
|
height: ${e}px;
|
@@ -18,24 +37,24 @@ const g = o.div`
|
|
18
37
|
border: 2px solid ${({ theme: t }) => t.colors.WHITE};
|
19
38
|
backdrop-filter: blur(0px);
|
20
39
|
-webkit-backdrop-filter: blur(0px);
|
21
|
-
`,
|
40
|
+
`, u = o(s)`
|
22
41
|
transform-origin: bottom right;
|
23
42
|
transform: rotate(-32deg) skew(-32deg);
|
24
43
|
translate: -${e / 2}px -${e / 2}px;
|
25
44
|
border-right-width: 1px;
|
26
|
-
`,
|
45
|
+
`, $ = o(s)`
|
27
46
|
transform-origin: bottom left;
|
28
47
|
transform: rotate(32deg) skew(32deg);
|
29
48
|
translate: ${e / 2}px -${e / 2}px;
|
30
49
|
border-left-width: 1px;
|
31
|
-
`,
|
50
|
+
`, w = o(s)`
|
32
51
|
height: ${e / 2}px;
|
33
52
|
width: ${e}px;
|
34
53
|
bottom: 0;
|
35
54
|
left: 0;
|
36
55
|
z-index: 1;
|
37
56
|
border: none;
|
38
|
-
`,
|
57
|
+
`, S = o.div`
|
39
58
|
height: inherit;
|
40
59
|
width: inherit;
|
41
60
|
overflow: hidden;
|
@@ -43,16 +62,16 @@ const g = o.div`
|
|
43
62
|
display: flex;
|
44
63
|
justify-content: center;
|
45
64
|
align-items: center;
|
46
|
-
`,
|
65
|
+
`, k = o.div`
|
47
66
|
flex: 1;
|
48
67
|
background: transparent;
|
49
|
-
height: ${e / 2 +
|
68
|
+
height: ${e / 2 + l}px;
|
50
69
|
width: ${e}px;
|
51
70
|
position: absolute;
|
52
71
|
display: flex;
|
53
72
|
justify-content: center;
|
54
73
|
align-items: center;
|
55
|
-
bottom: ${({ $segmentType: t = "bottom" }) => t === "bottom" ? "unset" : `-${
|
74
|
+
bottom: ${({ $segmentType: t = "bottom" }) => t === "bottom" ? "unset" : `-${l}px`};
|
56
75
|
transform-origin: ${({ $segmentType: t }) => {
|
57
76
|
switch (t) {
|
58
77
|
case "left":
|
@@ -73,11 +92,11 @@ const g = o.div`
|
|
73
92
|
return "none";
|
74
93
|
}
|
75
94
|
}};
|
76
|
-
`,
|
95
|
+
`, v = o.div`
|
77
96
|
position: absolute;
|
78
|
-
right: ${({ $segmentType: t }) => t === "left" ? `-${
|
79
|
-
left: ${({ $segmentType: t }) => t === "right" ? `-${
|
80
|
-
bottom: ${({ $segmentType: t }) => t === "bottom" ? `-${
|
97
|
+
right: ${({ $segmentType: t }) => t === "left" ? `-${n}px` : "unset"};
|
98
|
+
left: ${({ $segmentType: t }) => t === "right" ? `-${n}px` : "unset"};
|
99
|
+
bottom: ${({ $segmentType: t }) => t === "bottom" ? `-${r}px` : `-${r}px`};
|
81
100
|
height: ${i}px;
|
82
101
|
width: ${i}px;
|
83
102
|
display: flex;
|
@@ -90,11 +109,11 @@ const g = o.div`
|
|
90
109
|
background: ${({ theme: t }) => t.colors.WHITE_T_15};
|
91
110
|
cursor: pointer;
|
92
111
|
}
|
93
|
-
`,
|
112
|
+
`, E = o.div`
|
94
113
|
position: absolute;
|
95
|
-
right: ${({ $segmentType: t }) => t === "left" ? `-${
|
96
|
-
left: ${({ $segmentType: t }) => t === "right" ? `-${
|
97
|
-
bottom: ${({ $segmentType: t }) => t === "bottom" ? `-${
|
114
|
+
right: ${({ $segmentType: t }) => t === "left" ? `-${n}px` : "unset"};
|
115
|
+
left: ${({ $segmentType: t }) => t === "right" ? `-${n}px` : "unset"};
|
116
|
+
bottom: ${({ $segmentType: t }) => t === "bottom" ? `-${r}px` : `-${r}px`};
|
98
117
|
height: ${i}px;
|
99
118
|
width: ${i}px;
|
100
119
|
z-index: 5;
|
@@ -104,19 +123,44 @@ const g = o.div`
|
|
104
123
|
display: flex;
|
105
124
|
align-items: center;
|
106
125
|
justify-content: center;
|
107
|
-
`,
|
126
|
+
`, y = o.div`
|
108
127
|
position: absolute;
|
109
128
|
z-index: 6;
|
129
|
+
`, _ = o(d)`
|
130
|
+
z-index: 1;
|
131
|
+
top: -28px;
|
132
|
+
`, A = o(p)`
|
133
|
+
transition: color 0.5s ease-in-out;
|
134
|
+
|
135
|
+
${({ isAnimated: t }) => t && `
|
136
|
+
animation: zoomInOut 1s ease-in-out infinite;
|
137
|
+
`}
|
138
|
+
|
139
|
+
@keyframes zoomInOut {
|
140
|
+
0% {
|
141
|
+
transform: scale(1);
|
142
|
+
}
|
143
|
+
50% {
|
144
|
+
transform: scale(1.05);
|
145
|
+
}
|
146
|
+
100% {
|
147
|
+
transform: scale(1);
|
148
|
+
}
|
149
|
+
}
|
110
150
|
`;
|
111
151
|
export {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
152
|
+
A as AnimatedLabel,
|
153
|
+
b as CircularProgressLottieContainer,
|
154
|
+
_ as ExtendedFlexView,
|
155
|
+
y as IconWrapper,
|
156
|
+
v as SegmentAssetContainer,
|
157
|
+
w as SegmentBottom,
|
158
|
+
S as SegmentContainer,
|
159
|
+
k as SegmentContentContainer,
|
160
|
+
u as SegmentLeft,
|
161
|
+
E as SegmentOverlay,
|
162
|
+
$ as SegmentRight,
|
163
|
+
g as SegmentedCard,
|
164
|
+
h as SegmentedCardWrapper
|
121
165
|
};
|
122
166
|
//# sourceMappingURL=segmented-game-card-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"segmented-game-card-styled.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.tsx"],"sourcesContent":["import type { TSegment } from './segmented-game-card-types';\n\nimport styled from 'styled-components';\n\nimport
|
1
|
+
{"version":3,"file":"segmented-game-card-styled.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.tsx"],"sourcesContent":["import type { TSegment } from './segmented-game-card-types';\n\nimport styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport {\n GAME_LAUNCHER_SIZE,\n ASSET_CONTAINER_SIZE,\n delta,\n ASSET_OFFSET_X,\n ASSET_OFFSET_Y,\n GAME_LAUNCHER_ASSET_PADDING,\n} from './constants';\n\nexport const SegmentedCard = styled.div`\n position: relative;\n display: flex;\n justify-content: center;\n`;\n\nexport const SegmentedCardWrapper = styled.div`\n position: relative;\n border-radius: ${GAME_LAUNCHER_SIZE}px;\n height: ${GAME_LAUNCHER_SIZE}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n align-self: center;\n backdrop-filter: blur(0px);\n -webkit-backdrop-filter: blur(0px);\n flex-shrink: 0;\n`;\n\nexport const CircularProgressLottieContainer = styled.div`\n position: absolute;\n z-index: 5;\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n pointer-events: none;\n`;\n\n// might be needed later-----\n// export const SegmentDevider = styled.div<{ angle: number }>`\n// width: ${GAME_LAUNCHER_SIZE / 2}px;\n// height: 2px;\n// position: absolute;\n// background: #fff;\n// transform-origin: left;\n// transform: ${({ angle }) => `rotate(${angle}deg)`};\n// `;\n\nconst Segment = styled.div`\n height: ${GAME_LAUNCHER_SIZE}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n overflow: hidden;\n display: flex;\n position: absolute;\n background: ${({ theme }) => theme.colors.BLACK_1};\n z-index: 2;\n border: 2px solid ${({ theme }) => theme.colors.WHITE};\n backdrop-filter: blur(0px);\n -webkit-backdrop-filter: blur(0px);\n`;\n\nexport const SegmentLeft = styled(Segment)<{\n $angle?: number;\n}>`\n transform-origin: bottom right;\n transform: rotate(-32deg) skew(-32deg);\n translate: -${GAME_LAUNCHER_SIZE / 2}px -${GAME_LAUNCHER_SIZE / 2}px;\n border-right-width: 1px;\n`;\n\nexport const SegmentRight = styled(Segment)<{\n $angle?: number;\n}>`\n transform-origin: bottom left;\n transform: rotate(32deg) skew(32deg);\n translate: ${GAME_LAUNCHER_SIZE / 2}px -${GAME_LAUNCHER_SIZE / 2}px;\n border-left-width: 1px;\n`;\n\nexport const SegmentBottom = styled(Segment)<{\n $angle?: number;\n}>`\n height: ${GAME_LAUNCHER_SIZE / 2}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n bottom: 0;\n left: 0;\n z-index: 1;\n border: none;\n`;\n\nexport const SegmentContainer = styled.div`\n height: inherit;\n width: inherit;\n overflow: hidden;\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const SegmentContentContainer = styled.div<{ $segmentType?: TSegment }>`\n flex: 1;\n background: transparent;\n height: ${GAME_LAUNCHER_SIZE / 2 + delta}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n bottom: ${({ $segmentType = 'bottom' }) => ($segmentType === 'bottom' ? 'unset' : `-${delta}px`)};\n transform-origin: ${({ $segmentType }) => {\n switch ($segmentType) {\n case 'left':\n return 'bottom right';\n case 'right':\n return 'bottom left';\n default:\n return 'unset';\n }\n }};\n transform: ${({ $segmentType = 'bottom' }) => {\n switch ($segmentType) {\n case 'left':\n return 'skew(32deg) rotate(32deg)';\n case 'right':\n return 'skew(-32deg) rotate(-32deg)';\n default:\n return 'none';\n }\n }};\n`;\n\nexport const SegmentAssetContainer = styled.div<{\n $segmentType?: TSegment;\n}>`\n position: absolute;\n right: ${({ $segmentType }) => ($segmentType === 'left' ? `-${ASSET_OFFSET_X}px` : 'unset')};\n left: ${({ $segmentType }) => ($segmentType === 'right' ? `-${ASSET_OFFSET_X}px` : 'unset')};\n bottom: ${({ $segmentType }) =>\n $segmentType === 'bottom' ? `-${ASSET_OFFSET_Y}px` : `-${ASSET_OFFSET_Y}px`};\n height: ${ASSET_CONTAINER_SIZE}px;\n width: ${ASSET_CONTAINER_SIZE}px;\n display: flex;\n align-items: center;\n overflow: hidden;\n background-color: transparent;\n z-index: 1;\n flex-shrink: 0;\n &:hover {\n background: ${({ theme }) => theme.colors.WHITE_T_15};\n cursor: pointer;\n }\n`;\n\nexport const SegmentOverlay = styled.div<{ $segmentType?: TSegment }>`\n position: absolute;\n right: ${({ $segmentType }) => ($segmentType === 'left' ? `-${ASSET_OFFSET_X}px` : 'unset')};\n left: ${({ $segmentType }) => ($segmentType === 'right' ? `-${ASSET_OFFSET_X}px` : 'unset')};\n bottom: ${({ $segmentType }) =>\n $segmentType === 'bottom' ? `-${ASSET_OFFSET_Y}px` : `-${ASSET_OFFSET_Y}px`};\n height: ${ASSET_CONTAINER_SIZE}px;\n width: ${ASSET_CONTAINER_SIZE}px;\n z-index: 5;\n backdrop-filter: blur(16px);\n -webkit-backdrop-filter: blur(16px);\n /* pointer-events: none; */\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const IconWrapper = styled.div`\n position: absolute;\n z-index: 6;\n`;\n\nexport const ExtendedFlexView = styled(FlexView)`\n z-index: 1;\n top: -28px;\n`;\n\nexport const AnimatedLabel = styled(Text)<{ isAnimated: boolean }>`\n transition: color 0.5s ease-in-out;\n\n ${({ isAnimated }) =>\n isAnimated &&\n `\n animation: zoomInOut 1s ease-in-out infinite;\n `}\n\n @keyframes zoomInOut {\n 0% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.05);\n }\n 100% {\n transform: scale(1);\n }\n }\n`;\n"],"names":["SegmentedCard","styled","SegmentedCardWrapper","GAME_LAUNCHER_SIZE","CircularProgressLottieContainer","GAME_LAUNCHER_ASSET_PADDING","Segment","theme","SegmentLeft","SegmentRight","SegmentBottom","SegmentContainer","SegmentContentContainer","delta","$segmentType","SegmentAssetContainer","ASSET_OFFSET_X","ASSET_OFFSET_Y","ASSET_CONTAINER_SIZE","SegmentOverlay","IconWrapper","ExtendedFlexView","FlexView","AnimatedLabel","Text","isAnimated"],"mappings":";;;;AAeO,MAAMA,IAAgBC,EAAO;AAAA;AAAA;AAAA;AAAA,GAMvBC,IAAuBD,EAAO;AAAA;AAAA,mBAExBE,CAAkB;AAAA,YACzBA,CAAkB;AAAA,WACnB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-launcher/comps/segmented-game-card/segmented-game-card.js
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import { CircularProgressLottieContainer as x, SegmentLeft as B, SegmentRight as O, SegmentBottom as q, SegmentContainer as z, SegmentContentContainer as J, SegmentAssetContainer as K, SegmentOverlay as N, IconWrapper as Q } from "./segmented-game-card-styled.js";
|
1
|
+
import { jsxs as A, jsx as t } from "react/jsx-runtime";
|
2
|
+
import R from "lottie-web";
|
3
|
+
import { memo as M, forwardRef as v, useRef as f, useState as S, useCallback as u, useImperativeHandle as w, useEffect as b } from "react";
|
4
|
+
import F from "../../../../../assets/line-icons/icons/check.js";
|
5
|
+
import x from "../../../../../assets/lotties/circle/levelup-rings-lottie.json.js";
|
6
|
+
import { fetchLottie as j } from "./fetch-lottie.js";
|
7
|
+
import { SegmentedCard as D, ExtendedFlexView as G, AnimatedLabel as B, SegmentedCardWrapper as O, CircularProgressLottieContainer as q, SegmentLeft as z, SegmentRight as J, SegmentBottom as K, SegmentContainer as N, SegmentContentContainer as Q, SegmentAssetContainer as U, SegmentOverlay as X, IconWrapper as Y } from "./segmented-game-card-styled.js";
|
9
8
|
const T = ({
|
10
9
|
segmentType: e,
|
11
10
|
isCompleted: i,
|
@@ -13,13 +12,13 @@ const T = ({
|
|
13
12
|
name: m,
|
14
13
|
onMouseEnter: s
|
15
14
|
}) => {
|
16
|
-
const
|
17
|
-
|
15
|
+
const c = f(null);
|
16
|
+
b(() => {
|
18
17
|
let r = null;
|
19
18
|
return (async () => {
|
20
|
-
const p = await
|
21
|
-
r =
|
22
|
-
container:
|
19
|
+
const p = await j(l);
|
20
|
+
r = R.loadAnimation({
|
21
|
+
container: c.current,
|
23
22
|
renderer: "canvas",
|
24
23
|
loop: !0,
|
25
24
|
autoplay: !0,
|
@@ -27,90 +26,89 @@ const T = ({
|
|
27
26
|
});
|
28
27
|
})(), () => r == null ? void 0 : r.destroy();
|
29
28
|
}, [l]);
|
30
|
-
const
|
31
|
-
return /* @__PURE__ */ t(
|
32
|
-
/* @__PURE__ */ t(
|
33
|
-
i && /* @__PURE__ */ t(
|
29
|
+
const d = u(() => s(m), [s, m]);
|
30
|
+
return /* @__PURE__ */ t(N, { children: /* @__PURE__ */ A(Q, { $segmentType: e, onMouseEnter: d, children: [
|
31
|
+
/* @__PURE__ */ t(U, { ref: c, $segmentType: e }),
|
32
|
+
i && /* @__PURE__ */ t(X, { $segmentType: e, children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(F, { color: "#fff", height: 40, width: 40 }) }) })
|
34
33
|
] }) });
|
35
|
-
},
|
36
|
-
const
|
34
|
+
}, Z = ({ data: e, label: i, initialValue: l = 0, value: m, maxValue: s = 1 }, c) => {
|
35
|
+
const d = f(null), r = f(null), g = f(null), [p, y] = S(i), [L, E] = S(!1), [I, $] = S("WHITE_T_87"), P = p !== i, h = u((n) => {
|
37
36
|
y(n);
|
38
|
-
}, []),
|
37
|
+
}, []), W = u(() => {
|
39
38
|
y(i);
|
40
|
-
}, [i]),
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
[e]
|
46
|
-
), k = c((n) => {
|
47
|
-
b(!0), P(n);
|
39
|
+
}, [i]), C = (n) => {
|
40
|
+
var o, a;
|
41
|
+
(a = (o = e[n]) == null ? void 0 : o.onPress) == null || a.call(o);
|
42
|
+
}, _ = u((n) => {
|
43
|
+
E(!0), $(n);
|
48
44
|
}, []);
|
49
|
-
return
|
45
|
+
return w(c, () => ({
|
50
46
|
labelRef: r,
|
51
|
-
segmentedCardWrapperRef:
|
52
|
-
startLabelAnimation:
|
53
|
-
})),
|
54
|
-
const n =
|
55
|
-
container:
|
47
|
+
segmentedCardWrapperRef: g,
|
48
|
+
startLabelAnimation: _
|
49
|
+
})), b(() => {
|
50
|
+
const n = R.loadAnimation({
|
51
|
+
container: d.current,
|
56
52
|
renderer: "canvas",
|
57
53
|
autoplay: !1,
|
58
54
|
loop: !1,
|
59
|
-
animationData:
|
55
|
+
animationData: x
|
60
56
|
});
|
61
57
|
if (s <= 0)
|
62
58
|
return;
|
63
|
-
const o = 92, a = o / s,
|
64
|
-
return n.playSegments([
|
59
|
+
const o = 92, a = o / s, k = Math.min(a * l, o), H = Math.min(a * m + 1, o);
|
60
|
+
return n.playSegments([k, H], !0), () => {
|
65
61
|
n.destroy();
|
66
62
|
};
|
67
|
-
}, [l, m, s]), /* @__PURE__ */
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
63
|
+
}, [l, m, s]), /* @__PURE__ */ A(D, { children: [
|
64
|
+
/* @__PURE__ */ t(G, { $position: "absolute", children: /* @__PURE__ */ t(
|
65
|
+
B,
|
66
|
+
{
|
67
|
+
ref: r,
|
68
|
+
$renderAs: "ac3",
|
69
|
+
$align: "center",
|
70
|
+
$color: L ? I : P ? "WHITE_T_87" : "WHITE_T_60",
|
71
|
+
isAnimated: L,
|
72
|
+
children: p
|
73
|
+
}
|
74
|
+
) }),
|
75
|
+
/* @__PURE__ */ A(O, { ref: g, onMouseLeave: W, children: [
|
76
|
+
/* @__PURE__ */ t(q, { ref: d }),
|
77
|
+
/* @__PURE__ */ t(z, { onClick: () => C(0), children: /* @__PURE__ */ t(
|
78
|
+
T,
|
79
|
+
{
|
80
|
+
segmentType: "left",
|
81
|
+
card: e[0].card,
|
82
|
+
name: e[0].name,
|
83
|
+
isCompleted: e[0].isCompleted,
|
84
|
+
onMouseEnter: h
|
85
|
+
}
|
86
|
+
) }),
|
87
|
+
/* @__PURE__ */ t(J, { onClick: () => C(1), children: /* @__PURE__ */ t(
|
88
|
+
T,
|
89
|
+
{
|
90
|
+
segmentType: "right",
|
91
|
+
card: e[1].card,
|
92
|
+
name: e[1].name,
|
93
|
+
isCompleted: e[1].isCompleted,
|
94
|
+
onMouseEnter: h
|
95
|
+
}
|
96
|
+
) }),
|
97
|
+
/* @__PURE__ */ t(K, { onClick: () => C(2), children: /* @__PURE__ */ t(
|
98
|
+
T,
|
99
|
+
{
|
100
|
+
segmentType: "bottom",
|
101
|
+
card: e[2].card,
|
102
|
+
name: e[2].name,
|
103
|
+
isCompleted: e[2].isCompleted,
|
104
|
+
onMouseEnter: h
|
105
|
+
}
|
106
|
+
) })
|
107
|
+
] })
|
108
|
+
] });
|
109
|
+
}, se = M(v(Z));
|
112
110
|
export {
|
113
111
|
T as SegmentContent,
|
114
|
-
|
112
|
+
se as SegmentedGameCard
|
115
113
|
};
|
116
114
|
//# sourceMappingURL=segmented-game-card.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"segmented-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type {\n IGameCardSegmentContentProps,\n ISegmentedGameCardProps,\n ISegmentedGameCardRefs,\n} from './segmented-game-card-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ForwardRefRenderFunction } from 'react';\n\nimport Lottie from 'lottie-web';\nimport {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\n\nimport CheckIcon from '../../../../../assets/line-icons/icons/check';\nimport progressRingLottie from '../../../../../assets/lotties/circle/levelup-rings-lottie.json';\nimport { CardContainer } from '../card-container/card-container';\nimport { fetchLottie } from './fetch-lottie';\nimport * as Styled from './segmented-game-card-styled';\n\nexport const SegmentContent: FC<IGameCardSegmentContentProps> = ({\n segmentType,\n isCompleted,\n card,\n name,\n onMouseEnter,\n}) => {\n const lottieAnimationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n\n const loadLottie = async () => {\n const lottie = await fetchLottie(card);\n\n animation = Lottie.loadAnimation({\n container: lottieAnimationRef.current as Element,\n renderer: 'canvas',\n loop: true,\n autoplay: true,\n animationData: lottie,\n });\n };\n\n loadLottie();\n\n return () => {\n return animation?.destroy();\n };\n }, [card]);\n\n const handleMouseEnter = useCallback(() => onMouseEnter(name), [onMouseEnter, name]);\n\n return (\n <Styled.SegmentContainer>\n <Styled.SegmentContentContainer $segmentType={segmentType} onMouseEnter={handleMouseEnter}>\n <Styled.SegmentAssetContainer ref={lottieAnimationRef} $segmentType={segmentType} />\n {isCompleted && (\n <Styled.SegmentOverlay $segmentType={segmentType}>\n <Styled.IconWrapper>\n <CheckIcon color=\"#fff\" height={40} width={40} />\n </Styled.IconWrapper>\n </Styled.SegmentOverlay>\n )}\n </Styled.SegmentContentContainer>\n </Styled.SegmentContainer>\n );\n};\n\nconst SegmentedGameCardComponent: ForwardRefRenderFunction<\n ISegmentedGameCardRefs,\n ISegmentedGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const lottieAnimationRef = useRef<HTMLDivElement>(null);\n const labelRef = useRef<HTMLDivElement>(null);\n const cardWrapperRef = useRef<HTMLDivElement>(null);\n\n const [label, setLabel] = useState<string>(gameCategoryLabel);\n const [isAnimated, setIsAnimated] = useState(false);\n const [animatedColor, setAnimatedColor] = useState<TColorNames>('WHITE_T_87');\n\n const isLabelHighlighted = label !== gameCategoryLabel;\n\n const onMouseEnter = useCallback((gameName: string) => {\n setLabel(gameName);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setLabel(gameCategoryLabel);\n }, [gameCategoryLabel]);\n\n const onSegmentPress = useCallback(\n (index: number) => {\n data[index]?.onPress?.();\n },\n [data],\n );\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setIsAnimated(true);\n setAnimatedColor(color);\n }, []);\n\n useImperativeHandle(ref, () => ({\n labelRef,\n segmentedCardWrapperRef: cardWrapperRef,\n startLabelAnimation,\n }));\n\n useEffect(() => {\n const animation = Lottie.loadAnimation({\n container: lottieAnimationRef.current as Element,\n renderer: 'canvas',\n autoplay: false,\n loop: false,\n animationData: progressRingLottie,\n });\n\n // handle progress lottie\n // total frames in 100% progress are 90 frames\n if (maxValue <= 0) {\n return;\n }\n\n const totalFrames = 92;\n const framesPerValue = totalFrames / maxValue;\n\n const initialFrameToPlay = Math.min(framesPerValue * initialValue, totalFrames);\n const finalFrameToPlay = Math.min(framesPerValue * value + 1, totalFrames);\n\n animation.playSegments([initialFrameToPlay, finalFrameToPlay], true);\n\n return () => {\n animation.destroy();\n };\n }, [initialValue, value, maxValue]);\n\n return (\n <CardContainer\n ref={cardWrapperRef}\n labelRef={labelRef}\n label={label}\n isAnimated={isAnimated}\n onMouseLeave={onMouseLeave}\n labelColor={isAnimated ? animatedColor : isLabelHighlighted ? 'WHITE_T_87' : 'WHITE_T_60'}\n >\n <Styled.CircularProgressLottieContainer ref={lottieAnimationRef} />\n {/* left segment */}\n <Styled.SegmentLeft onClick={() => onSegmentPress(0)}>\n <SegmentContent\n segmentType={'left'}\n card={data[0]!.card}\n name={data[0]!.name}\n isCompleted={data[0]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentLeft>\n\n {/* right segment */}\n <Styled.SegmentRight onClick={() => onSegmentPress(1)}>\n <SegmentContent\n segmentType={'right'}\n card={data[1]!.card}\n name={data[1]!.name}\n isCompleted={data[1]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentRight>\n\n {/* bottom segment */}\n <Styled.SegmentBottom onClick={() => onSegmentPress(2)}>\n <SegmentContent\n segmentType={'bottom'}\n card={data[2]!.card}\n name={data[2]!.name}\n isCompleted={data[2]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentBottom>\n </CardContainer>\n );\n};\n\nexport const SegmentedGameCard = memo(forwardRef(SegmentedGameCardComponent));\n"],"names":["SegmentContent","segmentType","isCompleted","card","name","onMouseEnter","lottieAnimationRef","useRef","useEffect","animation","lottie","fetchLottie","Lottie","handleMouseEnter","useCallback","jsx","Styled.SegmentContainer","jsxs","Styled.SegmentContentContainer","Styled.SegmentAssetContainer","Styled.SegmentOverlay","Styled.IconWrapper","CheckIcon","SegmentedGameCardComponent","data","gameCategoryLabel","initialValue","value","maxValue","ref","labelRef","cardWrapperRef","label","setLabel","useState","isAnimated","setIsAnimated","animatedColor","setAnimatedColor","isLabelHighlighted","gameName","onMouseLeave","onSegmentPress","index","_b","_a","startLabelAnimation","color","useImperativeHandle","progressRingLottie","totalFrames","framesPerValue","initialFrameToPlay","finalFrameToPlay","CardContainer","Styled.CircularProgressLottieContainer","Styled.SegmentLeft","Styled.SegmentRight","Styled.SegmentBottom","SegmentedGameCard","memo","forwardRef"],"mappings":";;;;;;;;AA0BO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AACF,MAAM;AACE,QAAAC,IAAqBC,EAAuB,IAAI;AAEtD,EAAAC,EAAU,MAAM;AACd,QAAIC,IAAkC;AAc3B,YAZQ,YAAY;AACvB,YAAAC,IAAS,MAAMC,EAAYR,CAAI;AAErC,MAAAM,IAAYG,EAAO,cAAc;AAAA,QAC/B,WAAWN,EAAmB;AAAA,QAC9B,UAAU;AAAA,QACV,MAAM;AAAA,QACN,UAAU;AAAA,QACV,eAAeI;AAAA,MAAA,CAChB;AAAA,IAAA,MAKI,MACED,KAAA,gBAAAA,EAAW;AAAA,EACpB,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aA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAnB;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,QAGA,gBAAAU,EAAC0C,GAAA,EAAoB,SAAS,MAAMf,EAAe,CAAC,GAClD,UAAA,gBAAA3B;AAAA,UAACf;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAnB;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,QAGA,gBAAAU,EAAC2C,GAAA,EAAqB,SAAS,MAAMhB,EAAe,CAAC,GACnD,UAAA,gBAAA3B;AAAA,UAACf;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAnB;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEasD,KAAoBC,EAAKC,EAAWtC,CAA0B,CAAC;"}
|
1
|
+
{"version":3,"file":"segmented-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type {\n IGameCardSegmentContentProps,\n ISegmentedGameCardProps,\n ISegmentedGameCardRefs,\n} from './segmented-game-card-types';\nimport type { AnimationItem } from 'lottie-web';\nimport type { FC, ForwardRefRenderFunction } from 'react';\n\nimport Lottie from 'lottie-web';\nimport {\n forwardRef,\n memo,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\n\nimport CheckIcon from '../../../../../assets/line-icons/icons/check';\nimport progressRingLottie from '../../../../../assets/lotties/circle/levelup-rings-lottie.json';\nimport { fetchLottie } from './fetch-lottie';\nimport * as Styled from './segmented-game-card-styled';\n\nexport const SegmentContent: FC<IGameCardSegmentContentProps> = ({\n segmentType,\n isCompleted,\n card,\n name,\n onMouseEnter,\n}) => {\n const lottieAnimationRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let animation: AnimationItem | null = null;\n\n const loadLottie = async () => {\n const lottie = await fetchLottie(card);\n\n animation = Lottie.loadAnimation({\n container: lottieAnimationRef.current as Element,\n renderer: 'canvas',\n loop: true,\n autoplay: true,\n animationData: lottie,\n });\n };\n\n loadLottie();\n\n return () => {\n return animation?.destroy();\n };\n }, [card]);\n\n const handleMouseEnter = useCallback(() => onMouseEnter(name), [onMouseEnter, name]);\n\n return (\n <Styled.SegmentContainer>\n <Styled.SegmentContentContainer $segmentType={segmentType} onMouseEnter={handleMouseEnter}>\n <Styled.SegmentAssetContainer ref={lottieAnimationRef} $segmentType={segmentType} />\n {isCompleted && (\n <Styled.SegmentOverlay $segmentType={segmentType}>\n <Styled.IconWrapper>\n <CheckIcon color=\"#fff\" height={40} width={40} />\n </Styled.IconWrapper>\n </Styled.SegmentOverlay>\n )}\n </Styled.SegmentContentContainer>\n </Styled.SegmentContainer>\n );\n};\n\nconst SegmentedGameCardComponent: ForwardRefRenderFunction<\n ISegmentedGameCardRefs,\n ISegmentedGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const lottieAnimationRef = useRef<HTMLDivElement>(null);\n const labelRef = useRef<HTMLDivElement>(null);\n const segmentedCardWrapperRef = useRef<HTMLDivElement>(null);\n\n const [label, setLabel] = useState<string>(gameCategoryLabel);\n const [isAnimated, setIsAnimated] = useState(false);\n const [animatedColor, setAnimatedColor] = useState<TColorNames>('WHITE_T_87');\n\n const isLabelHighlighted = label !== gameCategoryLabel;\n\n const onMouseEnter = useCallback((gameName: string) => {\n setLabel(gameName);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setLabel(gameCategoryLabel);\n }, [gameCategoryLabel]);\n\n const onSegmentPress = (index: number) => {\n data[index]?.onPress?.();\n };\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setIsAnimated(true);\n setAnimatedColor(color);\n }, []);\n\n useImperativeHandle(ref, () => ({\n labelRef,\n segmentedCardWrapperRef,\n startLabelAnimation,\n }));\n\n useEffect(() => {\n const animation = Lottie.loadAnimation({\n container: lottieAnimationRef.current as Element,\n renderer: 'canvas',\n autoplay: false,\n loop: false,\n animationData: progressRingLottie,\n });\n\n // handle progress lottie\n // total frames in 100% progress are 90 frames\n if (maxValue <= 0) {\n return;\n }\n\n const totalFrames = 92;\n const framesPerValue = totalFrames / maxValue;\n\n const initialFrameToPlay = Math.min(framesPerValue * initialValue, totalFrames);\n const finalFrameToPlay = Math.min(framesPerValue * value + 1, totalFrames);\n\n animation.playSegments([initialFrameToPlay, finalFrameToPlay], true);\n\n return () => {\n animation.destroy();\n };\n }, [initialValue, value, maxValue]);\n\n return (\n <Styled.SegmentedCard>\n <Styled.ExtendedFlexView $position=\"absolute\">\n <Styled.AnimatedLabel\n ref={labelRef}\n $renderAs=\"ac3\"\n $align=\"center\"\n $color={isAnimated ? animatedColor : isLabelHighlighted ? 'WHITE_T_87' : 'WHITE_T_60'}\n isAnimated={isAnimated}\n >\n {label}\n </Styled.AnimatedLabel>\n </Styled.ExtendedFlexView>\n <Styled.SegmentedCardWrapper ref={segmentedCardWrapperRef} onMouseLeave={onMouseLeave}>\n <Styled.CircularProgressLottieContainer ref={lottieAnimationRef} />\n {/* left segment */}\n <Styled.SegmentLeft onClick={() => onSegmentPress(0)}>\n <SegmentContent\n segmentType={'left'}\n card={data[0]!.card}\n name={data[0]!.name}\n isCompleted={data[0]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentLeft>\n\n {/* right segment */}\n <Styled.SegmentRight onClick={() => onSegmentPress(1)}>\n <SegmentContent\n segmentType={'right'}\n card={data[1]!.card}\n name={data[1]!.name}\n isCompleted={data[1]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentRight>\n\n {/* bottom segment */}\n <Styled.SegmentBottom onClick={() => onSegmentPress(2)}>\n <SegmentContent\n segmentType={'bottom'}\n card={data[2]!.card}\n name={data[2]!.name}\n isCompleted={data[2]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentBottom>\n </Styled.SegmentedCardWrapper>\n </Styled.SegmentedCard>\n );\n};\n\nexport const SegmentedGameCard = memo(forwardRef(SegmentedGameCardComponent));\n"],"names":["SegmentContent","segmentType","isCompleted","card","name","onMouseEnter","lottieAnimationRef","useRef","useEffect","animation","lottie","fetchLottie","Lottie","handleMouseEnter","useCallback","jsx","Styled.SegmentContainer","jsxs","Styled.SegmentContentContainer","Styled.SegmentAssetContainer","Styled.SegmentOverlay","Styled.IconWrapper","CheckIcon","SegmentedGameCardComponent","data","gameCategoryLabel","initialValue","value","maxValue","ref","labelRef","segmentedCardWrapperRef","label","setLabel","useState","isAnimated","setIsAnimated","animatedColor","setAnimatedColor","isLabelHighlighted","gameName","onMouseLeave","onSegmentPress","index","_b","_a","startLabelAnimation","color","useImperativeHandle","progressRingLottie","totalFrames","framesPerValue","initialFrameToPlay","finalFrameToPlay","Styled.SegmentedCard","Styled.ExtendedFlexView","Styled.AnimatedLabel","Styled.SegmentedCardWrapper","Styled.CircularProgressLottieContainer","Styled.SegmentLeft","Styled.SegmentRight","Styled.SegmentBottom","SegmentedGameCard","memo","forwardRef"],"mappings":";;;;;;;AAyBO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AACF,MAAM;AACE,QAAAC,IAAqBC,EAAuB,IAAI;AAEtD,EAAAC,EAAU,MAAM;AACd,QAAIC,IAAkC;AAc3B,YAZQ,YAAY;AACvB,YAAAC,IAAS,MAAMC,EAAYR,CAAI;AAErC,MAAAM,IAAYG,EAAO,cAAc;AAAA,QAC/B,WAAWN,EA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A1B,EAAC2C,GAAA,EAAuC,KAAKpD,EAAoB,CAAA;AAAA,MAEjE,gBAAAS,EAAC4C,GAAA,EAAmB,SAAS,MAAMjB,EAAe,CAAC,GACjD,UAAA,gBAAA3B;AAAA,QAACf;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,UACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,UACf,MAAMA,EAAK,CAAC,EAAG;AAAA,UACf,aAAaA,EAAK,CAAC,EAAG;AAAA,UACtB,cAAAnB;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,MAGA,gBAAAU,EAAC6C,GAAA,EAAoB,SAAS,MAAMlB,EAAe,CAAC,GAClD,UAAA,gBAAA3B;AAAA,QAACf;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,UACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,UACf,MAAMA,EAAK,CAAC,EAAG;AAAA,UACf,aAAaA,EAAK,CAAC,EAAG;AAAA,UACtB,cAAAnB;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,MAGA,gBAAAU,EAAC8C,GAAA,EAAqB,SAAS,MAAMnB,EAAe,CAAC,GACnD,UAAA,gBAAA3B;AAAA,QAACf;AAAA,QAAA;AAAA,UACC,aAAa;AAAA,UACb,MAAMwB,EAAK,CAAC,EAAG;AAAA,UACf,MAAMA,EAAK,CAAC,EAAG;AAAA,UACf,aAAaA,EAAK,CAAC,EAAG;AAAA,UACtB,cAAAnB;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEayD,KAAoBC,EAAKC,EAAWzC,CAA0B,CAAC;"}
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { useState as
|
2
|
-
import { useGetCircleHomeAPI as
|
3
|
-
import { ProjectType as
|
1
|
+
import { useState as E, useCallback as d, useEffect as p } from "react";
|
2
|
+
import { useGetCircleHomeAPI as C } from "../../api/get-content-for-today/get-circle-home-api.js";
|
3
|
+
import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
|
4
4
|
const O = (r, o, n) => {
|
5
|
-
const [
|
6
|
-
|
5
|
+
const [c, _] = E(null), { data: a, get: m, isProcessed: e, ...l } = C(), R = d(() => {
|
6
|
+
m("", {
|
7
7
|
user_id: r,
|
8
8
|
country_code: o,
|
9
9
|
grade: n
|
10
10
|
});
|
11
|
-
}, [
|
12
|
-
return
|
13
|
-
let
|
14
|
-
|
11
|
+
}, [m, r, o, n]);
|
12
|
+
return p(() => {
|
13
|
+
let s = null;
|
14
|
+
e && a && (s = {
|
15
15
|
points: a.points,
|
16
16
|
streakDays: a.streak_days,
|
17
17
|
streakStatus: a.streak_status,
|
@@ -19,7 +19,7 @@ const O = (r, o, n) => {
|
|
19
19
|
projects: {
|
20
20
|
games: {
|
21
21
|
label: a.projects.games.label,
|
22
|
-
type:
|
22
|
+
type: i.GAME,
|
23
23
|
initialProgressValue: 0,
|
24
24
|
data: a.projects.games.data.map((t) => ({
|
25
25
|
id: t.id,
|
@@ -32,7 +32,7 @@ const O = (r, o, n) => {
|
|
32
32
|
},
|
33
33
|
puzzles: {
|
34
34
|
label: a.projects.puzzles.label,
|
35
|
-
type:
|
35
|
+
type: i.PUZZLE,
|
36
36
|
initialProgressValue: 0,
|
37
37
|
data: a.projects.puzzles.data.map((t) => ({
|
38
38
|
id: t.id,
|
@@ -58,9 +58,9 @@ const O = (r, o, n) => {
|
|
58
58
|
CIRCLE_STREAK_UPDATE_JOURNEY: a.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
|
59
59
|
CIRCLE_TUTORIAL_JOURNEY: a.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY
|
60
60
|
}
|
61
|
-
}, a.projects.lessons && (
|
61
|
+
}, a.projects.lessons && (s.projects.lessons = {
|
62
62
|
label: a.projects.lessons.label,
|
63
|
-
type:
|
63
|
+
type: i.LESSON,
|
64
64
|
initialProgressValue: 0,
|
65
65
|
data: a.projects.lessons.data.map((t) => ({
|
66
66
|
id: t.id,
|
@@ -73,18 +73,8 @@ const O = (r, o, n) => {
|
|
73
73
|
targetQuestions: t.target_questions,
|
74
74
|
status: t.status
|
75
75
|
}))
|
76
|
-
}),
|
77
|
-
|
78
|
-
type: s.LESSON,
|
79
|
-
data: {
|
80
|
-
infiniteModeHighScore: a.projects.tables.data.infinite_mode_high_score,
|
81
|
-
tableList: a.projects.tables.data.table_wise_details.map((t) => ({
|
82
|
-
tableNumber: t.table_number,
|
83
|
-
stars: t.stars
|
84
|
-
}))
|
85
|
-
}
|
86
|
-
})), l(e);
|
87
|
-
}, [a, i]), { data: m, isProcessed: i, getCircleHomeDetails: d, ..._ };
|
76
|
+
})), _(s);
|
77
|
+
}, [a, e]), { data: c, isProcessed: e, getCircleHomeDetails: R, ...l };
|
88
78
|
};
|
89
79
|
export {
|
90
80
|
O as useGetCircleHomeDetailsDal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails, TStreakStatus } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n countryCode: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: () => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(() => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n }, [getHomeDetails, userId, countryCode, grade]);\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","countryCode","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson"],"mappings":";;;AAOO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC,EAAY,MAAM;AAC7C,IAAAL,EAAe,IAAI;AAAA,MACjB,SAASP;AAAA,MACT,cAAcC;AAAA,MACd,OAAAC;AAAA,IAAA,CACD;AAAA,KACA,CAACK,GAAgBP,GAAQC,GAAaC,CAAK,CAAC;AAE/C,SAAAW,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIN,KAAeF,MACGQ,IAAA;AAAA,MAClB,QAAQR,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,MACrB,UAAU;AAAA,QACR,OAAO;AAAA,UACL,OAAOA,EAAK,SAAS,MAAM;AAAA,UAC3B,MAAMS,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMT,EAAK,SAAS,MAAM,KAAK,IAAI,CAASU,OAAA;AAAA,YAC1C,IAAIA,EAAK;AAAA,YACT,MAAMA,EAAK;AA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BAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,KAIRd,EAAmBU,CAAiB;AAAA,EAAA,GACnC,CAACR,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import i from "styled-components";
|
2
|
-
import { GAME_LAUNCHER_SIZE as o } from "./comps/card
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
width: ${o + t}px;
|
2
|
+
import { GAME_LAUNCHER_SIZE as t, GAME_LAUNCHER_ASSET_PADDING as o } from "./comps/segmented-game-card/constants.js";
|
3
|
+
const r = i.div`
|
4
|
+
height: ${t + o}px;
|
5
|
+
width: ${t + o}px;
|
7
6
|
`;
|
8
7
|
export {
|
9
|
-
|
8
|
+
r as SleepyBoiLottyContainer
|
10
9
|
};
|
11
10
|
//# sourceMappingURL=game-launcher-styled.js.map
|