@daeryun/dr_components 0.9.6 → 0.9.8

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.
@@ -1,8 +1,10 @@
1
- import { useEffect, useRef, useState, useCallback } from 'react';
1
+ import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  export function useScrollShadow() {
3
3
  const containerRef = useRef(null);
4
4
  const [isScroll, setIsScroll] = useState(false);
5
5
  const [isBottom, setIsBottom] = useState(false);
6
+ const [isScrolling, setIsScrolling] = useState(false);
7
+ const scrollTimeoutRef = useRef(null);
6
8
  const checkScroll = useCallback(() => {
7
9
  const container = containerRef.current;
8
10
  if (!container)
@@ -12,16 +14,29 @@ export function useScrollShadow() {
12
14
  setIsScroll(scrollHeight > clientHeight);
13
15
  setIsBottom(scrollPercentage >= 0.98);
14
16
  }, []);
17
+ const handleScroll = useCallback(() => {
18
+ checkScroll();
19
+ setIsScrolling(true);
20
+ if (scrollTimeoutRef.current) {
21
+ clearTimeout(scrollTimeoutRef.current);
22
+ }
23
+ scrollTimeoutRef.current = setTimeout(() => {
24
+ setIsScrolling(false);
25
+ }, 800); // 스크롤 멈춘 후 800ms 뒤 isScrolling false
26
+ }, [checkScroll]);
15
27
  useEffect(() => {
16
28
  const container = containerRef.current;
17
29
  if (!container)
18
30
  return;
19
- container.addEventListener('scroll', checkScroll);
31
+ container.addEventListener('scroll', handleScroll);
20
32
  // mount 시 초기 상태 확인
21
33
  checkScroll();
22
34
  return () => {
23
- container.removeEventListener('scroll', checkScroll);
35
+ container.removeEventListener('scroll', handleScroll);
36
+ if (scrollTimeoutRef.current) {
37
+ clearTimeout(scrollTimeoutRef.current);
38
+ }
24
39
  };
25
- }, [checkScroll]);
26
- return { containerRef, isScroll, isBottom, checkScroll };
40
+ }, [handleScroll, checkScroll]);
41
+ return { containerRef, isScroll, isBottom, isScrolling, checkScroll };
27
42
  }
@@ -1,9 +1,11 @@
1
- import { useEffect, useRef, useState, useCallback } from 'react';
1
+ import { useCallback, useEffect, useRef, useState } from 'react';
2
2
 
3
3
  export function useScrollShadow<T extends HTMLElement>() {
4
4
  const containerRef = useRef<T | null>(null);
5
5
  const [isScroll, setIsScroll] = useState(false);
6
6
  const [isBottom, setIsBottom] = useState(false);
7
+ const [isScrolling, setIsScrolling] = useState(false);
8
+ const scrollTimeoutRef = useRef<NodeJS.Timeout | null>(null);
7
9
 
8
10
  const checkScroll = useCallback(() => {
9
11
  const container = containerRef.current;
@@ -16,19 +18,35 @@ export function useScrollShadow<T extends HTMLElement>() {
16
18
  setIsBottom(scrollPercentage >= 0.98);
17
19
  }, []);
18
20
 
21
+ const handleScroll = useCallback(() => {
22
+ checkScroll();
23
+ setIsScrolling(true);
24
+
25
+ if (scrollTimeoutRef.current) {
26
+ clearTimeout(scrollTimeoutRef.current);
27
+ }
28
+
29
+ scrollTimeoutRef.current = setTimeout(() => {
30
+ setIsScrolling(false);
31
+ }, 800); // 스크롤 멈춘 후 800ms 뒤 isScrolling false
32
+ }, [checkScroll]);
33
+
19
34
  useEffect(() => {
20
35
  const container = containerRef.current;
21
36
  if (!container) return;
22
37
 
23
- container.addEventListener('scroll', checkScroll);
38
+ container.addEventListener('scroll', handleScroll);
24
39
 
25
40
  // mount 시 초기 상태 확인
26
41
  checkScroll();
27
42
 
28
43
  return () => {
29
- container.removeEventListener('scroll', checkScroll);
44
+ container.removeEventListener('scroll', handleScroll);
45
+ if (scrollTimeoutRef.current) {
46
+ clearTimeout(scrollTimeoutRef.current);
47
+ }
30
48
  };
31
- }, [checkScroll]);
49
+ }, [handleScroll, checkScroll]);
32
50
 
