forked from revery-ui/revery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Boxshadow.re
61 lines (55 loc) · 1.07 KB
/
Boxshadow.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
open Revery;
open Revery.UI;
let parentStyles =
Style.[
position(`Relative),
flexGrow(1),
alignItems(`Center),
justifyContent(`Center),
flexDirection(`Column),
];
let firstBoxStyle =
Style.[
backgroundColor(Colors.blue),
position(`Relative),
width(100),
height(100),
];
let secondBoxStyle =
Style.[
backgroundColor(Colors.red),
position(`Relative),
width(100),
height(100),
];
let firstShadow =
Style.BoxShadow.make(
~yOffset=-10.,
~xOffset=0.,
~blurRadius=15.,
~color=Colors.black,
~spreadRadius=10.,
(),
);
let secondShadow =
Style.BoxShadow.make(
~yOffset=10.,
~xOffset=-30.,
~blurRadius=20.,
~color=Colors.green,
~spreadRadius=0.,
(),
);
let render = () =>
<View style=parentStyles>
<Padding padding=30>
<BoxShadow boxShadow=firstShadow>
<View style=firstBoxStyle />
</BoxShadow>
</Padding>
<Padding padding=30>
<BoxShadow boxShadow=secondShadow>
<View style=secondBoxStyle />
</BoxShadow>
</Padding>
</View>;