@edu-tosel/design 1.0.188 → 1.0.190

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 (48) hide show
  1. package/_test/interface/Property.d.ts +1 -1
  2. package/_test/interface/Property.js +1 -1
  3. package/layout/template/Books/SectionA.js +97 -86
  4. package/layout/template/Legacy/Table.js +2 -2
  5. package/layout/template/Transcript/Theme.d.ts +1 -0
  6. package/layout/template/Transcript/Theme.js +1 -0
  7. package/layout/template/Transcript/design/Transcript.d.ts +1 -1
  8. package/layout/template/Transcript/design/Transcript.design.d.ts +8 -7
  9. package/layout/template/Transcript/design/Transcript.design.js +21 -160
  10. package/layout/template/Transcript/design/TranscriptAdvanced.design.d.ts +5 -1
  11. package/layout/template/Transcript/design/TranscriptAdvanced.design.js +18 -5
  12. package/layout/template/Transcript/design/atom/CardTitle.d.ts +3 -1
  13. package/layout/template/Transcript/design/atom/CardTitle.js +5 -3
  14. package/layout/template/Transcript/design/atom/GetStyleFromLevel.d.ts +2 -0
  15. package/layout/template/Transcript/design/atom/GetStyleFromLevel.js +4 -0
  16. package/layout/template/Transcript/design/atom/LevelToStyleMap.d.ts +6 -0
  17. package/layout/template/Transcript/design/atom/LevelToStyleMap.js +37 -0
  18. package/layout/template/Transcript/design/molecule/BarGraph.d.ts +3 -1
  19. package/layout/template/Transcript/design/molecule/BarGraph.js +15 -5
  20. package/layout/template/Transcript/design/molecule/CircularGauge.d.ts +9 -0
  21. package/layout/template/Transcript/design/molecule/CircularGauge.js +50 -0
  22. package/layout/template/Transcript/design/molecule/LevelIndex.d.ts +3 -0
  23. package/layout/template/Transcript/design/molecule/LevelIndex.js +14 -0
  24. package/layout/template/Transcript/design/organism/BarCardCol.d.ts +6 -0
  25. package/layout/template/Transcript/design/organism/BarCardCol.js +24 -0
  26. package/layout/template/Transcript/design/organism/BarCardRow.d.ts +6 -0
  27. package/layout/template/Transcript/design/organism/BarCardRow.js +24 -0
  28. package/layout/template/Transcript/design/organism/HonorCard.d.ts +4 -0
  29. package/layout/template/Transcript/design/organism/HonorCard.js +21 -0
  30. package/layout/template/Transcript/design/organism/IdCard.d.ts +4 -0
  31. package/layout/template/Transcript/design/organism/IdCard.js +57 -0
  32. package/layout/template/Transcript/design/{Organism/BarCardRow.d.ts → organism/PerformanceCard.d.ts} +2 -1
  33. package/layout/template/Transcript/design/organism/PerformanceCard.js +25 -0
  34. package/layout/template/Transcript/design/organism/ResultGaugeCard.d.ts +6 -0
  35. package/layout/template/Transcript/design/organism/ResultGaugeCard.js +19 -0
  36. package/layout/template/Transcript/design/{Organism/BarCardCol.d.ts → organism/ScoreCard.d.ts} +1 -1
  37. package/layout/template/Transcript/design/organism/ScoreCard.js +11 -0
  38. package/layout/template/Transcript/index.d.ts +3 -0
  39. package/layout/template/Transcript/index.js +2 -0
  40. package/layout/template/home/layout/Footer.js +4 -3
  41. package/package.json +1 -1
  42. package/version.txt +1 -1
  43. package/layout/template/Transcript/design/Organism/BarCardCol.js +0 -30
  44. package/layout/template/Transcript/design/Organism/BarCardRow.js +0 -30
  45. package/layout/template/Transcript/design/atom/IdCard.d.ts +0 -12
  46. package/layout/template/Transcript/design/atom/IdCard.js +0 -74
  47. package/layout/template/Transcript/design/atom/ScriptStyle.d.ts +0 -0
  48. package/layout/template/Transcript/design/atom/ScriptStyle.js +0 -1
@@ -1,3 +1,3 @@
1
1
  export type Status = "waiting" | "doing" | "done";
2
- export type Level = "" | "CC" | "PS" | "ST" | "BA" | "JR" | "HJ" | "AD";
2
+ export type Level = "" | "CO" | "PS" | "ST" | "BA" | "JR" | "HJ" | "AD";
3
3
  export declare const LevelString: Record<Level, string>;
