@daeryun/dr_components 0.1.95 → 0.1.96

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 (42) hide show
  1. package/dist/asset/images/strength/01.webp +0 -0
  2. package/dist/asset/images/strength/010.webp +0 -0
  3. package/dist/asset/images/strength/011.webp +0 -0
  4. package/dist/asset/images/strength/02.webp +0 -0
  5. package/dist/asset/images/strength/03.webp +0 -0
  6. package/dist/asset/images/strength/04.webp +0 -0
  7. package/dist/asset/images/strength/05.webp +0 -0
  8. package/dist/asset/images/strength/06.webp +0 -0
  9. package/dist/asset/images/strength/07.webp +0 -0
  10. package/dist/asset/images/strength/08.webp +0 -0
  11. package/dist/asset/images/strength/09.webp +0 -0
  12. package/dist/asset/images/strength/arrow.webp +0 -0
  13. package/dist/asset/images/strength/bg.webp +0 -0
  14. package/dist/asset/images/strength/mo.webp +0 -0
  15. package/dist/asset/images/strength/red_arrow.webp +0 -0
  16. package/dist/asset/images/strength/tb.webp +0 -0
  17. package/dist/components/MapFix/MapFix.stories.jsx +1 -0
  18. package/dist/components/MapFix/MapFix.stories.tsx +1 -0
  19. package/dist/components/common/strength/index.d.ts +8 -0
  20. package/dist/components/common/strength/index.js +184 -0
  21. package/dist/components/common/strength/index.ts +185 -0
  22. package/dist/components/page/Strength/Strength.d.ts +5 -0
  23. package/dist/components/page/Strength/Strength.jsx +9 -0
  24. package/dist/components/page/Strength/Strength.stories.d.ts +6 -0
  25. package/dist/components/page/Strength/Strength.stories.jsx +54 -0
  26. package/dist/components/page/Strength/Strength.stories.tsx +61 -0
  27. package/dist/components/page/Strength/Strength.tsx +13 -0
  28. package/dist/components/page/Strength/StrengthIntro.d.ts +6 -0
  29. package/dist/components/page/Strength/StrengthIntro.jsx +247 -0
  30. package/dist/components/page/Strength/StrengthIntro.tsx +355 -0
  31. package/dist/components/page/Strength/StrengthList.d.ts +6 -0
  32. package/dist/components/page/Strength/StrengthList.jsx +106 -0
  33. package/dist/components/page/Strength/StrengthList.tsx +189 -0
  34. package/dist/components/page/index.d.ts +1 -0
  35. package/dist/components/page/index.js +1 -0
  36. package/dist/components/page/index.ts +1 -0
  37. package/dist/lib/utils.d.ts +2 -0
  38. package/dist/lib/utils.js +23 -0
  39. package/dist/lib/utils.ts +25 -0
  40. package/dist/styles/globals.css +699 -0
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ import React from 'react';
2
+ import Image from 'next/image';
3
+ import useBrowser from '../../common/hook/useBrowser';
4
+ import { strengthList } from '../../common/strength';
5
+ import { replaceInitialData } from '../../../lib';
6
+ const StrengthList = ({ initialData }) => {
7
+ const { width } = useBrowser();
8
+ return (<section className={'max-md: relative flex w-full flex-col gap-[220px] overflow-hidden pb-[220px] pt-[240px] ' +
9
+ 'max-3xl:gap-[180px] ' +
10
+ 'max-lg:gap-[136px] max-lg:pb-[100px] max-lg:pt-[140px] ' +
11
+ 'max-md:gap-[56px] max-md:pb-20 max-md:pt-[58px]'}>
12
+ {strengthList.map((item, index) => {
13
+ const isOdd = width > 1023 ? (index + 1) % 2 !== 0 : true;
14
+ return (<div key={index}>
15
+ <div className={'relative mx-auto flex w-full max-w-[1920px] gap-[60px] px-[190px] ' +
16
+ 'max-3xl:gap-[40px] max-3xl:px-[80px] ' +
17
+ 'max-lg:flex-col max-lg:gap-[36px] max-lg:px-[60px] ' +
18
+ 'max-md2:px-[40px] ' +
19
+ 'max-md:gap-[18px] ' +
20
+ 'max-2sm:px-[20px] '}>
21
+ {/*이미지*/}
22
+ <div className={'w-full ' + (isOdd ? 'flex justify-end max-lg:justify-center' : '')}>
23
+ {isOdd ? (<ImageSection index={index}/>) : (<ListSection initialData={initialData} item={item} index={index}/>)}
24
+ </div>
25
+
26
+ <div className={'w-[48.6%] shrink-0 max-lg:w-full'}>
27
+ {isOdd ? (<ListSection initialData={initialData} item={item} index={index}/>) : (<ImageSection index={index}/>)}
28
+ </div>
29
+ </div>
30
+ </div>);
31
+ })}
32
+ </section>);
33
+ };
34
+ export default StrengthList;
35
+ const ImageSection = ({ index }) => {
36
+ const isOdd = (index + 1) % 2 !== 0;
37
+ return (<>
38
+ <div className={'relative z-20 h-[400px] w-full max-w-[740px] max-3xl:h-[300px] max-lg:h-[400px] max-lg:max-w-[unset] max-md2:h-[300px] max-md:h-[250px] max-xs:h-[180px] '}>
39
+ <span className={'absolute -top-10 z-10 flex h-20 w-20 items-center justify-center bg-[#AB0634] text-[40px] font-[800] leading-none tracking-[-0.8px] text-white ' +
40
+ 'max-3xl:top-[-28px] max-3xl:h-14 max-3xl:w-14 max-3xl:text-[24px] ' +
41
+ 'max-lg:h-20 max-lg:w-20 max-lg:text-[40px] ' +
42
+ 'max-md2:top-[-28px] max-md2:h-14 max-md2:w-14 max-md2:text-[24px] ' +
43
+ 'max-md:top-[-24px] max-md:h-12 max-md:w-12 max-md:text-[22px] ' +
44
+ 'max-xs:top-[-18px] max-xs:h-9 max-xs:w-9 max-xs:text-[16px] ' +
45
+ (isOdd
46
+ ? 'left-10 max-3xl:left-[28px] max-lg:left-10 max-md2:left-[28px] max-md:left-[24px] max-xs:left-4 '
47
+ : 'right-10 max-3xl:right-[28px] max-lg:right-10 max-md2:right-[28px] max-md:right-[24px] max-xs:right-4')}>
48
+ {index < 9 ? `0${index + 1}` : index + 1}
49
+ </span>
50
+ <Image id={`strength_${index}_img`} src={`https://d1tgonli21s4df.cloudfront.net/strength/0${index + 1}.webp`} alt={'강점 배경 ' + (index + 1)} fill className={'object-cover'}/>
51
+ </div>
52
+ </>);
53
+ };
54
+ const ListSection = ({ initialData, item, index }) => {
55
+ const isOdd = (index + 1) % 2 !== 0;
56
+ return (<>
57
+ <h2 id={`strength_${index}`} className={'mb-4 text-[24px] font-[800] tracking-[-0.96px] text-[#AB0634] ' +
58
+ 'max-4xl:text-[22px] ' +
59
+ 'max-xxl:text-[20px] ' +
60
+ 'max-md:mb-3 max-md:text-[18px] max-md:tracking-[-0.72px] '}>
61
+ {replaceInitialData(item.subTitle, initialData)}
62
+ </h2>
63
+ <p className={'mb-10 break-keep text-[32px] font-[800] leading-[1.33] tracking-[-1.28px] md:whitespace-pre-wrap ' +
64
+ (index === 9 || index === 10
65
+ ? ' w-full tracking-[-1.6px] '
66
+ : index === 5
67
+ ? 'tracking-[-1.28px] 4xl:w-[85%] '
68
+ : ' tracking-[-1.28px] 4xl:w-[90%] ') +
69
+ 'max-4xl:text-[28px] ' +
70
+ 'max-xxl:text-[25px] ' +
71
+ 'max-lg:text-[32px] ' +
72
+ 'max-md2:text-[28px] ' +
73
+ 'max-md:mb-7 max-md:text-[24px] max-md:tracking-[-0.96px]'}>
74
+ {item.title}
75
+ </p>
76
+ <div className={'relative flex min-h-[285px] flex-col gap-11 bg-[#F5F5F5] py-[40px] max-3xl:min-h-[210px] max-lg:min-h-[unset] max-md:gap-[23px] max-md:py-[30px]'}>
77
+ {/*배경*/}
78
+ <div className={'absolute top-0 h-full w-[300vw] translate-x-[-50%] bg-[#F5F5F5]'}></div>
79
+ {item.list.map((list, index) => {
80
+ return (<span key={index} className={'relative z-10 break-keep'}>
81
+ {list.liTitle.length > 0 ? (<h3 className={'mb-[22px] text-[24px] font-bold leading-tight tracking-[-0.96px] ' +
82
+ 'max-4xl:text-[22px] ' +
83
+ 'max-xxl:text-[20px] ' +
84
+ 'max-lg:text-[24px] ' +
85
+ 'max-md2:text-[20px] ' +
86
+ 'max-md:mb-[16px] max-md:tracking-[-1px]'}>
87
+ {replaceInitialData(list.liTitle, initialData)}
88
+ </h3>) : (<></>)}
89
+
90
+ <ul key={'ul_' + index} className={(isOdd ? 'w-[96.5%]' : '') + ' list-outside list-["-__"] pl-[22px]'}>
91
+ {list.li.map((liItem, index) => {
92
+ return (<li key={'li_' + index} className={'list-item pb-1 text-[24px] tracking-[-0.96px] lg:whitespace-pre-wrap ' +
93
+ 'max-4xl:text-[20px] ' +
94
+ 'max-xxl:text-[18px] ' +
95
+ 'max-lg:text-[20px] ' +
96
+ 'max-md2:text-[18px] ' +
97
+ 'max-md:text-[16px] max-md:tracking-[-0.64px]'}>
98
+ {replaceInitialData(liItem, initialData)}
99
+ </li>);
100
+ })}
101
+ </ul>
102
+ </span>);
103
+ })}
104
+ </div>
105
+ </>);
106
+ };
@@ -0,0 +1,189 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import Image from 'next/image';
3
+ import useBrowser from '../../common/hook/useBrowser';
4
+ import { IInitialDataTypes } from '../../common';
5
+ import { strengthList } from '../../common/strength';
6
+ import { replaceInitialData } from '../../../lib';
7
+ const StrengthList = ({ initialData }: { initialData: IInitialDataTypes }) => {
8
+ const { width } = useBrowser();
9
+ return (
10
+ <section
11
+ className={
12
+ 'max-md: relative flex w-full flex-col gap-[220px] overflow-hidden pb-[220px] pt-[240px] ' +
13
+ 'max-3xl:gap-[180px] ' +
14
+ 'max-lg:gap-[136px] max-lg:pb-[100px] max-lg:pt-[140px] ' +
15
+ 'max-md:gap-[56px] max-md:pb-20 max-md:pt-[58px]'
16
+ }
17
+ >
18
+ {strengthList.map((item, index) => {
19
+ const isOdd = width > 1023 ? (index + 1) % 2 !== 0 : true;
20
+
21
+ return (
22
+ <div key={index}>
23
+ <div
24
+ className={
25
+ 'relative mx-auto flex w-full max-w-[1920px] gap-[60px] px-[190px] ' +
26
+ 'max-3xl:gap-[40px] max-3xl:px-[80px] ' +
27
+ 'max-lg:flex-col max-lg:gap-[36px] max-lg:px-[60px] ' +
28
+ 'max-md2:px-[40px] ' +
29
+ 'max-md:gap-[18px] ' +
30
+ 'max-2sm:px-[20px] '
31
+ }
32
+ >
33
+ {/*이미지*/}
34
+ <div className={'w-full ' + (isOdd ? 'flex justify-end max-lg:justify-center' : '')}>
35
+ {isOdd ? (
36
+ <ImageSection index={index} />
37
+ ) : (
38
+ <ListSection initialData={initialData} item={item} index={index} />
39
+ )}
40
+ </div>
41
+
42
+ <div className={'w-[48.6%] shrink-0 max-lg:w-full'}>
43
+ {isOdd ? (
44
+ <ListSection initialData={initialData} item={item} index={index} />
45
+ ) : (
46
+ <ImageSection index={index} />
47
+ )}
48
+ </div>
49
+ </div>
50
+ </div>
51
+ );
52
+ })}
53
+ </section>
54
+ );
55
+ };
56
+
57
+ export default StrengthList;
58
+
59
+ const ImageSection = ({ index }: { index: number }) => {
60
+ const isOdd = (index + 1) % 2 !== 0;
61
+ return (
62
+ <>
63
+ <div
64
+ className={
65
+ 'relative z-20 h-[400px] w-full max-w-[740px] max-3xl:h-[300px] max-lg:h-[400px] max-lg:max-w-[unset] max-md2:h-[300px] max-md:h-[250px] max-xs:h-[180px] '
66
+ }
67
+ >
68
+ <span
69
+ className={
70
+ 'absolute -top-10 z-10 flex h-20 w-20 items-center justify-center bg-[#AB0634] text-[40px] font-[800] leading-none tracking-[-0.8px] text-white ' +
71
+ 'max-3xl:top-[-28px] max-3xl:h-14 max-3xl:w-14 max-3xl:text-[24px] ' +
72
+ 'max-lg:h-20 max-lg:w-20 max-lg:text-[40px] ' +
73
+ 'max-md2:top-[-28px] max-md2:h-14 max-md2:w-14 max-md2:text-[24px] ' +
74
+ 'max-md:top-[-24px] max-md:h-12 max-md:w-12 max-md:text-[22px] ' +
75
+ 'max-xs:top-[-18px] max-xs:h-9 max-xs:w-9 max-xs:text-[16px] ' +
76
+ (isOdd
77
+ ? 'left-10 max-3xl:left-[28px] max-lg:left-10 max-md2:left-[28px] max-md:left-[24px] max-xs:left-4 '
78
+ : 'right-10 max-3xl:right-[28px] max-lg:right-10 max-md2:right-[28px] max-md:right-[24px] max-xs:right-4')
79
+ }
80
+ >
81
+ {index < 9 ? `0${index + 1}` : index + 1}
82
+ </span>
83
+ <Image
84
+ id={`strength_${index}_img`}
85
+ src={`https://d1tgonli21s4df.cloudfront.net/strength/0${index + 1}.webp`}
86
+ alt={'강점 배경 ' + (index + 1)}
87
+ fill
88
+ className={'object-cover'}
89
+ />
90
+ </div>
91
+ </>
92
+ );
93
+ };
94
+ const ListSection = ({
95
+ initialData,
96
+ item,
97
+ index
98
+ }: {
99
+ index: number;
100
+ initialData: IInitialDataTypes;
101
+ item: { subTitle: string; title: string; list: { liTitle: string; li: string[] }[] };
102
+ }) => {
103
+ const isOdd = (index + 1) % 2 !== 0;
104
+ return (
105
+ <>
106
+ <h2
107
+ id={`strength_${index}`}
108
+ className={
109
+ 'mb-4 text-[24px] font-[800] tracking-[-0.96px] text-[#AB0634] ' +
110
+ 'max-4xl:text-[22px] ' +
111
+ 'max-xxl:text-[20px] ' +
112
+ 'max-md:mb-3 max-md:text-[18px] max-md:tracking-[-0.72px] '
113
+ }
114
+ >
115
+ {replaceInitialData(item.subTitle, initialData)}
116
+ </h2>
117
+ <p
118
+ className={
119
+ 'mb-10 break-keep text-[32px] font-[800] leading-[1.33] tracking-[-1.28px] md:whitespace-pre-wrap ' +
120
+ (index === 9 || index === 10
121
+ ? ' w-full tracking-[-1.6px] '
122
+ : index === 5
123
+ ? 'tracking-[-1.28px] 4xl:w-[85%] '
124
+ : ' tracking-[-1.28px] 4xl:w-[90%] ') +
125
+ 'max-4xl:text-[28px] ' +
126
+ 'max-xxl:text-[25px] ' +
127
+ 'max-lg:text-[32px] ' +
128
+ 'max-md2:text-[28px] ' +
129
+ 'max-md:mb-7 max-md:text-[24px] max-md:tracking-[-0.96px]'
130
+ }
131
+ >
132
+ {item.title}
133
+ </p>
134
+ <div
135
+ className={
136
+ 'relative flex min-h-[285px] flex-col gap-11 bg-[#F5F5F5] py-[40px] max-3xl:min-h-[210px] max-lg:min-h-[unset] max-md:gap-[23px] max-md:py-[30px]'
137
+ }
138
+ >
139
+ {/*배경*/}
140
+ <div className={'absolute top-0 h-full w-[300vw] translate-x-[-50%] bg-[#F5F5F5]'}></div>
141
+ {item.list.map((list, index) => {
142
+ return (
143
+ <span key={index} className={'relative z-10 break-keep'}>
144
+ {list.liTitle.length > 0 ? (
145
+ <h3
146
+ className={
147
+ 'mb-[22px] text-[24px] font-bold leading-tight tracking-[-0.96px] ' +
148
+ 'max-4xl:text-[22px] ' +
149
+ 'max-xxl:text-[20px] ' +
150
+ 'max-lg:text-[24px] ' +
151
+ 'max-md2:text-[20px] ' +
152
+ 'max-md:mb-[16px] max-md:tracking-[-1px]'
153
+ }
154
+ >
155
+ {replaceInitialData(list.liTitle, initialData)}
156
+ </h3>
157
+ ) : (
158
+ <></>
159
+ )}
160
+
161
+ <ul
162
+ key={'ul_' + index}
163
+ className={(isOdd ? 'w-[96.5%]' : '') + ' list-outside list-["-__"] pl-[22px]'}
164
+ >
165
+ {list.li.map((liItem, index) => {
166
+ return (
167
+ <li
168
+ key={'li_' + index}
169
+ className={
170
+ 'list-item pb-1 text-[24px] tracking-[-0.96px] lg:whitespace-pre-wrap ' +
171
+ 'max-4xl:text-[20px] ' +
172
+ 'max-xxl:text-[18px] ' +
173
+ 'max-lg:text-[20px] ' +
174
+ 'max-md2:text-[18px] ' +
175
+ 'max-md:text-[16px] max-md:tracking-[-0.64px]'
176
+ }
177
+ >
178
+ {replaceInitialData(liItem, initialData)}
179
+ </li>
180
+ );
181
+ })}
182
+ </ul>
183
+ </span>
184
+ );
185
+ })}
186
+ </div>
187
+ </>
188
+ );
189
+ };
@@ -1 +1,2 @@
1
1
  export { default as Choice } from './Choice/Choice';
