@daeryun/dr_components 0.1.61 → 0.1.63

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.
@@ -14,8 +14,13 @@ const CountingSection = (props: {
14
14
 
15
15
  const targetRef = useRef<HTMLDivElement | null>(null);
16
16
  const [isCountMount, setIsCountMount] = useState(false);
17
+ const numClass =
18
+ ' text-[50px] max-xl:text-[48px] max-lg:text-[42px] max-md:text-[32px] max-xs:text-[24px] font-[800] ';
17
19
 
18
20
  const sectionRefs = [
21
+ useRef<HTMLDivElement | null>(null),
22
+ useRef<HTMLDivElement | null>(null),
23
+ useRef<HTMLDivElement | null>(null),
19
24
  useRef<HTMLDivElement | null>(null),
20
25
  useRef<HTMLDivElement | null>(null),
21
26
  useRef<HTMLDivElement | null>(null),
@@ -23,8 +28,12 @@ const CountingSection = (props: {
23
28
  ];
24
29
 
25
30
  const { count: caseOutcomeCount } = useCountNum(initialData.consult_cnt, 0, isCountMount, -16.5);
31
+ const { count: caseMandateCount } = useCountNum(initialData.mandate_cnt, 0, isCountMount, -16.5);
26
32
  const { count: professionalCount } = useCountNum(initialData.professional_cnt, 0, isCountMount);
33
+ const { count: caseOutcomeDayCount } = useCountNum(initialData.consult_cnt_day, 0, isCountMount);
34
+ const { count: caseMandateDayCount } = useCountNum(initialData.mandate_cnt_day, 0, isCountMount);
27
35
  const { count: nationwideOfficeCount } = useCountNum(initialData.office_cnt, 0, isCountMount);
36
+
28
37
  //애니메이션
29
38
  useEffect(() => {
30
39
  const options: IntersectionObserverInit = {
@@ -34,6 +43,18 @@ const CountingSection = (props: {
34
43
  const callback: IntersectionObserverCallback = (entries, observer) => {
35
44
  entries.forEach((entry, index) => {
36
45
  if (entry.isIntersecting) {
46
+ if (entry.intersectionRatio >= 0.75) {
47
+ sectionRefs[6].current?.classList.remove('opacity-0');
48
+ sectionRefs[6].current?.classList.add(`animate-[fadeInUp_1.6s]`);
49
+ }
50
+ if (entry.intersectionRatio >= 0.7) {
51
+ sectionRefs[5].current?.classList.remove('opacity-0');
52
+ sectionRefs[5].current?.classList.add(`animate-[fadeInUp_1.4s]`);
53
+ }
54
+ if (entry.intersectionRatio >= 0.65) {
55
+ sectionRefs[4].current?.classList.remove('opacity-0');
56
+ sectionRefs[4].current?.classList.add(`animate-[fadeInUp_1.2s]`);
57
+ }
37
58
  if (entry.intersectionRatio >= 0.75) {
38
59
  sectionRefs[3].current?.classList.remove('opacity-0');
39
60
  sectionRefs[3].current?.classList.add(`animate-[fadeInUp_1.6s]`);
@@ -72,7 +93,7 @@ const CountingSection = (props: {
72
93
  <section
73
94
  ref={targetRef}
74
95
  className={
75
- 'relative flex h-[460px] w-full items-center justify-center bg-[#F2F2F2] max-lg:h-[300px] max-sm:h-full max-sm:py-20 max-xs:py-16'
96
+ 'relative flex h-[460px] w-full items-center justify-center bg-[#F2F2F2] max-lg:h-[300px] max-sm:h-full max-sm:py-20 max-xs:py-16 flex-col gap-[40px]'
76
97
  }
77
98
  >
78
99
  {props.bgUrl ? (
@@ -87,9 +108,8 @@ const CountingSection = (props: {
87
108
  className={
88
109
  'relative z-10 grid h-[110px] w-[90%] max-w-[1340px] grid-cols-3 text-center leading-tight ' +
89
110
  'max-lg:h-[80px] max-lg:w-full ' +
90
- 'max-md:h-[60px] ' +
91
- ' sm:grid sm:grid-cols-3 ' +
92
- 'max-xs:h-[50px] '
111
+ 'max-sm:h-[80px] sm:grid sm:grid-cols-3 ' +
112
+ 'max-xs:h-[60px] '
93
113
  }
94
114
  style={{ color: props.fontColor ? props.fontColor : 'black' }}
95
115
  >
@@ -98,13 +118,7 @@ const CountingSection = (props: {
98
118
  <span className={'mt-1 text-[13px] max-xs:text-[10px]'}>
99
119
  *{initialData.consult_date.toLocaleString()}
100
120
  </span>
101
- <p
102
- className={
103
- 'text-[50px] max-xl:text-[48px] max-lg:text-[42px] max-md:text-[30px] max-xs:text-[24px] font-[800]'
104
- }
105
- >
106
- {caseOutcomeCount.toLocaleString()} +
107
- </p>
121
+ <p className={numClass}>{caseOutcomeCount.toLocaleString()} +</p>
108
122
  </div>
109
123
  <div
110
124
  style={{
@@ -114,28 +128,55 @@ const CountingSection = (props: {
114
128
  borderLeft: 'solid 1px'
115
129
  }}
116
130
  ref={sectionRefs[2]}
117
- className={'flex flex-col justify-between opacity-0'}
131
+ className={'flex flex-col justify-between border-x-[0.05vw] border-solid border-black opacity-100'}
118
132
  >
119
- <p className={'text-[24px] leading-none max-lg:text-[18px] max-xs:text-[16px]'}>전문가</p>
133
+ <p className={'text-[24px] leading-none max-lg:text-[18px] max-xs:text-[16px]'}>누적 수임건수</p>
134
+ <span className={'mt-1 text-[13px] max-xs:text-[10px]'}>
135
+ *{initialData.consult_date.toLocaleString()}
136
+ </span>
120
137
 
121
- <p
122
- className={
123
- 'text-[50px] max-xl:text-[48px] max-lg:text-[42px] max-md:text-[30px] max-xs:text-[24px] font-[800]'
124
- }
125
- >
126
- {professionalCount} +
138
+ <p className={numClass}>{caseMandateCount.toLocaleString()} +</p>
139
+ </div>
140
+ <div ref={sectionRefs[2]} className={'flex flex-col justify-between opacity-0'}>
141
+ <p className={'text-[24px] leading-none max-lg:text-[18px] max-xs:text-[16px]'}>전문가</p>
142
+ <p className={numClass}>{professionalCount} +</p>
143
+ </div>
144
+ </div>
145
+ <div
146
+ className={
147
+ 'relative z-10 grid h-[110px] w-[90%] max-w-[1340px] grid-cols-3 text-center leading-tight ' +
148
+ 'max-lg:h-[80px] max-lg:w-full ' +
149
+ 'max-sm:h-[80px] sm:grid sm:grid-cols-3 ' +
150
+ 'max-xs:h-[60px]'
151
+ }
152
+ style={{ color: props.fontColor ? props.fontColor : 'black' }}
153
+ >
154
+ <div ref={sectionRefs[4]} className={'flex flex-col justify-between opacity-0 '}>
155
+ <p className={'text-[24px] leading-none max-lg:text-[18px] max-xs:text-[16px]'}>
156
+ 일 평균 상담건수
157
+ <br />
127
158
  </p>
159
+ <p className={numClass}>{caseOutcomeDayCount} +</p>
128
160
  </div>
129
- <div ref={sectionRefs[3]} className={'flex flex-col justify-between opacity-0'}>
130
- <p className={'text-[24px] leading-none max-lg:text-[18px] max-xs:text-[16px]'}>전국대응거점</p>
131
-
132
- <p
133
- className={
134
- 'text-[50px] max-xl:text-[48px] max-lg:text-[42px] max-md:text-[30px] max-xs:text-[24px] font-[800]'
135
- }
136
- >
137
- {nationwideOfficeCount}
161
+ <div
162
+ style={{
163
+ borderLeftColor: props.fontColor ? props.fontColor : 'black',
164
+ borderRightColor: props.fontColor ? props.fontColor : 'black',
165
+ borderRight: 'solid 1px',
166
+ borderLeft: 'solid 1px'
167
+ }}
168
+ ref={sectionRefs[5]}
169
+ className={'flex flex-col justify-between opacity-0'}
170
+ >
171
+ <p className={'text-[24px] leading-none max-lg:text-[18px] max-xs:text-[16px]'}>
172
+ 일 평균 수임건수
173
+ <br />
138
174
  </p>
175
+ <p className={numClass}>{caseMandateDayCount} +</p>
176
+ </div>
177
+ <div ref={sectionRefs[6]} className={'flex flex-col justify-between opacity-0'}>
178
+ <p className={'text-[24px] max-lg:text-[18px]'}>전국대응거점</p>
179
+ <p className={numClass}>{nationwideOfficeCount}</p>
139
180
  </div>
140
181
  </div>
141
182
  </section>
@@ -7,7 +7,8 @@ const fix = {
7
7
  export default fix;
8
8
  export const Default = {
9
9
  render: () => (<div className={'w-full pt-10 h-[100vh]'}>
10
- 스크롤 하면 fix 나옴
10
+ <span className={'line-through'}>스크롤 하면 fix 나옴</span> <br />
11
+ 스크롤하지않아도 노출되게 변경
11
12
  <Fix tel={'1800-7905'}/>
12
13
  </div>)
13
14
  };
@@ -1,21 +1,22 @@
1
- import Fix from './index'
2
- import { categoryListExample, centerListExample } from '../common'
3
- import type { Meta, StoryObj } from '@storybook/react'
4
- import '../../styles/globals.css'
1
+ import Fix from './index';
2
+ import { categoryListExample, centerListExample } from '../common';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
+ import '../../styles/globals.css';
5
5
 
6
6
  const fix = {
7
7
  component: Fix, //컴포넌트
8
8
  title: 'Fix' //스토리 이름
9
- } satisfies Meta<typeof Fix>
9
+ } satisfies Meta<typeof Fix>;
10
10
 
11
- export default fix
12
- type Story = StoryObj<typeof Fix>
11
+ export default fix;
12
+ type Story = StoryObj<typeof Fix>;
13
13
 
14
14
  export const Default: Story = {
15
15
  render: () => (
16
16
  <div className={'w-full pt-10 h-[100vh]'}>
17
- 스크롤 하면 fix 나옴
17
+ <span className={'line-through'}>스크롤 하면 fix 나옴</span> <br />
18
+ 스크롤하지않아도 노출되게 변경
18
19
  <Fix tel={'1800-7905'} />
19
20
  </div>
20
21
  )
21
- }
22
+ };
@@ -24,7 +24,7 @@ import ArrowIcon from '../../asset/images/fix/arrow.webp';
24
24
  const Fix = (props) => {
25
25
  const mobile = require('is-mobile');
26
26
  const [isMobile, setIsMobile] = useState(false);
27
- const [isTop, setIsTop] = useState(true);
27
+ // const [isTop, setIsTop] = useState(true);
28
28
  const onlineRef = useRef(null);
29
29
  const callRef = useRef(null);
30
30
  const router = useRouter();
@@ -93,31 +93,34 @@ const Fix = (props) => {
93
93
  value: '1'
94
94
  });
95
95
  };
96
- useEffect(() => {
97
- if (typeof window != 'undefined') {
98
- const handleScroll = () => {
99
- var _a, _b, _c, _d;
100
- setIsTop(window.scrollY <= 0);
101
- if (window.scrollY <= 0) {
102
- (_a = onlineRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove(style.fadeOut);
103
- (_b = onlineRef.current) === null || _b === void 0 ? void 0 : _b.classList.remove(style.fadeIn);
104
- (_c = callRef.current) === null || _c === void 0 ? void 0 : _c.classList.remove(style.fadeOut);
105
- (_d = callRef.current) === null || _d === void 0 ? void 0 : _d.classList.remove(style.fadeIn);
106
- }
107
- };
108
- window.addEventListener('scroll', handleScroll);
109
- return () => {
110
- window.removeEventListener('scroll', handleScroll);
111
- };
112
- }
113
- }, []);
96
+ // useEffect(() => {
97
+ // if (typeof window != 'undefined') {
98
+ // const handleScroll = () => {
99
+ // setIsTop(window.scrollY <= 0);
100
+ //
101
+ // if (window.scrollY <= 0) {
102
+ // onlineRef.current?.classList.remove(style.fadeOut);
103
+ // onlineRef.current?.classList.remove(style.fadeIn);
104
+ // callRef.current?.classList.remove(style.fadeOut);
105
+ // callRef.current?.classList.remove(style.fadeIn);
106
+ // }
107
+ // };
108
+ //
109
+ // window.addEventListener('scroll', handleScroll);
110
+ // return () => {
111
+ // window.removeEventListener('scroll', handleScroll);
112
+ // };
113
+ // }
114
+ // }, []);
114
115
  useEffect(() => {
115
116
  const is_mobile = mobile();
116
117
  setIsMobile(is_mobile);
117
118
  }, []);
118
119
  return (<>
119
- <div className={(isTop ? ' hidden ' : '') +
120
- ' fixed bottom-[43px] right-[25px] z-[2000] w-fit font-[SUIT] ' +
120
+ <div className={
121
+ // (isTop ? ' hidden ' : '') +
122
+ ' fixed bottom-[6.5%] right-[25px] z-[2000] w-fit font-[SUIT] ' +
123
+ ' max-5xl:bottom-[4%] ' +
121
124
  ' max-lg:relative max-lg:bottom-0 max-lg:right-0 max-lg:w-full'}>
122
125
  {/*Fix*/}
123
126
 
@@ -23,7 +23,7 @@ const Fix = (props: {
23
23
  }) => {
24
24
  const mobile = require('is-mobile');
25
25
  const [isMobile, setIsMobile] = useState<boolean>(false);
26
- const [isTop, setIsTop] = useState(true);
26
+ // const [isTop, setIsTop] = useState(true);
27
27
  const onlineRef = useRef<HTMLDivElement>(null);
28
28
  const callRef = useRef<HTMLDivElement>(null);
29
29
 
@@ -98,25 +98,25 @@ const Fix = (props: {
98
98
  });
99
99
  };
100
100
 
101
- useEffect(() => {
102
- if (typeof window != 'undefined') {
103
- const handleScroll = () => {
104
- setIsTop(window.scrollY <= 0);
105
-
106
- if (window.scrollY <= 0) {
107
- onlineRef.current?.classList.remove(style.fadeOut);
108
- onlineRef.current?.classList.remove(style.fadeIn);
109
- callRef.current?.classList.remove(style.fadeOut);
110
- callRef.current?.classList.remove(style.fadeIn);
111
- }
112
- };
113
-
114
- window.addEventListener('scroll', handleScroll);
115
- return () => {
116
- window.removeEventListener('scroll', handleScroll);
117
- };
118
- }
119
- }, []);
101
+ // useEffect(() => {
102
+ // if (typeof window != 'undefined') {
103
+ // const handleScroll = () => {
104
+ // setIsTop(window.scrollY <= 0);
105
+ //
106
+ // if (window.scrollY <= 0) {
107
+ // onlineRef.current?.classList.remove(style.fadeOut);
108
+ // onlineRef.current?.classList.remove(style.fadeIn);
109
+ // callRef.current?.classList.remove(style.fadeOut);
110
+ // callRef.current?.classList.remove(style.fadeIn);
111
+ // }
112
+ // };
113
+ //
114
+ // window.addEventListener('scroll', handleScroll);
115
+ // return () => {
116
+ // window.removeEventListener('scroll', handleScroll);
117
+ // };
118
+ // }
119
+ // }, []);
120
120
 
121
121
  useEffect(() => {
122
122
  const is_mobile = mobile();
@@ -127,8 +127,9 @@ const Fix = (props: {
127
127
  <>
128
128
  <div
129
129
  className={
130
- (isTop ? ' hidden ' : '') +
131
- ' fixed bottom-[43px] right-[25px] z-[2000] w-fit font-[SUIT] ' +
130
+ // (isTop ? ' hidden ' : '') +
131
+ ' fixed bottom-[6.5%] right-[25px] z-[2000] w-fit font-[SUIT] ' +
132
+ ' max-5xl:bottom-[4%] ' +
132
133
  ' max-lg:relative max-lg:bottom-0 max-lg:right-0 max-lg:w-full'
133
134
  }
134
135
  >
@@ -18,13 +18,12 @@ export const Default = {
18
18
  setSelectRegion: () => { },
19
19
  initialData: {
20
20
  lawyer_cnt: 230,
21
- office_cnt: 39,
22
- consult_cnt: 361053,
21
+ office_cnt: 41,
22
+ consult_cnt: 101938,
23
23
  success_cnt: 27002,
24
- consult_date: '',
25
24
  center_cnt: 22,
26
25
  regenerTotal_cnt: 7526723016,
27
- professional_cnt: 550,
26
+ professional_cnt: 240,
28
27
  weekday: '06:00 ~ 24:00',
29
28
  weekend: '06:00 ~ 24:00',
30
29
  consult_time: '365일 24시간 상담과 긴급대응 가능',
@@ -50,7 +49,11 @@ export const Default = {
50
49
  divorce_inherit_success: 6332,
51
50
  comp_administration_success: 1465,
52
51
  aggregationDate: '2024.1.2~2024.8.31',
53
- main_date: '2024년 1~8월 기준'
52
+ main_date: '2024년 1~8월 기준',
53
+ consult_date: '지난 3년간 기준',
54
+ mandate_cnt: 26941,
55
+ consult_cnt_day: 146,
56
+ mandate_cnt_day: 67
54
57
  }
55
58
  }
56
59
  };
@@ -26,13 +26,12 @@ export const Default: Story = {
26
26
  setSelectRegion: () => {},
27
27
  initialData: {
28
28
  lawyer_cnt: 230,
29
- office_cnt: 39,
30
- consult_cnt: 361053,
29
+ office_cnt: 41,
30
+ consult_cnt: 101938,
31
31
  success_cnt: 27002,
32
- consult_date: '',
33
32
  center_cnt: 22,
34
33
  regenerTotal_cnt: 7526723016,
35
- professional_cnt: 550,
34
+ professional_cnt: 240,
36
35
  weekday: '06:00 ~ 24:00',
37
36
  weekend: '06:00 ~ 24:00',
38
37
  consult_time: '365일 24시간 상담과 긴급대응 가능',
@@ -58,7 +57,11 @@ export const Default: Story = {
58
57
  divorce_inherit_success: 6332,
59
58
  comp_administration_success: 1465,
60
59
  aggregationDate: '2024.1.2~2024.8.31',
61
- main_date: '2024년 1~8월 기준'
60
+ main_date: '2024년 1~8월 기준',
61
+ consult_date: '지난 3년간 기준',
62
+ mandate_cnt: 26941,
63
+ consult_cnt_day: 146,
64
+ mandate_cnt_day: 67
62
65
  }
63
66
  }
64
67
  };
@@ -8,7 +8,6 @@ export interface IInitialDataTypes {
8
8
  professional_cnt: number;
9
9
  weekday: string;
10
10
  weekend: string;
11
- consult_date: string;
12
11
  consult_time: string;
13
12
  success_2024: number;
14
13
  field_center: string[];
@@ -19,6 +18,10 @@ export interface IInitialDataTypes {
19
18
  comp_administration_success: number;
20
19
  aggregationDate: string;
21
20
  main_date: string;
21
+ consult_date: string;
22
+ mandate_cnt: number;
23
+ consult_cnt_day: number;
24
+ mandate_cnt_day: number;
22
25
  }
23
26
  export interface ICenter {
24
27
  code: string;
@@ -8,7 +8,6 @@ export interface IInitialDataTypes {
8
8
  professional_cnt: number;
9
9
  weekday: string;
10
10
  weekend: string;
11
- consult_date: string;
12
11
  consult_time: string;
13
12
  success_2024: number;
14
13
  field_center: string[];
@@ -19,6 +18,10 @@ export interface IInitialDataTypes {
19
18
  comp_administration_success: number;
20
19
  aggregationDate: string;
21
20
  main_date: string;
21
+ consult_date: string;
22
+ mandate_cnt: number;
23
+ consult_cnt_day: number;
24
+ mandate_cnt_day: number;
22
25
  }
23
26
  export interface ICenter {
24
27
  code: string;
@@ -602,14 +602,14 @@ video {
602
602
  bottom: 13px;
603
603
  }
604
604
 
605
- .bottom-\[43px\] {
606
- bottom: 43px;
607
- }
608
-
609
605
  .bottom-\[50\%\] {
610
606
  bottom: 50%;
611
607
  }
612
608
 
609
+ .bottom-\[6\.5\%\] {
610
+ bottom: 6.5%;
611
+ }
612
+
613
613
  .left-0 {
614
614
  left: 0px;
615
615
  }
@@ -1447,6 +1447,10 @@ video {
1447
1447
  gap: 3px;
1448
1448
  }
1449
1449
 
1450
+ .gap-\[40px\] {
1451
+ gap: 40px;
1452
+ }
1453
+
1450
1454
  .gap-\[65px\] {
1451
1455
  gap: 65px;
1452
1456
  }
@@ -1516,6 +1520,11 @@ video {
1516
1520
  border-width: 1px;
1517
1521
  }
1518
1522
 
1523
+ .border-x-\[0\.05vw\] {
1524
+ border-left-width: 0.05vw;
1525
+ border-right-width: 0.05vw;
1526
+ }
1527
+
1519
1528
  .border-b-\[1px\] {
1520
1529
  border-bottom-width: 1px;
1521
1530
  }
@@ -2090,6 +2099,10 @@ video {
2090
2099
  color: rgb(255 255 255 / var(--tw-text-opacity));
2091
2100
  }
2092
2101
 
2102
+ .line-through {
2103
+ text-decoration-line: line-through;
2104
+ }
2105
+
2093
2106
  .opacity-0 {
2094
2107
  opacity: 0;
2095
2108
  }
@@ -2289,6 +2302,10 @@ body {
2289
2302
  bottom: 10px;
2290
2303
  }
2291
2304
 
2305
+ .max-5xl\:bottom-\[4\%\] {
2306
+ bottom: 4%;
2307
+ }
2308
+
2292
2309
  .max-5xl\:mb-\[3px\] {
2293
2310
  margin-bottom: 3px;
2294
2311
  }
@@ -3041,10 +3058,6 @@ body {
3041
3058
  height: 53px;
3042
3059
  }
3043
3060
 
3044
- .max-md\:h-\[60px\] {
3045
- height: 60px;
3046
- }
3047
-
3048
3061
  .max-md\:h-\[85\%\] {
3049
3062
  height: 85%;
3050
3063
  }
@@ -3118,8 +3131,8 @@ body {
3118
3131
  font-size: 14px;
3119
3132
  }
3120
3133
 
3121
- .max-md\:text-\[30px\] {
3122
- font-size: 30px;
3134
+ .max-md\:text-\[32px\] {
3135
+ font-size: 32px;
3123
3136
  }
3124
3137
 
3125
3138
  .max-md\:text-\[38px\] {
@@ -3149,6 +3162,10 @@ body {
3149
3162
  height: 48px;
3150
3163
  }
3151
3164
 
3165
+ .max-sm\:h-\[80px\] {
3166
+ height: 80px;
3167
+ }
3168
+
3152
3169
  .max-sm\:h-full {
3153
3170
  height: 100%;
3154
3171
  }
@@ -3307,14 +3324,14 @@ body {
3307
3324
  height: 200px;
3308
3325
  }
3309
3326
 
3310
- .max-xs\:h-\[50px\] {
3311
- height: 50px;
3312
- }
3313
-
3314
3327
  .max-xs\:h-\[55px\] {
3315
3328
  height: 55px;
3316
3329
  }
3317
3330
 
3331
+ .max-xs\:h-\[60px\] {
3332
+ height: 60px;
3333
+ }
3334
+
3318
3335
  .max-xs\:h-\[800px\] {
3319
3336
  height: 800px;
3320
3337
  }