@@ -1,6 +1,6 @@
1
1
  export const LevelString = {
2
2
  "": "None",
3
- CC: "CoCoon",
3
+ CO: "CoCoon",
4
4
  PS: "Pre-Starter",
5
5
  ST: "Starter",
6
6
  BA: "Basic",
@@ -5,7 +5,70 @@ import ScrollTrigger from "gsap/ScrollTrigger";
5
5
  import { cn } from "../../../util";
6
6
  import { useResponsive } from "../../../hook";
7
7
  gsap.registerPlugin(ScrollTrigger);
8
+ const bookData = [
9
+ {
10
+ id: 1,
11
+ type: "학습 시리즈",
12
+ title: "Reading Series",
13
+ imgSrc: "https://resource.tosel.co.kr/images/book_mockup_RD_HJ1.png",
14
+ description: "Reading 학습을 위한 토셀의 학습 시리즈입니다. 독해 & 실용문 연습을 위한 지문과 Comprehension 문항이 수록되어, 이해도 확인 및 정확한 진단이 가능합니다. 숙지한 독해 지문을 원어민 음성으로 들으며 리딩을 위한 완벽한 학습 커리큘럼을 마련해보세요.",
15
+ levelLow: "PS",
16
+ levelHigh: "HJ",
17
+ link: "",
18
+ },
19
+ {
20
+ id: 2,
21
+ type: "학습 시리즈",
22
+ title: "Story Series",
23
+ imgSrc: "https://resource.tosel.co.kr/images/book_mockup_RD_BA2.png",
24
+ description: "이야기 지문과 단어를 함께 연결지어 학생들의 독해 능력을 평가dfsdfsdf",
25
+ levelLow: "PS",
26
+ levelHigh: "JR",
27
+ link: "",
28
+ },
29
+ {
30
+ id: 3,
31
+ type: "학습 시리즈",
32
+ title: "Listening Series",
33
+ imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
34
+ description: "어쩌",
35
+ levelLow: "PS",
36
+ levelHigh: "HJ",
37
+ link: "",
38
+ },
39
+ {
40
+ id: 4,
41
+ type: "학습 시리즈",
42
+ title: "Reading Series",
43
+ imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
44
+ description: "어쩌",
45
+ levelLow: "PS",
46
+ levelHigh: "HJ",
47
+ link: "",
48
+ },
49
+ {
50
+ id: 5,
51
+ type: "학습 시리즈",
52
+ title: "Grammar Series",
53
+ imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
54
+ description: "어쩌",
55
+ levelLow: "PS",
56
+ levelHigh: "HJ",
57
+ link: "",
58
+ },
59
+ {
60
+ id: 6,
61
+ type: "학습 시리즈",
62
+ title: "VOCA Series",
63
+ imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
64
+ description: "어쩌",
65
+ levelLow: "PS",
66
+ levelHigh: "HJ",
67
+ link: "",
68
+ },
69
+ ];
8
70
  let divIndex = 0;
71
+ const bookNumber = bookData.length;
9
72
  export default function SectionA() {
10
73
  const stickyRef = useRef(null);
11
74
  const bookRef = useRef(null);
@@ -16,17 +79,15 @@ export default function SectionA() {
16
79
  const bookScrollRef = useRef(null);
17
80
  const refs = useRef([]);
18
81
  const isMD = useResponsive("md");
19
- const cardHeight = isMD ? 560 : 400;
82
+ const isXM = useResponsive("xm");
83
+ const cardHeight = isXM ? 560 : 400;
20
84
  console.log(isMD);
21
85
  console.log(cardHeight);
22
- const handleScroll = (direction) => {
86
+ const bookScroller = () => {
23
87
  if (bookScrollRef.current) {
24
88
  const scrollAmount = cardHeight;
25
89
  const currentScrollTop = bookScrollRef.current.scrollTop;
26
- console.log(`direction: ${direction}`);
27
- const newScrollTop = direction === "up"
28
- ? Math.max(currentScrollTop - scrollAmount, 0)
29
- : currentScrollTop + scrollAmount;
90
+ const newScrollTop = scrollAmount * divIndex;
30
91
  bookScrollRef.current.scrollTo({
31
92
  top: newScrollTop,
32
93
  behavior: "smooth",
@@ -39,7 +100,7 @@ export default function SectionA() {
39
100
  const scrollWrapper = stickyRef.current;
40
101
  const bookWrapper = bookRef.current;
41
102
  const sectionEndPoint = `${50 * vh}px`;
42
- const bookScrollEndPoint = `${1000 * vh}px`;
103
+ const bookScrollEndPoint = `${((bookNumber + 1) * 100 + 40) * vh}px`;
43
104
  if (scrollWrapper && bookWrapper) {
44
105
  // 첫 번째 ScrollTrigger: stickyRef를 고정하고 mainTitle의 투명도와 크기 조정
45
106
  const scrollTrigger = ScrollTrigger.create({
@@ -95,21 +156,24 @@ export default function SectionA() {
95
156
  gsap.to(ref, {
96
157
  scrollTrigger: {
97
158
  trigger: ref,
98
- start: "top top",
99
- end: "bottom top",
159
+ start: "start bottom",
160
+ end: "bottom bottom",
100
161
  snap: {
101
162
  snapTo: 1,
102
163
  duration: 0.5,
103
164
  ease: "power3.inOut",
104
165
  },
166
+ markers: false,
105
167
  onEnter: () => {
106
168
  divIndex++;
107
- handleScroll("down");
169
+ //handleScroll("down");
170
+ bookScroller();
108
171
  console.log(`onEnter: ${divIndex}`);
109
172
  },
110
173
  onLeaveBack: () => {
111
174
  divIndex--;
112
- handleScroll("up");
175
+ //handleScroll("up");
176
+ bookScroller();
113
177
  console.log(`onLeaveBack: ${divIndex}`);
114
178
  },
115
179
  },
@@ -121,7 +185,7 @@ export default function SectionA() {
121
185
  const bookTrigger = ScrollTrigger.create({
122
186
  trigger: bookWrapper,
123
187
  start: "top top",
124
- end: `${bookScrollEndPoint} top`,
188
+ end: `${bookScrollEndPoint} bottom`,
125
189
  pin: true,
126
190
  pinSpacing: false,
127
191
  markers: true,
@@ -133,7 +197,7 @@ export default function SectionA() {
133
197
  }
134
198
  });
135
199
  return () => ctx.kill();
136
- }, [handleScroll]);
200
+ }, [bookScroller, useResponsive]);
137
201
  const container = {
138
202
  sizes: "w-full h-fit relative",
139
203
  displays: "flex flex-col justify-start items-center",
@@ -176,16 +240,20 @@ export default function SectionA() {
176
240
  };
177
241
  const bookExplainWrapper = {
178
242
  displays: "flex flex-col md:flex-row justify-center items-center",
179
- sizes: "h-screen w-full",
243
+ sizes: "h-screen w-full max-w-[1200px]",
244
+ };
245
+ const bookTextWrapper = {
246
+ displays: "flex items-end md:items-start",
247
+ sizes: "h-full xm:max-h-140 max-h-100 w-full shrink",
248
+ textStyling: "font-bold text-2xl pl-0 md:pl-[76px]",
180
249
  };
181
- const bookTitle = {
182
- displays: "flex flex-col justify-end items-center",
183
- sizes: "h-full w-full pb-5",
184
- textStyling: "font-bold text-2xl",
250
+ const bookTextBox = {
251
+ displays: "flex flex-col justify-end items-center md:justify-start md:items-start",
252
+ sizes: "w-full h-fit rounded-lg p-5",
185
253
  };
186
254
  return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(absoluteWrapperBottom, "bg-gradient-to-tr from-crimson-burgundy to-green-dark"), ref: bgRef }), _jsx("div", { className: cn(absoluteWrapperTop), children: _jsxs("div", { className: cn(buttonStyling), ref: buttonRef, onClick: () => {
187
255
  window.location.href = "https://smartstore.naver.com/tosel";
188
- }, children: [_jsx("div", { children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "size-6", children: _jsx("path", { d: "M2.25 2.25a.75.75 0 0 0 0 1.5h1.386c.17 0 .318.114.362.278l2.558 9.592a3.752 3.752 0 0 0-2.806 3.63c0 .414.336.75.75.75h15.75a.75.75 0 0 0 0-1.5H5.378A2.25 2.25 0 0 1 7.5 15h11.218a.75.75 0 0 0 .674-.421 60.358 60.358 0 0 0 2.96-7.228.75.75 0 0 0-.525-.965A60.864 60.864 0 0 0 5.68 4.509l-.232-.867A1.875 1.875 0 0 0 3.636 2.25H2.25ZM3.75 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM16.5 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z" }) }) }), "\uAD50\uC7AC\uBAB0 \uBC14\uB85C\uAC00\uAE30"] }) }), _jsxs("div", { className: cn(TitleWrapper), ref: stickyRef, children: [_jsx("div", { className: cn(miniTitle), ref: subTitleRef, children: "\uB2F9\uC2E0\uC774 \uBBFF\uC744 \uC218 \uC788\uB294 \uC601\uC5B4\uAD50\uC7AC" }), _jsxs("div", { className: cn(mainTitle), ref: mainTitleRef, children: [_jsx("div", { className: "flex justify-center items-center w-40 md:w-80 ml:w-120", children: _jsx("img", { src: "https://resource.tosel.co.kr/images/img-logo-tosel-darkmode.svg", alt: "", className: "max-w-full h-auto" }) }), _jsx("div", { className: "h-full w-0.5 bg-white" }), _jsx("div", { children: " books " })] })] }), _jsx("div", { className: cn(bookWrapper), ref: bookRef, children: _jsx("div", { className: cn("w-72 h-100 md:w-100 md:h-140 bg-white z-10 rounded-2xl shadow-main overflow-y-scroll scrollbar-hidden snap-y snap-mandatory"), ref: bookScrollRef, children: _jsx(ScrollBookComponent, {}) }) }), bookData.map((item, index) => {
256
+ }, children: [_jsx("div", { children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "size-6", children: _jsx("path", { d: "M2.25 2.25a.75.75 0 0 0 0 1.5h1.386c.17 0 .318.114.362.278l2.558 9.592a3.752 3.752 0 0 0-2.806 3.63c0 .414.336.75.75.75h15.75a.75.75 0 0 0 0-1.5H5.378A2.25 2.25 0 0 1 7.5 15h11.218a.75.75 0 0 0 .674-.421 60.358 60.358 0 0 0 2.96-7.228.75.75 0 0 0-.525-.965A60.864 60.864 0 0 0 5.68 4.509l-.232-.867A1.875 1.875 0 0 0 3.636 2.25H2.25ZM3.75 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM16.5 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z" }) }) }), "\uAD50\uC7AC\uBAB0 \uBC14\uB85C\uAC00\uAE30"] }) }), _jsxs("div", { className: cn(TitleWrapper), ref: stickyRef, children: [_jsx("div", { className: cn(miniTitle), ref: subTitleRef, children: "\uB2F9\uC2E0\uC774 \uBBFF\uC744 \uC218 \uC788\uB294 \uC601\uC5B4\uAD50\uC7AC" }), _jsxs("div", { className: cn(mainTitle), ref: mainTitleRef, children: [_jsx("div", { className: "flex justify-center items-center w-40 md:w-80 ml:w-120", children: _jsx("img", { src: "https://resource.tosel.co.kr/images/img-logo-tosel-darkmode.svg", alt: "", className: "max-w-full h-auto" }) }), _jsx("div", { className: "h-full w-0.5 bg-white" }), _jsx("div", { children: " books " })] })] }), _jsx("div", { className: cn(bookWrapper), ref: bookRef, children: _jsx("div", { className: cn("w-72 h-100 xm:w-100 xm:h-140 bg-white backdrop-blur-md z-10 rounded-xl shadow-main overflow-y-scroll scrollbar-hidden snap-y snap-mandatory"), ref: bookScrollRef, children: _jsx(ScrollBookComponent, {}) }) }), bookData.map((item, index) => {
189
257
  // item.levelLow 값을 LevelKey로 변환하기 전에 유효성 검사
190
258
  const lowLevelStyle = getLevelStyle(item.levelLow); // 안전하게 캐스팅
191
259
  const highLevelStyle = getLevelStyle(item.levelHigh); // 이 부분도 마찬가지로
@@ -193,71 +261,11 @@ export default function SectionA() {
193
261
  if (el) {
194
262
  refs.current[index] = el;
195
263
  }
196
- }, children: [_jsxs("div", { className: cn(bookTitle), children: [_jsx("div", { children: item.title }), _jsx("div", { className: "text-base text-gray-medium", children: item.type })] }), _jsx("div", { className: "h-100 w-full shrink-0" }), _jsxs("div", { className: "h-full w-full pt-5 flex flex-col justify-start items-center", children: [_jsxs("div", { className: "w-fit h-fit flex flex-row gap-2", children: [_jsx("div", { className: `w-fit h-fit px-2 py-1 text-sm rounded-md font-bold ${lowLevelStyle.textColor} ${lowLevelStyle.bgColor}`, children: lowLevelStyle.name }), "~", _jsx("div", { className: `w-fit h-fit px-2 py-1 text-sm rounded-md font-bold ${highLevelStyle.textColor} ${highLevelStyle.bgColor}`, children: highLevelStyle.name })] }), isMD && (_jsx("div", { className: "text-center font-medium text-sm", children: item.description }))] })] }, item.id));
264
+ }, children: [_jsx("div", { className: cn(bookTextWrapper), children: _jsxs("div", { className: cn(bookTextBox, item.type == "학습 시리즈"
265
+ ? "md:bg-blue-pastel/30"
266
+ : "md:bg-green-light"), children: [_jsx("div", { children: item.title }), _jsx("div", { className: "text-base text-gray-medium", children: item.type }), isMD && (_jsxs("div", { className: "w-fit h-fit flex flex-col lg:flex-row gap-2 mt-5 lg:items-center items-start", children: [_jsx("div", { className: `w-fit h-fit px-2 py-1 text-xs xm:text-sm rounded-md font-bold ${lowLevelStyle.textColor} ${lowLevelStyle.bgColor}`, children: lowLevelStyle.name }), _jsxs("div", { className: "flex flex-row gap-2 items-center lg:m-0 ml-5", children: ["~", _jsx("div", { className: `w-fit h-fit px-2 py-1 text-xs xm:text-sm rounded-md font-bold ${highLevelStyle.textColor} ${highLevelStyle.bgColor}`, children: highLevelStyle.name })] })] }))] }) }), isMD ? (_jsx("div", { className: "h-full w-72 xm:w-120 shrink-0" })) : (_jsx("div", { className: "h-100 w-full shrink-0" })), _jsx("div", { className: "h-full w-full pt-5 flex flex-col justify-start md:justify-center items-center md:items-end md:pr-5 pr-0", children: isMD ? (_jsx("div", { className: "text-base text-gray-dark font-medium mt-5 w-full", children: item.description })) : (_jsxs("div", { className: "w-fit h-fit flex flex-row gap-2", children: [_jsx("div", { className: `w-fit h-fit px-2 py-1 text-sm rounded-md font-bold ${lowLevelStyle.textColor} ${lowLevelStyle.bgColor}`, children: lowLevelStyle.name }), "~", _jsx("div", { className: `w-fit h-fit px-2 py-1 text-sm rounded-md font-bold ${highLevelStyle.textColor} ${highLevelStyle.bgColor}`, children: highLevelStyle.name })] })) })] }, item.id));
197
267
  })] }));