2
+ export { default as Strength } from './Strength/Strength';
@@ -1 +1,2 @@
1
1
  export { default as Choice } from './Choice/Choice';
2
+ export { default as Strength } from './Strength/Strength';
@@ -1 +1,2 @@
1
1
  export { default as Choice } from './Choice/Choice';
2
+ export { default as Strength } from './Strength/Strength';
@@ -1,3 +1,4 @@
1
+ import { IInitialDataTypes } from '../components/common';
1
2
  export declare function htmlTagRemove(str: string): string;
2
3
  export declare function htmlUrlDecode(str: string): string;
3
4
  export declare function htmlUrlEncode(str: string): string;
@@ -23,3 +24,4 @@ export declare const formatPhoneNumber: (str: string) => string;
23
24
  export declare function telValidator(tel: string): boolean;
24
25
  export declare const consonantRegExp: (str: string, testStr: string) => true | RegExpMatchArray | null;
25
26
  export declare const getDomainHandler: (centerCode: string, subDomain: string) => string;
27
+ export declare const replaceInitialData: (str: string, initialData: IInitialDataTypes) => string;
package/dist/lib/utils.js CHANGED
@@ -334,3 +334,26 @@ export const getDomainHandler = (centerCode, subDomain) => {
334
334
  return `https://www.daeryunlaw-${subDomain}.com`;
335
335
  }