33
- return { containerRef, isScroll, isBottom, checkScroll };
51
+ return { containerRef, isScroll, isBottom, isScrolling, checkScroll };
34
52
  }
@@ -31,7 +31,7 @@ const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000' }) => {
31
31
  }, 300);
32
32
  };
33
33
  useEffect(() => {
34
- if (isOpen && isMobile) {
34
+ if (isOpen) {
35
35
  document.body.style.overflow = 'hidden';
36
36
  }
37
37
  else {
@@ -74,7 +74,7 @@ const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000' }) => {
74
74
  }
75
75
  }
76
76
  }, []);
77
- return (<div className="daeryuntalk-wrapper">
77
+ return (<div className="daeryuntalk-wrapper my-scroll-container">
78
78
  <DaeryuntalkToastProvider>
79
79
  <ViewportHandler />
80
80
  <DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal} centerCode={centerCode}>
@@ -44,7 +44,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
44
44
  };
45
45
 
46
46
  useEffect(() => {
47
- if (isOpen && isMobile) {
47
+ if (isOpen) {
48
48
  document.body.style.overflow = 'hidden';
49
49
  } else {
50
50
  document.body.style.overflow = '';
@@ -94,7 +94,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
94
94
  }, []);
95
95
 
96
96
  return (
97
- <div className="daeryuntalk-wrapper">
97
+ <div className="daeryuntalk-wrapper my-scroll-container">
98
98
  <DaeryuntalkToastProvider>
99
99
  <ViewportHandler />
100
100
  <DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal} centerCode={centerCode}>
@@ -58,5 +58,8 @@ export const initInitialData = {
58
58
  based_on_sales_source: '(출처: 법률신문·한국경제)',
59
59
  experience: '2025년 6월 기준',
60
60
  experience_cnt: 47243,
61
- experience_cnt_day: 76
61
+ experience_cnt_day: 76,
62
+ experience_comp: '2025년 6월 기준',
63
+ pro_type: '변호사·전문가\n·고문·전문위원',
64
+ world_office_cnt: 40
62
65
  };
@@ -58,8 +58,10 @@ export const initInitialData: IInitialDataTypes = {
58
58
  korea_lawfirm_ranking: 9,
59
59
  based_on_2024_sales: '2024년 부가가치세\n신고액 기준 매출액',
60
60
  based_on_sales_source: '(출처: 법률신문·한국경제)',
61
-
62
61
  experience: '2025년 6월 기준',
63
62
  experience_cnt: 47243,
64
- experience_cnt_day: 76
63
+ experience_cnt_day: 76,
64
+ experience_comp: '2025년 6월 기준',
65
+ pro_type: '변호사·전문가\n·고문·전문위원',
66
+ world_office_cnt: 40
65
67
  };
@@ -33,6 +33,9 @@ export interface IInitialDataTypes {
33
33
  experience: string;
34
34
  experience_cnt: number;
35
35
  experience_cnt_day: number;
36
+ experience_comp: string;
37
+ pro_type: string;
38
+ world_office_cnt: number;
36
39
  }
37
40
  export interface ICenter {
38
41
  code: string;
@@ -33,6 +33,9 @@ export interface IInitialDataTypes {
33
33
  experience: string;
34
34
  experience_cnt: number;
35
35
  experience_cnt_day: number;
36
+ experience_comp: string;
37
+ pro_type: string;
38
+ world_office_cnt: number;
36
39
  }
37
40
  export interface ICenter {
38
41
  code: string;
@@ -762,166 +762,6 @@ video {
762
762
  }
763
763
  }
764
764
 
765
- .title_large {
766
- font-size: 48px;
767
- font-weight: 800;
768
- line-height: 1.16;
769
- letter-spacing: -1.92px;
770
- }
771
-
772
- .title_medium {
773
- font-size: 32px;
774
- font-weight: 700;
775
- line-height: 1.375;
776
- letter-spacing: -1.28px;
777
- }
778
-
779
- .title_small {
780
- font-size: 28px;
781
- font-weight: 400;
782
- line-height: 1.42;
783
- letter-spacing: -1.12px;
784
- }
785
-
786
- .body_large1 {
787
- font-size: 28px;
788
- font-weight: 800;
789
- line-height: 1.42;
790
- letter-spacing: -1.12px;
791
- }
792
-
793
- .body_large2 {
794
- font-size: 28px;
795
- font-weight: 400;
796
- line-height: 1.42;
797
- letter-spacing: -1.12px;
798
- }
799
-
800
- .body_medium1 {
801
- font-size: 24px;
802
- font-weight: 700;
803
- line-height: 1.5;
804
- letter-spacing: -0.96px;
805
- }
806
-
807
- .body_medium2 {
808
- font-size: 24px;
809
- font-weight: 400;
810
- line-height: 1.5;
811
- letter-spacing: -0.96px;
812
- }
813
-
814
- .body_small1 {
815
- font-size: 20px;
816
- font-weight: 700;
817
- line-height: 1.4;
818
- letter-spacing: -0.8px;
819
- }
820
-
821
- .body_small2 {
822
- font-size: 20px;
823
- font-weight: 400;
824
- line-height: 1.4;
825
- letter-spacing: -0.8px;
826
- }
827
-
828
- .label_medium2 {
829
- font-size: 16px;
830
- font-weight: 400;
831
- line-height: 1.4;
832
- letter-spacing: -0.64px;
833
- }
834
-
835
- .title_large_mo {
836
- font-size: 24px;
837
- font-weight: 800;
838
- line-height: 1.22;
839
- letter-spacing: -0.96px;
840
- }
841
-
842
- .title_medium_mo {
843
- font-size: 20px;
844
- font-weight: 700;
845
- line-height: 1.4;
846
- letter-spacing: -0.8px;
847
- }
848
-
849
- .title_small_mo {
850
- font-size: 16px;
851
- font-weight: 400;
852
- line-height: 1.5;
853
- letter-spacing: -0.64px;
854
- }
855
-
856
- .body_large1_mo {
857
- font-size: 18px;
858
- font-weight: 800;
859
- line-height: 1.4;
860
- letter-spacing: -0.72px;
861
- }
862
-
863
- .body_large2_mo {
864
- font-size: 18px;
865
- font-weight: 400;
866
- line-height: 1.4;
867
- letter-spacing: -0.72px;
868
- }
869
-
870
- .body_medium1_mo {
871
- font-size: 16px;
872
- font-weight: 700;
873
- line-height: 1.5;
874
- letter-spacing: -0.64px;
875
- }
876
-
877
- .body_medium2_mo {
878
- font-size: 16px;
879
- font-weight: 400;
880
- line-height: 1.5;
881
- letter-spacing: -0.64px;
882
- }
883
-
884
- .body_small1_mo {
885
- font-size: 14px;
886
- font-weight: 700;
887
- line-height: 1.4;
888
- letter-spacing: -0.56px;
889
- }
890
-
891
- .body_small2_mo {
892
- font-size: 14px;
893
- font-weight: 400;
894
- line-height: 1.4;
895
- letter-spacing: -0.56px;
896
- }
897
-
898
- .label_large1_mo {
899
- font-size: 14px;
900
- font-weight: 700;
901
- line-height: 1.4;
902
- letter-spacing: -0.56px;
903
- }
904
-
905
- .label_large2_mo {
906
- font-size: 14px;
907
- font-weight: 400;
908
- line-height: 1.4;
909
- letter-spacing: -0.56px;
910
- }
911
-
912
- .swiper-scrollbar {
913
- /* border: 1px solid #b9b9b9; */
914
- /* z-index: 10; */
915
- }
916
-
917
- .swiper-scrollbar .swiper-scrollbar-drag {
918
- background: #b9b9b9;
919
- /* 스크롤바 드래그 색상 */
920
- border-radius: 0px;
921
- /* 드래그 부분 모서리 둥글게 */
922
- z-index: 10;
923
- }
924
-
925
765
  .sr-only {
926
766
  position: absolute;
927
767
  width: 1px;
@@ -6298,6 +6138,10 @@ video {
6298
6138
  padding-bottom: 12px;
6299
6139
  }
6300
6140
 
6141
+ .pb-\[16px\] {
6142
+ padding-bottom: 16px;
6143
+ }
6144
+
6301
6145
  .pb-\[200px\] {
6302
6146
  padding-bottom: 200px;
6303
6147
  }
@@ -8013,310 +7857,6 @@ body {
8013
7857
  border: none !important;
8014
7858
  }
8015
7859
 
8016
- @media not all and (min-width: 1200px) {
8017
- .max-lg2\:body_medium2_tb {
8018
- font-size: 20px;
8019
- font-weight: 400;
8020
- line-height: 1.4;
8021
- letter-spacing: -0.8px;
8022
- }
8023
- }
8024
-
8025
- @media not all and (min-width: 1024px) {
8026
- .max-lg\:body_medium2 {
8027
- font-size: 24px;
8028
- font-weight: 400;
8029
- line-height: 1.5;
8030
- letter-spacing: -0.96px;
8031
- }
8032
-
8033
- .max-lg\:title_large_tb {
8034
- font-size: 36px;
8035
- font-weight: 800;
8036
- line-height: 1.22;
8037
- letter-spacing: -1.44px;
8038
- }
8039
-
8040
- .max-lg\:title_medium_tb {
8041
- font-size: 32px;
8042
- font-weight: 700;
8043
- line-height: 1.375;
8044
- letter-spacing: -1.12px;
8045
- }
8046
-
8047
- .max-lg\:title_small_tb {
8048
- font-size: 24px;
8049
- font-weight: 400;
8050
- line-height: 1.5;
8051
- letter-spacing: -0.96px;
8052
- }
8053
-
8054
- .max-lg\:body_large1_tb {
8055
- font-size: 24px;
8056
- font-weight: 800;
8057
- line-height: 1.5;
8058
- letter-spacing: -0.96px;
8059
- }
8060
-
8061
- .max-lg\:body_large2_tb {
8062
- font-size: 24px;
8063
- font-weight: 400;
8064
- line-height: 1.5;
8065
- letter-spacing: -0.96px;
8066
- }
8067
-
8068
- .max-lg\:body_medium1_tb {
8069
- font-size: 20px;
8070
- font-weight: 700;
8071
- line-height: 1.4;
8072
- letter-spacing: -0.8px;
8073
- }
8074
-
8075
- .max-lg\:body_medium2_tb {
8076
- font-size: 20px;
8077
- font-weight: 400;
8078
- line-height: 1.4;
8079
- letter-spacing: -0.8px;
8080
- }
8081
-
8082
- .max-lg\:body_small1_tb {
8083
- font-size: 18px;
8084
- font-weight: 700;
8085
- line-height: 1.44;
8086
- letter-spacing: -0.72px;
8087
- }
8088
-
8089
- .max-lg\:body_small2_tb {
8090
- font-size: 18px;
8091
- font-weight: 400;
8092
- line-height: 1.44;
8093
- letter-spacing: -0.72px;
8094
- }
8095
- }
8096
-
8097
- @media not all and (min-width: 640px) {
8098
- .max-sm\:label_medium2 {
8099
- font-size: 16px;
8100
- font-weight: 400;
8101
- line-height: 1.4;
8102
- letter-spacing: -0.64px;
8103
- }
8104
-
8105
- .max-sm\:label_medium2_tb {
8106
- font-size: 16px;
8107
- font-weight: 400;
8108
- line-height: 1.5;
8109
- letter-spacing: -0.64px;
8110
- }
8111
-
8112
- .max-sm\:title_large_mo {
8113
- font-size: 24px;
8114
- font-weight: 800;
8115
- line-height: 1.22;
8116
- letter-spacing: -0.96px;
8117
- }
8118
-
8119
- .max-sm\:title_medium_mo {
8120
- font-size: 20px;
8121
- font-weight: 700;
8122
- line-height: 1.4;
8123
- letter-spacing: -0.8px;
8124
- }
8125
-
8126
- .max-sm\:title_small_mo {
8127
- font-size: 16px;
8128
- font-weight: 400;
8129
- line-height: 1.5;
8130
- letter-spacing: -0.64px;
8131
- }
8132
-
8133
- .max-sm\:body_large1_mo {
8134
- font-size: 18px;
8135
- font-weight: 800;
8136
- line-height: 1.4;
8137
- letter-spacing: -0.72px;
8138
- }
8139
-
8140
- .max-sm\:body_large2_mo {
8141
- font-size: 18px;
8142
- font-weight: 400;
8143
- line-height: 1.4;
8144
- letter-spacing: -0.72px;
8145
- }
8146
-
8147
- .max-sm\:body_medium1_mo {
8148
- font-size: 16px;
8149
- font-weight: 700;
8150
- line-height: 1.5;
8151
- letter-spacing: -0.64px;
8152
- }
8153
-
8154
- .max-sm\:body_medium2_mo {
8155
- font-size: 16px;
8156
- font-weight: 400;
8157
- line-height: 1.5;
8158
- letter-spacing: -0.64px;
8159
- }
8160
-
8161
- .max-sm\:body_small1_mo {
8162
- font-size: 14px;
8163
- font-weight: 700;
8164
- line-height: 1.4;
8165
- letter-spacing: -0.56px;
8166
- }
8167
-
8168
- .max-sm\:body_small2_mo {
8169
- font-size: 14px;
8170
- font-weight: 400;
8171
- line-height: 1.4;
8172
- letter-spacing: -0.56px;
8173
- }
8174
- }
8175
-
8176
- @media (min-width: 721px) {
8177
- .sm-top\:title_large_tb {
8178
- font-size: 36px;
8179
- font-weight: 800;
8180
- line-height: 1.22;
8181
- letter-spacing: -1.44px;
8182
- }
8183
-
8184
- .sm-top\:title_medium_tb {
8185
- font-size: 32px;
8186
- font-weight: 700;
8187
- line-height: 1.375;
8188
- letter-spacing: -1.12px;
8189
- }
8190
-
8191
- .sm-top\:title_small_tb {
8192
- font-size: 24px;
8193
- font-weight: 400;
8194
- line-height: 1.5;
8195
- letter-spacing: -0.96px;
8196
- }
8197
-
8198
- .sm-top\:body_large1_tb {
8199
- font-size: 24px;
8200
- font-weight: 800;
8201
- line-height: 1.5;
8202
- letter-spacing: -0.96px;
8203
- }
8204
-
8205
- .sm-top\:body_large2_tb {
8206
- font-size: 24px;
8207
- font-weight: 400;
8208
- line-height: 1.5;
8209
- letter-spacing: -0.96px;
8210
- }
8211
-
8212
- .sm-top\:body_medium1_tb {
8213
- font-size: 20px;
8214
- font-weight: 700;
8215
- line-height: 1.4;
8216
- letter-spacing: -0.8px;
8217
- }
8218
-
8219
- .sm-top\:body_medium2_tb {
8220
- font-size: 20px;
8221
- font-weight: 400;
8222
- line-height: 1.4;
8223
- letter-spacing: -0.8px;
8224
- }
8225
-
8226
- .sm-top\:body_small2_tb {
8227
- font-size: 18px;
8228
- font-weight: 400;
8229
- line-height: 1.44;
8230
- letter-spacing: -0.72px;
8231
- }
8232
-
8233
- .sm-top\:label_large1_tb {
8234
- font-size: 18px;
8235
- font-weight: 700;
8236
- line-height: 1.44;
8237
- letter-spacing: -0.72px;
8238
- }
8239
-
8240
- .sm-top\:label_large2_tb {
8241
- font-size: 18px;
8242
- font-weight: 400;
8243
- line-height: 1.44;
8244
- letter-spacing: -0.72px;
8245
- }
8246
- }
8247
-
8248
- @media (min-width: 1024px) {
8249
- .lg\:title_large {
8250
- font-size: 48px;
8251
- font-weight: 800;
8252
- line-height: 1.16;
8253
- letter-spacing: -1.92px;
8254
- }
8255
-
8256
- .lg\:title_medium {
8257
- font-size: 32px;
8258
- font-weight: 700;
8259
- line-height: 1.375;
8260
- letter-spacing: -1.28px;
8261
- }
8262
-
8263
- .lg\:title_small {
8264
- font-size: 28px;
8265
- font-weight: 400;
8266
- line-height: 1.42;
8267
- letter-spacing: -1.12px;
8268
- }
8269
-
8270
- .lg\:body_large1 {
8271
- font-size: 28px;
8272
- font-weight: 800;
8273
- line-height: 1.42;
8274
- letter-spacing: -1.12px;
8275
- }
8276
-
8277
- .lg\:body_large2 {
8278
- font-size: 28px;
8279
- font-weight: 400;
8280
- line-height: 1.42;
8281
- letter-spacing: -1.12px;
8282
- }
8283
-
8284
- .lg\:body_medium1 {
8285
- font-size: 24px;
8286
- font-weight: 700;
8287
- line-height: 1.5;
8288
- letter-spacing: -0.96px;
8289
- }
8290
-
8291
- .lg\:body_medium2 {
8292
- font-size: 24px;
8293
- font-weight: 400;
8294
- line-height: 1.5;
8295
- letter-spacing: -0.96px;
8296
- }
8297
-
8298
- .lg\:body_small2 {
8299
- font-size: 20px;
8300
- font-weight: 400;
8301
- line-height: 1.4;
8302
- letter-spacing: -0.8px;
8303
- }
8304
-
8305
- .lg\:label_large1 {
8306
- font-size: 20px;
8307
- font-weight: 700;
8308
- line-height: 1.4;
8309
- letter-spacing: -0.8px;
8310
- }
8311
-
8312
- .lg\:label_large2 {
8313
- font-size: 20px;
8314
- font-weight: 400;
8315
- line-height: 1.4;
8316
- letter-spacing: -0.8px;
8317
- }
8318
- }
8319
-
8320
7860
  .placeholder\:text-\[\#555555\]::-moz-placeholder {
8321
7861
  --tw-text-opacity: 1;
8322
7862
  color: rgb(85 85 85 / var(--tw-text-opacity, 1));
@@ -16132,6 +15672,11 @@ body {
16132
15672
  height: auto;
16133
15673
  }
16134
15674
 
15675
+ .sm\:h-fit {
15676
+ height: -moz-fit-content;
15677
+ height: fit-content;
15678
+ }
15679
+
16135
15680
  .sm\:w-\[100\%\] {
16136
15681
  width: 100%;
16137
15682
  }