198
268
  }
199
- const bookData = [
200
- {
201
- id: 1,
202
- type: "학습 시리즈",
203
- title: "Speaking Series",
204
- imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
205
- description: "어쩌",
206
- levelLow: "PS",
207
- levelHigh: "HJ",
208
- link: "",
209
- },
210
- {
211
- id: 2,
212
- type: "학습 시리즈",
213
- title: "Story Series",
214
- imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
215
- description: "어쩌",
216
- levelLow: "PS",
217
- levelHigh: "JR",
218
- link: "",
219
- },
220
- {
221
- id: 3,
222
- type: "학습 시리즈",
223
- title: "Listening Series",
224
- imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
225
- description: "어쩌",
226
- levelLow: "PS",
227
- levelHigh: "HJ",
228
- link: "",
229
- },
230
- {
231
- id: 4,
232
- type: "학습 시리즈",
233
- title: "Reading Series",
234
- imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
235
- description: "어쩌",
236
- levelLow: "PS",
237
- levelHigh: "HJ",
238
- link: "",
239
- },
240
- {
241
- id: 5,
242
- type: "학습 시리즈",
243
- title: "Grammar Series",
244
- imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
245
- description: "어쩌",
246
- levelLow: "PS",
247
- levelHigh: "HJ",
248
- link: "",
249
- },
250
- {
251
- id: 6,
252
- type: "학습 시리즈",
253
- title: "VOCA Series",
254
- imgSrc: "https://resource.tosel.co.kr/images/SP-COVER-PS.png",
255
- description: "어쩌",
256
- levelLow: "PS",
257
- levelHigh: "HJ",
258
- link: "",
259
- },
260
- ];
261
269
  const levelStyles = {
262
270
  CO: {
263
271
  name: "cocoon",
@@ -302,12 +310,15 @@ export function ScrollBookComponent() {
302
310
  const container = {
303
311
  sizes: "w-full h-fit relative",
304
312
  displyas: "flex flex-col",
305
- backgrounds: "bg-white",
313
+ backgrounds: "",
306
314
  };
307
315
  const imageWrapper = {
308
- sizes: "w-72 h-100 md:w-100 md:h-140",
309
- imgStyling: "bg-contain bg-no-repeat bg-center",
316
+ display: "relative",
317
+ sizes: "w-72 h-100 xm:w-100 xm:h-140",
318
+ imgStyling: " z-10 p-20",
310
319
  scrollActions: "snap-start",
311
320
  };
312
- return (_jsx("div", { className: cn(container), children: bookData.map((item) => (_jsx("div", {}, item.id))) }));
321
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(imageWrapper), children: _jsx("div", { className: "absolute top-0 left-0 w-full h-full bg-contain bg-no-repeat bg-center", style: {
322
+ backgroundImage: `url(https://resource.tosel.co.kr/images/SP-COVER-PS.png)`,
323
+ } }) }), bookData.map((item) => (_jsx("div", { className: cn(imageWrapper), children: _jsx("div", { className: "absolute top-12 left-12 w-[calc(100%-96px)] h-[calc(100%-96px)] bg-contain bg-no-repeat bg-center", style: { backgroundImage: `url(${item.imgSrc})` } }) }, item.id)))] }));
313
324
  }
