Skip to content

Commit 43ed195

Browse files
author
wfbn8821
committed
fix: Fix transition issue
1 parent 3455bd4 commit 43ed195

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

lib/assets/styles.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,34 @@
66
position: absolute;
77
transition: left 1s cubic-bezier(0, 0.7, 0.7, 1), z-index 1s cubic-bezier(0, 0.7, 0.7, 1);
88
box-sizing: border-box; }
9+
._1H7C65wd8WJqBtCRmAfokb .rcs-center:after {
10+
content: "";
11+
position: absolute;
12+
top: 0;
13+
left: 0;
14+
right: 0;
15+
margin-left: 0.9375rem;
16+
margin-right: 0.9375rem;
17+
height: 100%;
18+
background-color: #fff;
19+
opacity: 0;
20+
transition: opacity 1s, z-index 0s 1s;
21+
z-index: -1; }
922
._1H7C65wd8WJqBtCRmAfokb .rcs-left-stack:after, ._1H7C65wd8WJqBtCRmAfokb .rcs-right-stack:after {
1023
content: "";
1124
position: absolute;
1225
top: 0;
1326
left: 0;
1427
right: 0;
28+
margin-left: 0.9375rem;
29+
margin-right: 0.9375rem;
1530
height: 100%;
1631
background-color: #fff;
32+
opacity: 0;
33+
transition: opacity 1s, z-index 0s 1s;
1734
opacity: 0.7;
18-
transition: opacity 1s cubic-bezier(0, 0.7, 0.7, 1); }
35+
z-index: 0;
36+
transition: opacity 1s, z-index 0s; }
1937

2038
._22yQcZhJvmCSA52vE9VrUe {
2139
position: fixed;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-card-scroll",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "A React component to navigate horizontally between cards of same width",
55
"main": "lib/index.js",
66
"scripts": {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let CardScroll = React.createClass({
9292
</div>
9393
:null}
9494

95-
95+
9696
<div className={s.container}
9797
style={{marginLeft: this.maxOffset, marginRight: this.maxOffset}}
9898
ref={updateContainer}>

src/styles.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,32 @@ $grid-gutter-width: 1.875rem !default; // 30px
1717
z-index 1s cubic-bezier(0,.7,.7,1);
1818
box-sizing: border-box;
1919
}
20-
:global(.rcs-left-stack):after, :global(.rcs-right-stack):after{
20+
@mixin overlay{
2121
content: "";
2222
position: absolute;
2323
top: 0;
2424
left: 0;
2525
right: 0;
26+
margin-left: ($grid-gutter-width / 2);
27+
margin-right: ($grid-gutter-width / 2);
2628
height: 100%;
2729
background-color: #fff;
30+
opacity: 0;
31+
transition:
32+
opacity 1s,
33+
z-index 0s 1s;
34+
35+
}
36+
:global(.rcs-center):after{
37+
@include overlay;
38+
z-index: -1;
39+
40+
}
41+
:global(.rcs-left-stack):after, :global(.rcs-right-stack):after{
42+
@include overlay;
2843
opacity: 0.7;
29-
transition: opacity 1s cubic-bezier(0,.7,.7,1);
44+
z-index: 0;
45+
transition: opacity 1s, z-index 0s;
3046
}
3147
}
3248

0 commit comments

Comments
 (0)