Skip to content

Commit 62e94d9

Browse files
committed
Responsive: computer width #6
1 parent 86c5842 commit 62e94d9

File tree

4 files changed

+38
-17
lines changed

4 files changed

+38
-17
lines changed

components/SubscribeForm.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import gql from 'graphql-tag'
44
import RaisedButton from 'material-ui/RaisedButton'
55
import Dialog from 'material-ui/Dialog'
66
import FlatButton from 'material-ui/FlatButton'
7+
78
import Email from './email'
89

10+
import { iPadMaxW } from '../lib/styles'
11+
912
class SubscribeForm extends React.Component {
1013
static propTypes = {
1114
mutate: React.PropTypes.func.isRequired,
@@ -24,7 +27,7 @@ class SubscribeForm extends React.Component {
2427
componentDidMount() {
2528
// when focusing on small screens, browser sets scrollTop to make sure
2629
// input is in view, which we don't want
27-
if (window.screen.height >= 768) {
30+
if (window.screen.height >= 768 && window.screen.width > iPadMaxW) {
2831
this.formEmail.textHandler.focus()
2932
}
3033
}

css/raw.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { grey200 } from 'material-ui/styles/colors'
22

3-
import { fontFamily, color, white, black, grey } from '../lib/styles'
3+
import { fontFamily, color, white, black, grey, iPadMaxW } from '../lib/styles'
44

55
const background = '#f2f2f2'
66

7+
const macbookAirMaxW = 1279
8+
79
export default `
810
body {
911
font-family: ${fontFamily};
@@ -22,7 +24,6 @@ a {
2224
color: ${color};
2325
text-decoration: none;
2426
}
25-
2627
a:hover {
2728
text-decoration: underline;
2829
}
@@ -36,6 +37,22 @@ a:hover {
3637
}
3738
}
3839
40+
.landing-header {
41+
width: 43vw;
42+
}
43+
.book-title {
44+
margin: 5vh 0 15vh 0;
45+
}
46+
@media (max-width: ${iPadMaxW}px) {
47+
.landing-header {
48+
width: 100vw;
49+
}
50+
51+
.book-title {
52+
margin: 10px 0 20px 0;
53+
}
54+
}
55+
3956
.ripple-ball {
4057
width: 50px;
4158
height: 50px;
@@ -66,12 +83,13 @@ a:hover {
6683
width: 80px;
6784
height: 80px;
6885
}
69-
@media (max-height: 799px) {
86+
@media (max-height: 799px), (max-width: 1425px) {
7087
.logo-collection .svg-wrapper {
7188
width: 50px;
7289
height: 50px;
7390
}
7491
}
92+
7593
.logo-collection svg {
7694
width: 100%;
7795
height: 100%;

lib/styles.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ export const white = '#f9f9f9'
66
export const color = '#E10098'
77
export const black = darkBlack
88
export const grey = grey400
9+
10+
export const iPadMaxW = 1023

pages/index.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,22 @@ class Index extends Component {
123123
</title>
124124
</Head>
125125
<main
126+
className="-landing"
126127
style={{
127128
display: 'flex',
128-
flexDirection: 'row wrap',
129+
flexDirection: 'row',
130+
flexWrap: 'wrap',
129131
width: '100vw',
130-
height: '100%',
131-
minHeight: '100vh',
132132
}}
133133
>
134134
<Paper
135+
className="landing-header"
135136
zDepth={2}
136137
style={{
137138
display: 'flex',
138139
flexDirection: 'column',
139140
justifyContent: 'center',
140141
alignItems: 'center',
141-
width: '43vw',
142142
textAlign: 'center',
143143
padding: 10,
144144
backgroundColor: color,
@@ -158,14 +158,10 @@ class Index extends Component {
158158
{ // eslint-disable-next-line
159159
}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 279.4 249.6"><path id="logo-outline" d="M267.4 171.4V47.2c8.3-1.9 13.5-10.3 11.6-18.6-1.9-8.3-10.3-13.5-18.6-11.6-7 1.6-12 7.9-12 15.1 0 .4 0 .8.1 1.3L227 40.3v-9.7c8.3-1.9 13.5-10.3 11.6-18.6S228.2-1.5 219.9.4c-6 1.4-10.6 6.2-11.7 12.3-27.9 2.2-53.8 10.4-68.5 39.2-14.7-28.7-40.6-37-68.5-39.2-1.6-8.4-9.6-14-18.1-12.4s-14 9.6-12.4 18.1c1.1 6.1 5.7 10.9 11.8 12.3v9.7l-21.5-7c0-.4.1-.8.1-1.3 0-8.6-6.9-15.5-15.5-15.5S0 23.5 0 32.1c0 7.2 5 13.5 12 15.1v124.1C3.7 173.3-1.5 181.6.5 190s10.3 13.5 18.6 11.6c4-.9 7.4-3.4 9.6-6.9l95.5 37.1c-.1.7-.2 1.5-.2 2.2.4 8.6 7.7 15.1 16.3 14.7 8-.4 14.3-6.8 14.7-14.7 0-.7-.1-1.3-.1-2l95.9-37.3c4.6 7.2 14.1 9.4 21.4 4.9 7.2-4.6 9.4-14.1 4.9-21.4-2.3-3.4-5.7-5.9-9.7-6.8zm-140.8 54l-95.7-37.3c.1-.5.1-1.1.1-1.6 0-7.2-5-13.5-12-15.1V47.2c4.1-1 7.7-3.5 9.8-7.2l23.6 7.6V155c-8.3 1.9-13.5 10.3-11.6 18.6s10.3 13.5 18.6 11.6c5.3-1.2 9.6-5.2 11.3-10.4 25 4 51.5 18.1 64.6 44.2-3.5 1-6.6 3.3-8.7 6.4zm11.1-157.8V209c-15.2-24-41.6-37.2-66.4-41.1-.9-6.3-5.6-11.4-11.8-12.8V30.6c5.5-1.3 9.9-5.4 11.4-10.9 14.9 1.2 26.5 4.1 36 8.7 13.6 6.7 23.3 17.5 29.6 33.2l1.2 3.1v2.9zm4 7.3V64.7l1.2-3.1c6.3-15.7 16-26.5 29.6-33.2 9.4-4.6 21.1-7.4 35.9-8.7 1.5 5.4 5.9 9.6 11.4 10.9v124.5c-6.2 1.4-10.9 6.5-11.8 12.8-24.8 3.9-51.1 17-66.4 41.1V74.9zm118.7 96.5c-7 1.6-12 7.9-12 15.1 0 .6 0 1.1.1 1.6l-96.1 37.4c-2-3-5-5.2-8.4-6.3 13-26.1 39.6-40.3 64.7-44.3 2.6 8.2 11.3 12.7 19.5 10.1 8.2-2.6 12.7-11.3 10.1-19.5-1.7-5.2-5.9-9.2-11.3-10.4V47.7l23.7-7.6c2.2 3.6 5.7 6.2 9.8 7.2l-.1 124.1z"/><path d="M70.8 174.9c-2.6 8.2-11.3 12.7-19.5 10.1-8.2-2.6-12.7-11.3-10.1-19.5 1.7-5.2 5.9-9.2 11.3-10.4V47.7l-23.6-7.6c-2.2 3.6-5.7 6.2-9.8 7.2v124.1c7 1.6 12 7.9 12 15.1 0 .5 0 1.1-.1 1.6l95.7 37.2c2.1-3.1 5.2-5.3 8.8-6.2-13.2-26.1-39.7-40.2-64.7-44.2zM250.6 40.1l-23.7 7.6v107.4c8.3 1.9 13.5 10.3 11.6 18.6-1.9 8.3-10.3 13.5-18.6 11.6-5.3-1.2-9.6-5.2-11.3-10.4-25 4-51.6 18.2-64.7 44.3 3.4 1.1 6.4 3.3 8.4 6.3l96.1-37.4c-.1-.5-.1-1.1-.1-1.6 0-7.2 5-13.5 12-15.1V47.2c-4-.9-7.6-3.5-9.7-7.1z"/><path d="M59.5 155.1c6.2 1.4 10.9 6.5 11.9 12.8 24.8 3.9 51.1 17 66.4 41.1V64.7l-1.2-3.1c-6.3-15.7-16-26.5-29.6-33.2-9.4-4.6-21.1-7.4-36-8.7-1.5 5.4-5.9 9.6-11.4 10.9v124.5zm82.2 53.9c15.2-24.1 41.6-37.2 66.4-41.1.9-6.3 5.6-11.4 11.8-12.8V30.6c-5.5-1.3-9.9-5.4-11.4-10.9-14.9 1.3-26.5 4.1-35.9 8.7-13.6 6.7-23.3 17.5-29.6 33.2l-1.2 3.1-.1 144.3z"/></svg>
160160
</div>
161-
<div
162-
style={{
163-
margin: '5vh 0 15vh 0',
164-
}}
165-
>
161+
<div className="book-title">
166162
<h1
167163
style={{
168-
fontSize: 70,
164+
fontSize: '4vw',
169165
fontWeight: 400,
170166
margin: '0 0 20px 0',
171167
textAlign: 'center',
@@ -179,7 +175,7 @@ class Index extends Component {
179175
alignItems: 'center',
180176
justifyContent: 'center',
181177
fontWeight: 300,
182-
fontSize: 40,
178+
fontSize: '2.5vw',
183179
color: white,
184180
}}
185181
>
@@ -198,7 +194,7 @@ class Index extends Component {
198194
style={{
199195
display: 'flex',
200196
alignItems: 'center',
201-
fontSize: 22,
197+
fontSize: '1.3vw',
202198
}}
203199
>
204200
By
@@ -346,7 +342,9 @@ class Index extends Component {
346342
style={{
347343
opacity: 0,
348344
display: 'flex',
349-
flexDirection: 'row wrap',
345+
flexDirection: 'row',
346+
justifyContent: 'center',
347+
flexWrap: 'wrap',
350348
}}
351349
ref={(logos) => { this.logos = logos }}
352350
>

0 commit comments

Comments
 (0)