@@ -119,7 +119,7 @@ const LevelConvert = {
119
119
  4: "BA",
120
120
  3: "JR",
121
121
  6: "HJ",
122
- 11: "CC",
122
+ 11: "CO",
123
123
  };
124
124
  const TextColorConvert = {
125
125
  PS: "text-ps-pink",
@@ -128,7 +128,7 @@ const TextColorConvert = {
128
128
  JR: "text-jr-blue",
129
129
  HJ: "text-hj-blue",
130
130
  AD: "text-gray-dark",
131
- CC: "text-gray-dark",
131
+ CO: "text-gray-dark",
132
132
  IN: "text-gray-dark",
133
133
  };
134
134
  function Row({ examName, examDate, reports, groupReport }) {
@@ -0,0 +1 @@
1
+ export type Theme = "green" | "red";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- type Level = "CC" | "PS" | "ST" | "BA" | "JR" | "HJ" | "AD";
1
+ type Level = "CO" | "PS" | "ST" | "BA" | "JR" | "HJ" | "AD";
2
2
  type ExamType = "REG" | "IST" | "CMP";
3
3
  export interface TranscriptProps {
4
4
  info: {
@@ -1,12 +1,13 @@
1
1
  import { TranscriptProps } from "./Transcript";
2
- import { Level as NarrowLevel } from "../../../../_test/interface";
3
- type Level = Exclude<NarrowLevel, ""> | "CC";
2
+ export declare const EXAM_TYPE: {
3
+ readonly REG: "REG";
4
+ readonly CMP: "CMP";
5
+ readonly IST: "IST";
6
+ readonly OLY: "OLY";
7
+ };
8
+ export type EXAM_TYPE = (typeof EXAM_TYPE)[keyof typeof EXAM_TYPE];
9
+ export declare function getStringfromType(ExamType: EXAM_TYPE): string;
4
10
  declare const _default: import("react").ForwardRefExoticComponent<{
5
11
  props: TranscriptProps;
6
12
  } & import("react").RefAttributes<HTMLDivElement>>;
7
13
  export default _default;
8
- export declare const LevelToStyleMap: Record<Level, {
9
- name: string;
10
- bgcolor: string;
11
- textcolor: string;
12
- }>;
@@ -1,14 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { paperSize } from "../../../../style/size";
4
- import { LineBreaks } from "../../../../text";
5
4
  import { cn } from "../../../../util";
6
- import SVG from "../../../../asset/SVG";
7
- import { useResponsive } from "../../../../hook";
8
- import { ResponsiveContainer, PieChart, Pie, Cell, } from "recharts";
9
- import IdCard, { getStringfromType } from "./atom/IdCard";
10
- import { printBoxStyles } from "./atom/PrintBoxStyles";
11
- import { BarCardRow } from "./Organism/BarCardRow";
5
+ import IdCard from "./organism/IdCard";
6
+ import { BarCardRow } from "./organism/BarCardRow";
7
+ import ScoreCard from "./organism/ScoreCard";
8
+ import HonorCard from "./organism/HonorCard";
9
+ import ResultGaugeCard from "./organism/ResultGaugeCard";
10
+ import PerformanceCard from "./organism/PerformanceCard";
11
+ export const EXAM_TYPE = {
12
+ REG: "REG",
13
+ CMP: "CMP",
14
+ IST: "IST",
15
+ OLY: "OLY",
16
+ };
17
+ const examTypeMap = {
18
+ REG: "정기시험",
19
+ IST: "기관시험",
20
+ CMP: "경시대회",
21
+ };
22
+ export function getStringfromType(ExamType) {
23
+ return examTypeMap[ExamType] || "Unknown";
24
+ }
12
25
  function TranscriptDesign({ props }, ref) {
13
26
  const { info, result, data } = props;
14
27
  const container = {
@@ -23,158 +36,6 @@ function TranscriptDesign({ props }, ref) {
23
36
  spacings: "px-5 py-2",
24
37
  backgrounds: "bg-gradient-to-r from-crimson-burgundy to-green-dark",
25
38
  };
26
- return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "images/logos/logo-tosel-white.svg", alt: "", className: "h-10" }), _jsxs("div", { className: "text-white font-bold text-base", children: [getStringfromType(info.examType), " \uC131\uC801\uD45C"] })] }), _jsx(IdCard, { info: info }), _jsxs("div", { className: "flex flex-col gap-5 xs:flex-row mt-5 items-stretch", children: [_jsx(ResultCard, { result: result }), _jsx(HonorCard, { result: result })] }), _jsx(PerformanceCard, { data: data, info: info }), _jsx(ScoreCard, { data: data }), _jsx(BarCardRow, { data: data })] }));
39
+ return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "images/logos/logo-tosel-white.svg", alt: "", className: "h-10" }), _jsxs("div", { className: "text-white font-bold text-base", children: [getStringfromType(info.examType), " \uC131\uC801\uD45C"] })] }), _jsx(IdCard, { info: info }), _jsxs("div", { className: "flex flex-col gap-5 xs:flex-row mt-5 items-stretch", children: [_jsx(ResultGaugeCard, { result: result, theme: "green" }), _jsx(HonorCard, { result: result })] }), _jsx(PerformanceCard, { data: data, info: info }), _jsx(ScoreCard, { data: data }), _jsx(BarCardRow, { data: data, theme: "green" })] }));
27
40
  }