336
336
  };
337
+ // initialData replace
338
+ // initialData 안의 변수를 * * 으로 감싸서 사용
339
+ // number 형식은 천단위 , 추가
340
+ export const replaceInitialData = (str, initialData) => {
341
+ return str
342
+ .replace('*lawyer_cnt*', initialData.lawyer_cnt.toLocaleString())
343
+ .replace('*office_cnt*', initialData.office_cnt.toLocaleString())
344
+ .replace('*consult_cnt*', initialData.consult_cnt.toLocaleString())
345
+ .replace('*success_cnt*', initialData.success_cnt.toLocaleString())
346
+ .replace('*center_cnt*', initialData.center_cnt.toLocaleString())
347
+ .replace('*regenerTotal_cnt*', initialData.regenerTotal_cnt.toLocaleString())
348
+ .replace('*professional_cnt*', initialData.professional_cnt.toLocaleString())
349
+ .replace('*consult_time*', initialData.consult_time)
350
+ .replace('*success_2024*', initialData.success_2024.toLocaleString())
351
+ .replace('*success_2024_ko*', initialData.success_2024_ko)
352
+ .replace('*compensation_regener_success*', initialData.compensation_regener_success.toLocaleString())
353
+ .replace('*detective_success*', initialData.detective_success.toLocaleString())
354
+ .replace('*divorce_inherit_success*', initialData.divorce_inherit_success.toLocaleString())
355
+ .replace('*comp_administration_success*', initialData.comp_administration_success.toLocaleString())
356
+ .replace('*aggregationDate*', initialData.aggregationDate.toLocaleString())
357
+ .replace('*consult_date*', initialData.consult_date.toLocaleString())
358
+ .replace('*main_date*', initialData.main_date.toLocaleString());
359
+ };
package/dist/lib/utils.ts CHANGED
@@ -14,6 +14,7 @@
14
14
  */
