overlapping-cards-scroll 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/react-native-web.cjs +22 -4
- package/dist/react-native-web.js +21 -3
- package/dist/react-native.cjs +257 -30
- package/dist/react-native.js +258 -30
- package/dist/types/rn/OverlappingCardsScrollRN.native.d.ts +4 -26
- package/dist/types/rn/OverlappingCardsScrollRN.types.d.ts +74 -0
- package/dist/types/rn/OverlappingCardsScrollRN.web.d.ts +4 -18
- package/package.json +8 -3
- package/src/lib/OverlappingCardsScroll.css +206 -0
- package/src/lib/OverlappingCardsScroll.tsx +943 -0
- package/src/lib/index.ts +10 -0
- package/src/rn/OverlappingCardsScrollRN.native.tsx +868 -0
- package/src/rn/OverlappingCardsScrollRN.types.ts +102 -0
- package/src/rn/OverlappingCardsScrollRN.web.tsx +90 -0
- package/src/rn/RNWebDemo.tsx +241 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
.overlapping-cards-scroll {
|
|
2
|
+
width: 100%;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
flex: 1;
|
|
7
|
+
min-height: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ocs-stage-frame {
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
position: relative;
|
|
14
|
+
flex: 1;
|
|
15
|
+
min-height: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ocs-stage {
|
|
19
|
+
width: 100%;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
position: relative;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
overscroll-behavior-x: none;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ocs-scroll-region {
|
|
28
|
+
position: absolute;
|
|
29
|
+
inset: 0;
|
|
30
|
+
z-index: 2;
|
|
31
|
+
width: 100%;
|
|
32
|
+
min-width: 0;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
overflow-x: auto;
|
|
35
|
+
overflow-y: hidden;
|
|
36
|
+
overscroll-behavior-x: none;
|
|
37
|
+
scrollbar-width: none;
|
|
38
|
+
-webkit-overflow-scrolling: touch;
|
|
39
|
+
background: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ocs-scroll-region::-webkit-scrollbar {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ocs-scroll-region::-webkit-scrollbar-thumb {
|
|
47
|
+
background: rgba(28, 45, 76, 0.45);
|
|
48
|
+
border-radius: 999px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ocs-track {
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset: 0;
|
|
54
|
+
z-index: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ocs-scroll-spacer {
|
|
58
|
+
height: 1px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ocs-card {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 0;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
will-change: transform;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ocs-card--focus-transition {
|
|
71
|
+
transition-property: transform;
|
|
72
|
+
transition-timing-function: cubic-bezier(0.22, 0.8, 0.2, 1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ocs-card > * {
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ocs-page-dots {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
width: 100%;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 0.5rem;
|
|
87
|
+
z-index: 5;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ocs-page-dots--overlay {
|
|
91
|
+
position: absolute;
|
|
92
|
+
left: 50%;
|
|
93
|
+
transform: translateX(-50%);
|
|
94
|
+
width: auto;
|
|
95
|
+
padding: 0.22rem 0.45rem;
|
|
96
|
+
border-radius: 999px;
|
|
97
|
+
background: rgba(255, 255, 255, 0.72);
|
|
98
|
+
backdrop-filter: blur(4px);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ocs-page-dot {
|
|
102
|
+
appearance: none;
|
|
103
|
+
width: 0.62rem;
|
|
104
|
+
height: 0.62rem;
|
|
105
|
+
margin: 0;
|
|
106
|
+
padding: 0;
|
|
107
|
+
border: 0;
|
|
108
|
+
border-radius: 999px;
|
|
109
|
+
background: #1f4666;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
transition: opacity 130ms ease, transform 130ms ease, filter 130ms ease;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ocs-page-dot:hover {
|
|
115
|
+
filter: brightness(1.1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ocs-page-dot:focus-visible {
|
|
119
|
+
outline: 2px solid rgba(16, 57, 93, 0.52);
|
|
120
|
+
outline-offset: 2px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ocs-focus-trigger {
|
|
124
|
+
appearance: none;
|
|
125
|
+
align-self: flex-start;
|
|
126
|
+
margin: 0;
|
|
127
|
+
border: 1px solid rgba(30, 67, 99, 0.25);
|
|
128
|
+
border-radius: 999px;
|
|
129
|
+
background: #f3f8ff;
|
|
130
|
+
color: #1f4666;
|
|
131
|
+
font-size: 0.78rem;
|
|
132
|
+
line-height: 1;
|
|
133
|
+
font-weight: 700;
|
|
134
|
+
letter-spacing: 0.04em;
|
|
135
|
+
padding: 0.34rem 0.6rem;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ocs-focus-trigger:hover {
|
|
141
|
+
transform: translateY(-1px);
|
|
142
|
+
background: #e8f2ff;
|
|
143
|
+
border-color: rgba(20, 72, 118, 0.35);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ocs-focus-trigger:disabled {
|
|
147
|
+
opacity: 0.5;
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ocs-tabs {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
width: 100%;
|
|
155
|
+
align-items: center;
|
|
156
|
+
gap: 0.4rem;
|
|
157
|
+
z-index: 5;
|
|
158
|
+
overflow-x: auto;
|
|
159
|
+
scrollbar-width: none;
|
|
160
|
+
-webkit-overflow-scrolling: touch;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ocs-tabs::-webkit-scrollbar {
|
|
164
|
+
display: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.ocs-tab {
|
|
168
|
+
appearance: none;
|
|
169
|
+
margin: 0;
|
|
170
|
+
border: 1px solid rgba(30, 67, 99, 0.2);
|
|
171
|
+
border-radius: 999px;
|
|
172
|
+
background: #f3f8ff;
|
|
173
|
+
color: #1f4666;
|
|
174
|
+
font-size: 0.78rem;
|
|
175
|
+
line-height: 1;
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
letter-spacing: 0.02em;
|
|
178
|
+
padding: 0.34rem 0.72rem;
|
|
179
|
+
white-space: nowrap;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
transition: opacity 160ms ease, background 160ms ease,
|
|
182
|
+
border-color 160ms ease, transform 160ms ease;
|
|
183
|
+
flex-shrink: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ocs-tab:hover {
|
|
187
|
+
background: #e8f2ff;
|
|
188
|
+
border-color: rgba(20, 72, 118, 0.35);
|
|
189
|
+
transform: translateY(-1px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ocs-tab--active {
|
|
193
|
+
background: #1f4666;
|
|
194
|
+
color: #fff;
|
|
195
|
+
border-color: #1f4666;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.ocs-tab--active:hover {
|
|
199
|
+
background: #2a5a80;
|
|
200
|
+
border-color: #2a5a80;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.ocs-tab:focus-visible {
|
|
204
|
+
outline: 2px solid rgba(16, 57, 93, 0.52);
|
|
205
|
+
outline-offset: 2px;
|
|
206
|
+
}
|