28
41
  export default forwardRef(TranscriptDesign);
29
- function ResultCard({ result }) {
30
- const cardWrapper = {
31
- displays: "flex flex-col self-auto flex-[2] md:flex-[1] overflow-hidden",
32
- sizes: "w-full h-fit rounded-lg",
33
- backgrounds: "bg-white shadow-main",
34
- // animations: "duration-300 hover:scale-105 hover:shadow-green",
35
- };
36
- const cardTitle = {
37
- display: "flex flex-row justify-center items-center",
38
- sizes: "h-7 w-full",
39
- bg: "bg-green-dark",
40
- textStyles: "text-white font-medium text-sm",
41
- };
42
- return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsxs("div", { className: cn(cardTitle), children: [_jsx("div", { className: "w-full text-center h-full flex justify-center items-center", children: "\uCDE8\uB4DD \uC810\uC218" }), _jsx("div", { className: "w-0.5 h-7 bg-white" }), _jsx("div", { className: "w-full text-center h-full flex justify-center items-center", children: "\uC778\uC99D \uB4F1\uAE09" })] }), _jsxs("div", { className: "flex flex-row gap-10 p-5", children: [_jsx(CircularGauge, { score: result.score, maxScore: 100, isGrade: false }), _jsx(CircularGauge, { score: result.grade, maxScore: 9, isGrade: true })] })] }));
43
- }
44
- const CircularGauge = ({ score, maxScore, isGrade }) => {
45
- const pieStyles = {
46
- cx: "50%",
47
- cy: "50%",
48
- innerRadius: "70%",
49
- outerRadius: "90%",
50
- cornerRadius: 6,
51
- dataKey: "value",
52
- nameKey: "name",
53
- };
54
- const cellStyles = {
55
- stroke: "rgba(255, 255, 255, 0)",
56
- };
57
- const scoreText = {
58
- displays: "absolute flex justify-center items-center",
59
- positions: "top-0 left-0",
60
- sizes: "w-full h-full",
61
- textStyles: "font-bold text-gray-medium text-2xl",
62
- printOptions: "print:text-gray-dark",
63
- };
64
- const preparePieChartData = () => {
65
- const mainScore = score;
66
- const remainingScore = maxScore - mainScore;
67
- if (isGrade) {
68
- return [
69
- { name: "Score", value: remainingScore - 1 },
70
- { name: "Grade", value: mainScore - 1 },
71
- ];
72
- }
73
- else {
74
- return [
75
- { name: "Score", value: mainScore },
76
- { name: "Remaining", value: remainingScore },
77
- ];
78
- }
79
- };
80
- return (_jsxs("div", { className: "w-full aspect-ratio-1/1 flex items-center justify-center relative", children: [_jsx("div", { className: "absolute top-0 left-0 w-full aspect-ratio-1/1", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", aspect: 1, children: _jsx(PieChart, { children: _jsx(Pie, { data: [{ name: "Background", value: 100 }], cx: "50%", cy: "50%", innerRadius: "70%", outerRadius: "90%", fill: "rgba(128, 128, 128, 0.2)" // 회색 배경 색상
81
- , dataKey: "value", stroke: "rgb(255,255,255,0)", animationDuration: 0 }) }) }) }), _jsx("div", { className: "absolute top-0 left-0 w-full aspect-ratio-1/1 opacity-0 print:opacity-100", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", aspect: 1, children: _jsx(PieChart, { children: _jsxs(Pie, { data: preparePieChartData(), ...pieStyles, animationDuration: 0, children: [_jsx(Cell, { fill: "#105652", ...cellStyles, style: {
82
- filter: "drop-shadow(0px 3px 5px rgba(16, 86, 82, 0.38))",
83
- } }), _jsx(Cell, { fill: "rgba(255, 255, 255, 0)", ...cellStyles })] }) }) }) }), _jsx(ResponsiveContainer, { width: "100%", height: "100%", aspect: 1, children: _jsx(PieChart, { children: _jsxs(Pie, { data: preparePieChartData(), ...pieStyles, children: [_jsx(Cell, { fill: "#105652", ...cellStyles, style: {
84
- filter: "drop-shadow(0px 3px 5px rgba(16, 86, 82, 0.38))",
85
- } }), _jsx(Cell, { fill: "rgba(255, 255, 255, 0)", ...cellStyles })] }) }) }), _jsx("div", { className: cn(scoreText), children: score })] }));
86
- };
87
- function HonorCard({ result }) {
88
- const cardWrapper = {
89
- displays: "flex flex-col self-stretch flex-[1] relative",
90
- sizes: "w-full rounded-lg overflow-hidden",
91
- backgrounds: "bg-white shadow-main",
92
- animations: "duration-300 hover:scale-105 hover:shadow-green",
93
- };
94
- const cardTitle = {
95
- display: "flex flex-row justify-center items-center",
96
- sizes: "h-7 shrink-0 w-full",
97
- bg: "bg-green-light",
98
- textStyles: "text-green-dark font-medium text-sm",
99
- };
100
- return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), onClick: () => (window.location.href = `https://www.tosel.org/HallofFame/main`), children: [_jsx("div", { className: cn(cardTitle), children: _jsx("div", { className: "w-full text-center h-fit", children: "\uBA85\uC608\uC758 \uC804\uB2F9" }) }), _jsxs("div", { className: "w-full h-full flex flex-row px-5 gap-x-5", children: [_jsxs("div", { className: "flex flex-[1] flex-col w-full justify-center items-center xs:hidden md:flex", children: [_jsx("div", { className: "text-gray-dark font-bold text-xl", children: "\uBA85\uC608\uC758 \uC804\uB2F9" }), _jsx("div", { className: "text-gray-medium font-medium text-sm", children: "Hall of Fame" })] }), _jsx("div", { className: "flex w-full flex-[1] py-4 xs:py-0", children: _jsx(SVG.HallofFame, { isHonor: result.isHonor }) })] }), _jsx("div", { className: "pb-3 px-5 text-center text-xs", children: result.isHonor
101
- ? "축하합니다! 명예의 전당에 등재되었습니다"
102
- : "아쉽게도 명예의 전당에 오르지 못했습니다." })] }));
103
- }
104
- function PerformanceCard({ data, info, }) {
105
- const cardWrapper = {
106
- displays: "flex flex-col relative",
107
- sizes: "w-full rounded-lg overflow-hidden",
108
- backgrounds: "bg-white shadow-main",
109
- sapcings: "mt-5",
110
- };
111
- const cardTitle = {
112
- display: "flex flex-row justify-center items-center",
113
- sizes: "h-7 shrink-0 w-full",
114
- bg: "bg-green-light",
115
- textStyles: "text-green-dark font-medium text-sm",
116
- };
117
- const scriptStyling = {
118
- display: "justify-start items-start",
119
- sizes: "w-full h-fit",
120
- textStyles: "text-xs font-medium text-black break-keep",
121
- };
122
- return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsx("div", { className: cn(cardTitle), children: _jsx("div", { className: "w-full text-center h-fit", children: "Performance Evaluation" }) }), _jsxs("div", { className: "w-full h-full flex flex-col gap-5 p-5", children: [_jsxs("div", { className: "flex flex-col flex-[3]", children: [_jsx(LineBreaks, { texts: data.script.performanceEvaluation, className: cn(scriptStyling) }), _jsx("div", { className: cn(scriptStyling, "text-green-dark"), children: "\uB098\uC758 \uC804\uAD6D \uC9C0\uD45C\uAC00 \uAD81\uAE08\uD558\uB2E4\uBA74? QR\uB85C \uC790\uC138\uD788 \uC54C\uC544\uBCF4\uC138\uC694!" })] }), _jsx("div", { className: "w-full flex flex-col flex-[2] justify-center items-center", children: _jsx(LevelRow, { transcriptLevel: info.level }) })] })] }));
123
- }
124
- function LevelRow({ transcriptLevel }) {
125
- const levels = ["CC", "PS", "ST", "BA", "JR", "HJ", "AD"];
126
- const isSM = useResponsive("sm");
127
- return (_jsx("div", { className: "flex flex-row w-full h-fit justify-center items-center", children: levels.map((level) => {
128
- const { name, bgcolor, textcolor } = LevelToStyleMap[level];
129
- const isHighlighted = level === transcriptLevel;
130
- return (_jsx("div", { className: `px-2 py-1 text-xs text-center font-medium $ ${isHighlighted
131
- ? "bg-green-dark text-white w-fit shrink-0 rounded-md"
132
- : "w-full text-green-dark/70"}`, children: isSM ? name : isHighlighted ? name : level }, level));
133
- }) }));
134
- }
135
- function ScoreCard({ data }) {
136
- const cellAnimation = {
137
- animations: "hover:bg-green-light/50 hover:text-green-dark duration-300",
138
- };
139
- return (_jsx("div", { className: "overflow-auto w-full scrollbar-hidden rounded-lg mt-5 print:border print:border-gray-medium/70 cursor-default shadow-main print:shadow-none", children: _jsxs("div", { className: "min-w-[172mm] w-full", children: [_jsxs("div", { className: "flex bg-gradient-to-r from-green-dark to-crimson-burgundy text-white font-medium text-sm", children: [_jsx("div", { className: "text-center print:static sticky left-0 bg-green-dark p-2 flex-[3] font-black", children: "\uC131\uC801\uD45C" }), _jsx("div", { className: "p-2 flex-[2] text-center", children: "\uCD1D\uC810" }), _jsx("div", { className: "p-2 flex-[2] text-center", children: "\uB0B4 \uC810\uC218" }), _jsx("div", { className: "p-2 flex-[3] text-center", children: "\uC804\uAD6D\uD3C9\uADE0" }), _jsx("div", { className: "p-2 flex-[3] text-center", children: "\uC9C0\uC5ED\uD3C9\uADE0" }), _jsx("div", { className: "p-2 flex-[3] text-center", children: "\uB3D9\uC77C\uD559\uB144" }), _jsx("div", { className: "p-2 flex-[3] text-center", children: "10% \uD3C9\uADE0" }), _jsx("div", { className: "p-2 flex-[3] text-center", children: "30% \uD3C9\uADE0" })] }), _jsxs("div", { className: "flex bg-white/60 font-medium text-sm text-gray-medium ", children: [_jsx("div", { className: "sticky left-0 bg-white/90 p-2 flex-[3] text-center text-gray-dark border-green-dark border-r-1", children: "Section1" }), _jsx("div", { className: cn("p-2 flex-[2] text-center", cellAnimation), children: data.analysis.total.section1.toFixed(1) }), _jsx("div", { className: "p-2 flex-[2] text-center text-green-dark font-bold bg-green-light", children: data.analysis.user.section1.toFixed(1) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: data.analysis.nationalAverage.section1.toFixed(2) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: data.analysis.localAverage.section1.toFixed(2) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: data.analysis.ageAverage.section1.toFixed(2) }), _jsx("div", { className: "p-2 flex-[3] text-center border-green-dark border-l-1" }), _jsx("div", { className: "p-2 flex-[3] text-center" })] }), _jsxs("div", { className: "flex bg-white/60 font-medium text-sm text-gray-medium ", children: [_jsx("div", { className: "sticky left-0 bg-white/90 p-2 flex-[3] text-center text-gray-dark border-green-dark border-r-1", children: "Section2" }), _jsx("div", { className: cn("p-2 flex-[2] text-center", cellAnimation), children: data.analysis.total.section2.toFixed(1) }), _jsx("div", { className: "p-2 flex-[2] text-center text-green-dark font-bold bg-green-light", children: data.analysis.user.section2.toFixed(1) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: data.analysis.nationalAverage.section2.toFixed(2) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: data.analysis.localAverage.section2.toFixed(2) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: data.analysis.ageAverage.section2.toFixed(2) }), _jsx("div", { className: "p-2 flex-[3] text-center border-green-dark border-l-1 font-bold", children: data.analysis["10percentageAverage"].toFixed(2) }), _jsx("div", { className: "p-2 flex-[3] text-center font-bold", children: data.analysis["30percentageAverage"].toFixed(2) })] }), _jsxs("div", { className: "flex bg-white/60 font-medium text-sm text-gray-medium ", children: [_jsx("div", { className: "sticky left-0 bg-white/90 p-2 flex-[3] text-center text-gray-dark border-green-dark border-r-1", children: "total" }), _jsx("div", { className: cn("p-2 flex-[2] text-center", cellAnimation), children: (data.analysis.total.section1 + data.analysis.total.section2).toFixed(1) }), _jsx("div", { className: "p-2 flex-[2] text-center text-green-dark font-bold bg-green-light", children: (data.analysis.user.section1 + data.analysis.user.section2).toFixed(1) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: (data.analysis.nationalAverage.section1 +
140
- data.analysis.nationalAverage.section2).toFixed(2) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: (data.analysis.localAverage.section1 +
141
- data.analysis.localAverage.section2).toFixed(2) }), _jsx("div", { className: cn("p-2 flex-[3] text-center", cellAnimation), children: (data.analysis.ageAverage.section1 +
142
- data.analysis.ageAverage.section2).toFixed(2) }), _jsx("div", { className: "p-2 flex-[3] text-center border-green-dark border-l-1" }), _jsx("div", { className: "p-2 flex-[3] text-center " })] })] }) }));
143
- }
144
- export const LevelToStyleMap = {
145
- CC: {
146
- name: "Cocoon",
147
- bgcolor: "bg-co-green-light",
148
- textcolor: "text-co-green",
149
- },
150
- PS: {
151
- name: "Pre-Starter",
152
- bgcolor: "bg-ps-pink-light",
153
- textcolor: "text-ps-pink",
154
- },
155
- ST: {
156
- name: "Starter",
157
- bgcolor: "bg-st-orange-light",
158
- textcolor: "text-st-orange",
159
- },
160
- BA: {
161
- name: "Basic",
162
- bgcolor: "bg-ba-yellow-light",
163
- textcolor: "text-ba-yellow",
164
- },
165
- JR: {
166
- name: "Junior",
167
- bgcolor: "bg-jr-blue-light",
168
- textcolor: "text-jr-blue",
169
- },
170
- HJ: {
171
- name: "High Junior",
172
- bgcolor: "bg-hj-blue-light",
173
- textcolor: "text-hj-blue",
174
- },
175
- AD: {
176
- name: "Advanced",
177
- bgcolor: "bg-gray-light",
178
- textcolor: "text-gray-dark",
179
- },
180
- };
@@ -1 +1,5 @@
1
- export default function TranscriptDesign(): import("react/jsx-runtime").JSX.Element;
1
+ import { TranscriptProps } from "./Transcript";
2
+ declare const _default: import("react").ForwardRefExoticComponent<{
3
+ props: TranscriptProps;
4
+ } & import("react").RefAttributes<HTMLDivElement>>;
5
+ export default _default;
@@ -1,10 +1,23 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import { paperSize } from "../../../../style/size";
3
4
  import { cn } from "../../../../util";