15
15
  import { ParsedUrlQueryInput } from 'node:querystring';
16
16
  import { NextRouter } from 'next/router';
17
+ import { IInitialDataTypes } from '../components/common';
17
18
 
18
19
  export function htmlTagRemove(str: string) {
19
20
  if (str === '') return '';
@@ -365,3 +366,27 @@ export const getDomainHandler = (centerCode: string, subDomain: string) => {
365
366
  return `https://www.daeryunlaw-${subDomain}.com`;
366
367
  }
367
368
  };
369
+
370
+ // initialData replace
371
+ // initialData 안의 변수를 * * 으로 감싸서 사용
372
+ // number 형식은 천단위 , 추가
373
+ export const replaceInitialData = (str: string, initialData: IInitialDataTypes) => {
374
+ return str
375
+ .replace('*lawyer_cnt*', initialData.lawyer_cnt.toLocaleString())
376
+ .replace('*office_cnt*', initialData.office_cnt.toLocaleString())
377
+ .replace('*consult_cnt*', initialData.consult_cnt.toLocaleString())
378
+ .replace('*success_cnt*', initialData.success_cnt.toLocaleString())
379
+ .replace('*center_cnt*', initialData.center_cnt.toLocaleString())
380
+ .replace('*regenerTotal_cnt*', initialData.regenerTotal_cnt.toLocaleString())
381
+ .replace('*professional_cnt*', initialData.professional_cnt.toLocaleString())
382
+ .replace('*consult_time*', initialData.consult_time)
383
+ .replace('*success_2024*', initialData.success_2024.toLocaleString())
384
+ .replace('*success_2024_ko*', initialData.success_2024_ko)
385
+ .replace('*compensation_regener_success*', initialData.compensation_regener_success.toLocaleString())
386
+ .replace('*detective_success*', initialData.detective_success.toLocaleString())
387
+ .replace('*divorce_inherit_success*', initialData.divorce_inherit_success.toLocaleString())
388
+ .replace('*comp_administration_success*', initialData.comp_administration_success.toLocaleString())
389
+ .replace('*aggregationDate*', initialData.aggregationDate.toLocaleString())
390
+ .replace('*consult_date*', initialData.consult_date.toLocaleString())
391
+ .replace('*main_date*', initialData.main_date.toLocaleString());
392
+ };