Skip to content

Commit e3f182a

Browse files
committed
Fixed most things for mobile
1 parent 5deca79 commit e3f182a

12 files changed

Lines changed: 363 additions & 229 deletions

File tree

src/components/About.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
import React from "react";
22
import { makeStyles } from "@material-ui/core/styles";
3-
import Avatar from "@material-ui/core/Avatar";
43
import Grid from "@material-ui/core/Grid";
5-
import { fontSans, slate, orange } from "./PageStyles";
4+
import { fontSans, slate } from "./PageStyles";
65
import { SectionHeader, StyledLink } from "./Common";
76

87
const smallScreen = window.screen.height < 850;
8+
const thinScreen = window.screen.width < 950;
99

1010
const useStyles = makeStyles((theme) => ({
1111
root: {
1212
margin: "auto",
1313
marginTop: "50vh",
14-
maxWidth: "60%",
14+
width: (props) => (props.thinScreen ? "95%" : "60%"),
1515
},
1616
grid: {
1717
marginTop: "5vh",
1818
},
19+
gridItem: {
20+
minWidth: (props) => (props.thinScreen ? "100%" : "auto"),
21+
},
1922
about: {
2023
fontFamily: fontSans,
2124
fontSize: "1.2em",
2225
color: slate,
2326
position: "relative",
2427
top: "50%",
2528
transform: "translateY(-50%)",
26-
lineHeight: "1.6",
29+
lineHeight: (props) => (props.thinScreen ? "1.2" : "1.6"),
2730
},
2831
imgWrapper: {
2932
// TODO: make this image prettier
3033
display: "block",
3134
position: "relative",
35+
width: (props) => (props.thinScreen ? "100%" : "auto"),
3236
// width: '100%',
3337
// borderRadius: '5px',
3438
// backgroundColor: orange,
@@ -67,13 +71,13 @@ const useStyles = makeStyles((theme) => ({
6771
}));
6872

6973
export default function About(props) {
70-
const classes = useStyles({ smallScreen });
74+
const classes = useStyles({ smallScreen, thinScreen });
7175

7276
return (
7377
<div className={classes.root} id="about">
7478
<SectionHeader number="1" text="About Me" />
7579
<Grid container spacing={3} className={classes.grid}>
76-
<Grid item xs={8}>
80+
<Grid item xs={8} className={classes.gridItem}>
7781
<div className={classes.about}>
7882
Hello! My name is Jeremy and I write code that lives and runs on
7983
hardware. Specifically, I enjoy writing code for robots, 3D
@@ -97,9 +101,9 @@ export default function About(props) {
97101
</div>
98102
</Grid>
99103

100-
<Grid item xs={4}>
104+
<Grid item xs={4} className={classes.gridItem}>
101105
<div className={classes.imgWrapper}>
102-
<img rounded src="static/avatar.jpeg" className={classes.avatar} />
106+
<img src="static/avatar.jpeg" alt="Avatar" className={classes.avatar} />
103107
</div>
104108
</Grid>
105109
</Grid>

src/components/Common.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Button from "@material-ui/core/Button";
33
import { makeStyles, withStyles } from "@material-ui/core/styles";
44
import { orange, slightOrange, fontMono, llslate } from "./PageStyles";
55

6+
const thinScreen = window.screen.width < 950;
7+
68
const StyledButton = withStyles({
79
root: {
810
color: orange,
@@ -16,13 +18,13 @@ const StyledButton = withStyles({
1618

1719
const sectionHeaderStyles = makeStyles((theme) => ({
1820
root: {
19-
width: "80%",
20-
lineHeight: "0.1em",
21+
width: "100%",
22+
// lineHeight: "0.1em",
2123
// borderBottom: `1px solid ${slate}`,
22-
margin: "10px 0 20px",
24+
margin: (props) => (props.thinScreen ? "10px 0 0" : "10px 0 20px"),
2325
color: llslate,
2426
fontFamily: fontMono,
25-
fontSize: "2em",
27+
fontSize: (props) => (props.thinScreen ? "1.5em" : "2em"),
2628
},
2729
number: {
2830
color: orange,
@@ -36,7 +38,7 @@ const sectionHeaderStyles = makeStyles((theme) => ({
3638
}));
3739

3840
function SectionHeader(props) {
39-
const classes = sectionHeaderStyles();
41+
const classes = sectionHeaderStyles({ thinScreen });
4042

4143
return (
4244
<div>

src/components/Contact.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { makeStyles } from "@material-ui/core/styles";
33
import { fontMono, fontSans, orange, llslate, slate } from "./PageStyles";
44
import { StyledButton } from "./Common";
55

6-
const smallScreen = window.screen.height < 850;
6+
const thinScreen = window.screen.width < 750;
77

88
const useStyles = makeStyles((theme) => ({
99
root: {
@@ -27,23 +27,22 @@ const useStyles = makeStyles((theme) => ({
2727
},
2828
info: {
2929
color: slate,
30-
fontSize: "1.5em",
31-
width: "60%",
30+
fontSize: (props) => (props.thinScreen ? "1.1em" : "1.5em"),
31+
width: (props) => (props.thinScreen ? "100%" : "60%"),
3232
margin: "auto",
3333
textAlign: "center",
3434
fontFamily: fontSans,
3535
marginTop: "2vh",
3636
},
3737
centerButton: {
3838
textAlign: "center",
39-
marginTop: "4vh",
39+
marginTop: (props) => (props.thinScreen ? "8vh" : "4vh"),
4040
},
4141
outline: {
4242
borderColor: orange,
4343
},
4444
button: {
4545
fontSize: "1em",
46-
// marginRight: "2em",
4746
padding: "12px 20px 12px 20px",
4847
},
4948
footer: {
@@ -66,11 +65,11 @@ const useStyles = makeStyles((theme) => ({
6665
}));
6766

6867
export default function Contact(props) {
69-
const classes = useStyles({ smallScreen });
68+
const classes = useStyles({ thinScreen });
7069

7170
return (
7271
<div className={classes.root} id="contact">
73-
<div className={classes.sectionTitle}>04. What's next?</div>
72+
<div className={classes.sectionTitle}>03. What's next?</div>
7473
<div className={classes.subtitle}>Get In Touch</div>
7574
<div className={classes.info}>
7675
I'm not currently looking for new job opportunities, but my inbox is
@@ -95,8 +94,15 @@ export default function Contact(props) {
9594
</div>
9695

9796
<div className={classes.footer}>
98-
This site is made by Jeremy Kanovsky with React.js and some small
99-
headache.
97+
<a
98+
href="https://github.com/0xJeremy/0xJeremy.github.io"
99+
target="_blank"
100+
rel="noopener noreferrer"
101+
className={classes.a}
102+
>
103+
This site is made by Jeremy Kanovsky with React.js and some small
104+
headache.
105+
</a>
100106
</div>
101107
</div>
102108
);

src/components/Hero.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import React, { useEffect } from "react";
22
import { makeStyles } from "@material-ui/core/styles";
3-
import { Link } from "react-router-dom";
43
import { HashLink } from "react-router-hash-link";
54
import { fontMono, fontSans, orange, llslate, slate } from "./PageStyles";
6-
import { StyledButton } from "./Common";
5+
import { StyledButton, StyledLink } from "./Common";
76

87
const offsetTop = 18;
98
const smallScreen = window.screen.height < 850;
9+
const thinScreen = window.screen.width < 950;
1010

1111
const useStyles = makeStyles((theme) => ({
1212
root: {
1313
position: "relative",
1414
top: (props) =>
1515
props.smallScreen ? `${offsetTop / 3}vh` : `${offsetTop}vh`,
16-
width: "70%",
16+
width: (props) => (props.smallScreen ? "95%" : "70%"),
1717
margin: "auto",
1818
},
1919
hello: {
@@ -26,7 +26,7 @@ const useStyles = makeStyles((theme) => ({
2626
fontWeight: "600",
2727
letterSpacing: "1px",
2828
fontFamily: fontSans,
29-
fontSize: "5em",
29+
fontSize: (props) => (props.smallScreen ? "2.5em" : "5em"),
3030
},
3131
name: {
3232
color: llslate,
@@ -36,26 +36,28 @@ const useStyles = makeStyles((theme) => ({
3636
},
3737
about: {
3838
fontFamily: fontSans,
39-
fontSize: "1.2em",
39+
fontSize: (props) => (props.thinScreen ? "1.1em" : "1.2em"),
40+
marginTop: (props) => (props.thinScreen ? "16px" : 0),
4041
color: slate,
41-
maxWidth: "50%",
42+
maxWidth: (props) => (props.smallScreen ? "90%" : "50%"),
4243
},
4344
buttonGroup: {
44-
marginTop: "64px",
45+
marginTop: (props) => (props.smallScreen ? "32px" : "64px"),
4546
},
4647
outline: {
4748
borderColor: orange,
4849
},
4950
button: {
5051
float: "none",
51-
fontSize: "1em",
52+
fontSize: (props) => (props.thinScreen ? "0.8em" : "1em"),
5253
marginRight: "2em",
53-
padding: "12px 20px 12px 20px",
54+
padding: (props) =>
55+
props.thinScreen ? "6px 10px 6px 10px" : "12px 20px 12px 20px",
5456
},
5557
}));
5658

5759
export default function Hero(props) {
58-
const classes = useStyles({ smallScreen });
60+
const classes = useStyles({ smallScreen, thinScreen });
5961

6062
useEffect(() => {
6163
document.title = "Home | Jeremy Kanovsky";
@@ -72,7 +74,7 @@ export default function Hero(props) {
7274
<div className={classes.about}>
7375
I'm a Boston-based software engineer who specializes in writing code for
7476
IoT devices and robots. Sometimes, I dabble in hardware. Currently, I'm
75-
an engineer at Markforged working on the software powering
77+
an engineer at <StyledLink href="https://markforged.com/" text="Markforged" /> working on the software powering
7678
next-generation 3D printers.
7779
</div>
7880

@@ -87,15 +89,15 @@ export default function Hero(props) {
8789
</StyledButton>
8890
</HashLink>
8991

90-
<Link to="/projects" style={{ textDecoration: "none" }}>
92+
<HashLink to="/#projects" style={{ textDecoration: "none" }}>
9193
<StyledButton
9294
className={classes.button}
9395
classes={{ outlined: classes.outline }}
9496
variant="outlined"
9597
>
9698
See My Work
9799
</StyledButton>
98-
</Link>
100+
</HashLink>
99101
</div>
100102
</div>
101103
);

src/components/OtherProjects.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import * as SpacePrinter from "./projects/SpacePrinter";
2727
import * as Crawler from "./projects/Crawler";
2828
import * as DevBoard from "./projects/DevBoard";
2929

30-
const smallScreen = window.screen.height < 850;
30+
const thinScreen = window.screen.width < 750;
3131

3232
const useStyles = makeStyles((theme) => ({
3333
card: {
@@ -71,6 +71,7 @@ const useStyles = makeStyles((theme) => ({
7171
},
7272
folder: {
7373
float: "left",
74+
color: orange,
7475
},
7576
github: {
7677
float: "right",
@@ -82,7 +83,7 @@ const useStyles = makeStyles((theme) => ({
8283
}));
8384

8485
function ProjectCard(props) {
85-
const classes = useStyles();
86+
const classes = useStyles({ thinScreen });
8687
const project = props.project;
8788

8889
return (
@@ -117,26 +118,29 @@ const showcaseStyles = makeStyles((theme) => ({
117118
root: {
118119
margin: "auto",
119120
marginTop: "25vh",
120-
width: "75%",
121+
width: (props) => (props.thinScreen ? "95%" : "75%"),
121122
},
122123
sectionTitle: {
123124
textAlign: "center",
124125
fontFamily: fontMono,
125-
color: slate,
126-
fontSize: "1.5em",
126+
color: llslate,
127+
fontSize: (props) => (props.thinScreen ? "1em" : "1.5em"),
127128
fontWeight: "600",
128129
letterSpacing: "1px",
129130
},
130131
subtitle: {
131132
textAlign: "center",
132133
fontFamily: fontMono,
133134
color: orange,
134-
fontSize: "1em",
135+
fontSize: (props) => (props.thinScreen ? "0.8em" : "1em"),
135136
marginTop: "2vh",
136137
},
137138
grid: {
138139
marginTop: "4vh",
139140
},
141+
gridItem: {
142+
minWidth: (props) => (props.thinScreen ? "90vw" : "auto"),
143+
},
140144
centerButton: {
141145
textAlign: "center",
142146
marginTop: "8vh",
@@ -151,7 +155,7 @@ const showcaseStyles = makeStyles((theme) => ({
151155
}));
152156

153157
export default function Showcase(props) {
154-
const classes = showcaseStyles({ smallScreen });
158+
const classes = showcaseStyles({ thinScreen });
155159
const projects = [
156160
SocketEngine,
157161
Helios,
@@ -192,7 +196,7 @@ export default function Showcase(props) {
192196
<Grid container spacing={2} className={classes.grid}>
193197
{toShow.map((project) => {
194198
return (
195-
<Grid item xs={4}>
199+
<Grid item xs={4} className={classes.gridItem}>
196200
<ProjectCard project={project} />
197201
</Grid>
198202
);

0 commit comments

Comments
 (0)