4
- export default function TranscriptDesign() {
5
+ import IdCard from "./organism/IdCard";
6
+ import { BarCardCol } from "./organism/BarCardCol";
7
+ function TranscriptDesign({ props }, ref) {
8
+ const { info, result, data } = props;
5
9
  const container = {
6
- sizes: paperSize.a4,
7
- backgrounds: "bg-white",
10
+ printSize: paperSize.a4,
11
+ backgrounds: "print:bg-white",
12
+ sizes: "w-full max-w-[210mm]",
13
+ textStyles: "break-keep",
8
14
  };
9
- return _jsx("div", { className: cn(container), children: "asdf" });
15
+ const headerBox = {
16
+ display: "flex flex-row flex-wrap justify-between items-center",
17
+ sizes: "w-full h-fit rounded-md",
18
+ spacings: "px-5 py-2",
19
+ backgrounds: "bg-gradient-to-r from-crimson-burgundy to-green-dark",
20
+ };
21
+ return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "https://resource.tosel.co.kr/images/header-logo2.png", alt: "\uD1A0\uC140 \uB85C\uACE0", className: "h-10 py-1" }), _jsx("div", { className: "text-white font-bold text-base", children: "Official Score Report" })] }), _jsx(IdCard, { info: info }), _jsx(BarCardCol, { data: data, theme: "red" })] }));
10
22
  }
