53 |
{React.array(pngImage)}
54 |
{React.array(faceFeatures)}
55 |
59 |
60 | {Belt.Array.map(settings, o =>
61 | {
70 | let key: Types.key = switch o.id {
71 | | #Skin => #SkinColor
72 | | #Hair => #HairColor
73 | | #FacialHair => #FacialHairColor
74 | | #Body => #BodyColor
75 | | #Background => #BackgroundColor
76 | | _ => Js.Exn.raiseError("ColorNotFound: " ++ Types.idToJs(o.id))
77 | }
78 |
79 | onChange(key, color)
80 | }}
81 | onSelectStyle={style => {
82 | let key: Types.key = switch o.id {
83 | | #Skin => #SkinStyle
84 | | #Hair => #HairStyle
85 | | #FacialHair => #FacialHairStyle
86 | | #Body => #BodyStyle
87 | | #Eyes => #EyesStyle
88 | | #Mouth => #MouthStyle
89 | | #Nose => #NoseStyle
90 | | _ => Js.Exn.raiseError("StyleNotFound: " ++ Types.idToJs(o.id))
91 | }
92 | onChange(key, style)
93 | }}
94 | />
95 | )->React.array}
96 |
97 |
100 |
101 |

102 |
103 | {React.string("Want to make your own?")}
104 |
105 |
106 | {React.string("Get the Sketch file on Gumroad.")}
107 |
108 |
109 |
110 |
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/src/components/Button.css:
--------------------------------------------------------------------------------
1 | .Button {
2 | padding: 16px;
3 | border: none;
4 | border-radius: 8px;
5 | box-shadow: 0 2px 3px 0 rgba(16, 22, 64, 0.12);
6 | background-color: #ffffff;
7 | text-decoration: none;
8 | }
9 |
10 | @media (min-width: 768px) {
11 | .Button--github {
12 | position: absolute;
13 | top: 20px;
14 | right: 20px;
15 | }
16 | }
17 |
18 | .Button-icon {
19 | margin-right: 12px;
20 | display: inline-block;
21 | vertical-align: middle;
22 | }
23 |
24 | .Button-label {
25 | font-family: "CerebriSans-Medium";
26 | font-size: 14px;
27 | font-weight: 500;
28 | font-style: normal;
29 | font-stretch: normal;
30 | line-height: normal;
31 | letter-spacing: normal;
32 | color: #73859d;
33 | vertical-align: middle;
34 | }
35 |
--------------------------------------------------------------------------------
/src/components/Button.res:
--------------------------------------------------------------------------------
1 | %raw(`require('./Button.css')`)
2 |
3 | @react.component
4 | let make = (~style=?, ~label, ~href) =>
5 |