Skip to content

Commit 3fce492

Browse files
committed
fixing storybook with the recent changes
1 parent 66d6ab0 commit 3fce492

File tree

2 files changed

+88
-20
lines changed

2 files changed

+88
-20
lines changed

examples/storybooks/side-stack.js

+40-9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import img7 from '../shared/img/7.jpg';
1212

1313
class App extends Component {
1414
render() {
15+
const layerStyle = {
16+
transformOrigin: '50% 100%',
17+
};
18+
1519
return (
1620
<IsometricGrid
1721
transform="scale3d(0.8,0.8,1) rotateY(45deg) rotateZ(-10deg)"
@@ -33,15 +37,42 @@ class App extends Component {
3337
width: '800px',
3438
}}
3539
>
36-
<Cell layers={[img1, '#9972fc', '#c322a3', '#9eb5c2']} />
37-
<Cell layers={[img2, '#9972fc', '#c322a3', '#9eb5c2']} />
38-
<Cell layers={[img3, '#9972fc', '#c322a3', '#9eb5c2']} />
39-
<Cell layers={[img4, '#9972fc', '#c322a3', '#9eb5c2']} />
40-
<Cell layers={[img5, '#9972fc', '#c322a3', '#9eb5c2']} />
41-
<Cell layers={[img6, '#9972fc', '#c322a3', '#9eb5c2']} />
42-
<Cell layers={[img7, '#9972fc', '#c322a3', '#9eb5c2']} />
43-
<Cell layers={[img1, '#9972fc', '#c322a3', '#9eb5c2']} />
44-
<Cell layers={[img2, '#9972fc', '#c322a3', '#9eb5c2']} />
40+
<Cell
41+
layerStyle={layerStyle}
42+
layers={[img1, '#9972fc', '#c322a3', '#9eb5c2']}
43+
/>
44+
<Cell
45+
layerStyle={layerStyle}
46+
layers={[img2, '#9972fc', '#c322a3', '#9eb5c2']}
47+
/>
48+
<Cell
49+
layerStyle={layerStyle}
50+
layers={[img3, '#9972fc', '#c322a3', '#9eb5c2']}
51+
/>
52+
<Cell
53+
layerStyle={layerStyle}
54+
layers={[img4, '#9972fc', '#c322a3', '#9eb5c2']}
55+
/>
56+
<Cell
57+
layerStyle={layerStyle}
58+
layers={[img5, '#9972fc', '#c322a3', '#9eb5c2']}
59+
/>
60+
<Cell
61+
layerStyle={layerStyle}
62+
layers={[img6, '#9972fc', '#c322a3', '#9eb5c2']}
63+
/>
64+
<Cell
65+
layerStyle={layerStyle}
66+
layers={[img7, '#9972fc', '#c322a3', '#9eb5c2']}
67+
/>
68+
<Cell
69+
layerStyle={layerStyle}
70+
layers={[img1, '#9972fc', '#c322a3', '#9eb5c2']}
71+
/>
72+
<Cell
73+
layerStyle={layerStyle}
74+
layers={[img2, '#9972fc', '#c322a3', '#9eb5c2']}
75+
/>
4576
</IsometricGrid>
4677
);
4778
}

examples/storybooks/spread.js

+48-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ class App extends Component {
1919
const cellStyle = {
2020
border: '20px solid #fff',
2121
borderWidth: '40px 20px',
22-
boxShadow: '-1px 1px 5px rgba(0, 0, 0, 0.08)',
22+
boxShadow: '-1px 1px 5px rgba(0, 0, 0, 0.1)',
23+
};
24+
25+
const style = {
26+
transformStyle: 'flat',
27+
padding: '20px',
2328
};
2429

2530
return (
@@ -28,8 +33,8 @@ class App extends Component {
2833
stackItemsAnimation={{
2934
properties() {
3035
return {
31-
translateX: getRandomInt(-20, 20),
32-
translateY: getRandomInt(-20, 20),
36+
translateX: getRandomInt(-60, 60),
37+
translateY: getRandomInt(-60, 60),
3338
rotateZ: getRandomInt(-10, 10),
3439
};
3540
},
@@ -50,14 +55,46 @@ class App extends Component {
5055
width: '800px',
5156
}}
5257
>
53-
<Cell layerStyle={cellStyle} layers={[img7, img1, img6, img1]} />
54-
<Cell layerStyle={cellStyle} layers={[img2, img1, img4, img5]} />
55-
<Cell layerStyle={cellStyle} layers={[img7, img5, img1, img1]} />
56-
<Cell layerStyle={cellStyle} layers={[img3, img3, img3, img3]} />
57-
<Cell layerStyle={cellStyle} layers={[img5, img7, img5, img4]} />
58-
<Cell layerStyle={cellStyle} layers={[img3, img6, img5, img5]} />
59-
<Cell layerStyle={cellStyle} layers={[img6, img1, img3, img4]} />
60-
<Cell layerStyle={cellStyle} layers={[img1, img5, img2, img7]} />
58+
<Cell
59+
style={style}
60+
layerStyle={cellStyle}
61+
layers={[img7, img1, img6, img1]}
62+
/>
63+
<Cell
64+
style={style}
65+
layerStyle={cellStyle}
66+
layers={[img2, img1, img4, img5]}
67+
/>
68+
<Cell
69+
style={style}
70+
layerStyle={cellStyle}
71+
layers={[img7, img5, img1, img1]}
72+
/>
73+
<Cell
74+
style={style}
75+
layerStyle={cellStyle}
76+
layers={[img3, img3, img3, img3]}
77+
/>
78+
<Cell
79+
style={style}
80+
layerStyle={cellStyle}
81+
layers={[img5, img7, img5, img4]}
82+
/>
83+
<Cell
84+
style={style}
85+
layerStyle={cellStyle}
86+
layers={[img3, img6, img5, img5]}
87+
/>
88+
<Cell
89+
style={style}
90+
layerStyle={cellStyle}
91+
layers={[img6, img1, img3, img4]}
92+
/>
93+
<Cell
94+
style={style}
95+
layerStyle={cellStyle}
96+
layers={[img1, img5, img2, img7]}
97+
/>
6198
</IsometricGrid>
6299
);
63100
}

0 commit comments

Comments
 (0)