23
+ export default forwardRef(TranscriptDesign);
@@ -1,3 +1,5 @@
1
- export declare function CardTitle({ title }: {
1
+ import { Theme } from "../../Theme";
2
+ export default function CardTitle({ title, theme, }: {
2
3
  title: string;
4
+ theme: Theme;
3
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../../../../util";
3
- export function CardTitle({ title }) {
3
+ export default function CardTitle({ title, theme, }) {
4
4
  const cardTitle = {
5
5
  display: "flex flex-row justify-center items-center",
6
6
  sizes: "h-7 shrink-0 w-full",
7
- bg: "bg-green-light",
8
- textStyles: "text-green-dark font-medium text-sm",
7
+ theme: theme == "green"
8
+ ? "text-green-dark bg-green-light"
9
+ : "text-crimson-burgundy bg-crimson-burgundy/10",
10
+ textStyles: "font-medium text-sm",
9
11
  };
10
12
  return _jsx("div", { className: cn(cardTitle), children: title });
11
13
  }
@@ -0,0 +1,2 @@
1
+ import { Level } from "../../../../../_test/interface";
2
+ export declare function GetStyleFromLevel(level: Level, field: "name" | "bgcolor" | "textcolor"): string;
@@ -0,0 +1,4 @@
1
+ import { LevelToStyleMap } from "./LevelToStyleMap";
2
+ export function GetStyleFromLevel(level, field) {
3
+ return LevelToStyleMap[level]?.[field] || "Unknown";
4
+ }
@@ -0,0 +1,6 @@
1
+ import { Level } from "../../../../../_test/interface";
2
+ export declare const LevelToStyleMap: Record<Level, {
3
+ name: string;
4
+ bgcolor: string;
5
+ textcolor: string;
6
+ }>;