-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
HomepageLayout.js
341 lines (314 loc) · 10.3 KB
/
HomepageLayout.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/* eslint-disable max-classes-per-file */
/* eslint-disable react/no-multi-comp */
import { createMedia } from '@artsy/fresnel'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { InView } from 'react-intersection-observer'
import {
Button,
Container,
Divider,
Grid,
Header,
Icon,
Image,
List,
Menu,
Segment,
Sidebar,
} from 'semantic-ui-react'
const { MediaContextProvider, Media } = createMedia({
breakpoints: {
mobile: 0,
tablet: 768,
computer: 1024,
},
})
/* Heads up!
* HomepageHeading uses inline styling, however it's not the best practice. Use CSS or styled
* components for such things.
*/
const HomepageHeading = ({ mobile }) => (
<Container text>
<Header
as='h1'
content='Imagine-a-Company'
inverted
style={{
fontSize: mobile ? '2em' : '4em',
fontWeight: 'normal',
marginBottom: 0,
marginTop: mobile ? '1.5em' : '3em',
}}
/>
<Header
as='h2'
content='Do whatever you want when you want to.'
inverted
style={{
fontSize: mobile ? '1.5em' : '1.7em',
fontWeight: 'normal',
marginTop: mobile ? '0.5em' : '1.5em',
}}
/>
<Button primary size='huge'>
Get Started
<Icon name='right arrow' />
</Button>
</Container>
)
HomepageHeading.propTypes = {
mobile: PropTypes.bool,
}
/* Heads up!
* Neither Semantic UI nor Semantic UI React offer a responsive navbar, however, it can be implemented easily.
* It can be more complicated, but you can create really flexible markup.
*/
class DesktopContainer extends Component {
state = {}
toggleFixedMenu = (inView) => this.setState({ fixed: !inView })
render() {
const { children } = this.props
const { fixed } = this.state
return (
<Media greaterThan='mobile'>
<InView onChange={this.toggleFixedMenu}>
<Segment
inverted
textAlign='center'
style={{ minHeight: 700, padding: '1em 0em' }}
vertical
>
<Menu
fixed={fixed ? 'top' : null}
inverted={!fixed}
pointing={!fixed}
secondary={!fixed}
size='large'
>
<Container>
<Menu.Item as='a' active>
Home
</Menu.Item>
<Menu.Item as='a'>Work</Menu.Item>
<Menu.Item as='a'>Company</Menu.Item>
<Menu.Item as='a'>Careers</Menu.Item>
<Menu.Item position='right'>
<Button as='a' inverted={!fixed}>
Log in
</Button>
<Button as='a' inverted={!fixed} primary={fixed} style={{ marginLeft: '0.5em' }}>
Sign Up
</Button>
</Menu.Item>
</Container>
</Menu>
<HomepageHeading />
</Segment>
</InView>
{children}
</Media>
)
}
}
DesktopContainer.propTypes = {
children: PropTypes.node,
}
class MobileContainer extends Component {
state = {}
handleSidebarHide = () => this.setState({ sidebarOpened: false })
handleToggle = () => this.setState({ sidebarOpened: true })
render() {
const { children } = this.props
const { sidebarOpened } = this.state
return (
<Media as={Sidebar.Pushable} at='mobile'>
<Sidebar.Pushable>
<Sidebar
as={Menu}
animation='overlay'
inverted
onHide={this.handleSidebarHide}
vertical
visible={sidebarOpened}
>
<Menu.Item as='a' active>
Home
</Menu.Item>
<Menu.Item as='a'>Work</Menu.Item>
<Menu.Item as='a'>Company</Menu.Item>
<Menu.Item as='a'>Careers</Menu.Item>
<Menu.Item as='a'>Log in</Menu.Item>
<Menu.Item as='a'>Sign Up</Menu.Item>
</Sidebar>
<Sidebar.Pusher dimmed={sidebarOpened}>
<Segment
inverted
textAlign='center'
style={{ minHeight: 350, padding: '1em 0em' }}
vertical
>
<Container>
<Menu inverted pointing secondary size='large'>
<Menu.Item onClick={this.handleToggle}>
<Icon name='sidebar' />
</Menu.Item>
<Menu.Item position='right'>
<Button as='a' inverted>
Log in
</Button>
<Button as='a' inverted style={{ marginLeft: '0.5em' }}>
Sign Up
</Button>
</Menu.Item>
</Menu>
</Container>
<HomepageHeading mobile />
</Segment>
{children}
</Sidebar.Pusher>
</Sidebar.Pushable>
</Media>
)
}
}
MobileContainer.propTypes = {
children: PropTypes.node,
}
const ResponsiveContainer = ({ children }) => (
/* Heads up!
* For large applications it may not be best option to put all page into these containers at
* they will be rendered twice for SSR.
*/
<MediaContextProvider>
<DesktopContainer>{children}</DesktopContainer>
<MobileContainer>{children}</MobileContainer>
</MediaContextProvider>
)
ResponsiveContainer.propTypes = {
children: PropTypes.node,
}
const HomepageLayout = () => (
<ResponsiveContainer>
<Segment style={{ padding: '8em 0em' }} vertical>
<Grid container stackable verticalAlign='middle'>
<Grid.Row>
<Grid.Column width={8}>
<Header as='h3' style={{ fontSize: '2em' }}>
We Help Companies and Companions
</Header>
<p style={{ fontSize: '1.33em' }}>
We can give your company superpowers to do things that they never thought possible.
Let us delight your customers and empower your needs... through pure data analytics.
</p>
<Header as='h3' style={{ fontSize: '2em' }}>
We Make Bananas That Can Dance
</Header>
<p style={{ fontSize: '1.33em' }}>
Yes that's right, you thought it was the stuff of dreams, but even bananas can be
bioengineered.
</p>
</Grid.Column>
<Grid.Column floated='right' width={6}>
<Image bordered rounded size='large' src='/images/wireframe/white-image.png' />
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column textAlign='center'>
<Button size='huge'>Check Them Out</Button>
</Grid.Column>
</Grid.Row>
</Grid>
</Segment>
<Segment style={{ padding: '0em' }} vertical>
<Grid celled='internally' columns='equal' stackable>
<Grid.Row textAlign='center'>
<Grid.Column style={{ paddingBottom: '5em', paddingTop: '5em' }}>
<Header as='h3' style={{ fontSize: '2em' }}>
"What a Company"
</Header>
<p style={{ fontSize: '1.33em' }}>That is what they all say about us</p>
</Grid.Column>
<Grid.Column style={{ paddingBottom: '5em', paddingTop: '5em' }}>
<Header as='h3' style={{ fontSize: '2em' }}>
"I shouldn't have gone with their competitor."
</Header>
<p style={{ fontSize: '1.33em' }}>
<Image avatar src='/images/avatar/large/nan.jpg' />
<b>Nan</b> Chief Fun Officer Acme Toys
</p>
</Grid.Column>
</Grid.Row>
</Grid>
</Segment>
<Segment style={{ padding: '8em 0em' }} vertical>
<Container text>
<Header as='h3' style={{ fontSize: '2em' }}>
Breaking The Grid, Grabs Your Attention
</Header>
<p style={{ fontSize: '1.33em' }}>
Instead of focusing on content creation and hard work, we have learned how to master the
art of doing nothing by providing massive amounts of whitespace and generic content that
can seem massive, monolithic and worth your attention.
</p>
<Button as='a' size='large'>
Read More
</Button>
<Divider
as='h4'
className='header'
horizontal
style={{ margin: '3em 0em', textTransform: 'uppercase' }}
>
<a href='#'>Case Studies</a>
</Divider>
<Header as='h3' style={{ fontSize: '2em' }}>
Did We Tell You About Our Bananas?
</Header>
<p style={{ fontSize: '1.33em' }}>
Yes I know you probably disregarded the earlier boasts as non-sequitur filler content, but
it's really true. It took years of gene splicing and combinatory DNA research, but our
bananas can really dance.
</p>
<Button as='a' size='large'>
I'm Still Quite Interested
</Button>
</Container>
</Segment>
<Segment inverted vertical style={{ padding: '5em 0em' }}>
<Container>
<Grid divided inverted stackable>
<Grid.Row>
<Grid.Column width={3}>
<Header inverted as='h4' content='About' />
<List link inverted>
<List.Item as='a'>Sitemap</List.Item>
<List.Item as='a'>Contact Us</List.Item>
<List.Item as='a'>Religious Ceremonies</List.Item>
<List.Item as='a'>Gazebo Plans</List.Item>
</List>
</Grid.Column>
<Grid.Column width={3}>
<Header inverted as='h4' content='Services' />
<List link inverted>
<List.Item as='a'>Banana Pre-Order</List.Item>
<List.Item as='a'>DNA FAQ</List.Item>
<List.Item as='a'>How To Access</List.Item>
<List.Item as='a'>Favorite X-Men</List.Item>
</List>
</Grid.Column>
<Grid.Column width={7}>
<Header as='h4' inverted>
Footer Header
</Header>
<p>
Extra space for a call to action inside the footer that could help re-engage users.
</p>
</Grid.Column>
</Grid.Row>
</Grid>
</Container>
</Segment>
</ResponsiveContainer>
)
export default HomepageLayout