Skip to content

Commit 3f53152

Browse files
authored
Merge pull request #107 from Lemoncode/90--Add-responsive-design-for-app-and-static-pages
90 add responsive design for app and static pages
2 parents 06950b2 + 22a0d14 commit 3f53152

11 files changed

Lines changed: 278 additions & 39 deletions

File tree

‎front/src/common-app/components/appbar/appbar.component.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export const AppbarComponent: React.FC<Props> = ({ showLinks }) => {
1515
link,
1616
logo,
1717
} = classes;
18-
console.log(showLinks);
18+
1919
return (
2020
<div className={appbarContainer}>
21-
<CodePasterLogo className={logo} />
21+
<CodePasterLogo className={logo(showLinks)} />
2222
{showLinks && (
2323
<nav className={navContainer}>
2424
<ul className={navList}>

‎front/src/common-app/components/appbar/appbar.styles.ts‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,44 @@ export const appbarContainer = css`
1414
white 90%
1515
);
1616
border-bottom: 2px solid ${palette.text.primary};
17+
18+
@media (max-width: 578px) {
19+
height: auto;
20+
min-height: ${spacing(86)};
21+
flex-direction: column;
22+
justify-content: center;
23+
align-items: center;
24+
background-image: linear-gradient(60deg, white, white);
25+
}
1726
`;
1827

19-
export const logo = css`
28+
export const logo = (showLinks: boolean): string => css`
2029
margin-top: ${spacing(5)};
2130
height: ${spacing(60)};
2231
fill: ${palette.text.primary};
2332
margin-left: 2.4rem;
33+
34+
@media (max-width: 578px) {
35+
margin-left: 0;
36+
margin-top: ${showLinks ? '1.5rem' : '0'};
37+
}
2438
`;
2539

2640
export const navContainer = css`
2741
margin-left: auto;
42+
43+
@media (max-width: 578px) {
44+
margin-left: 0;
45+
}
2846
`;
2947

3048
export const navList = css`
3149
display: flex;
3250
list-style: none;
51+
52+
@media (max-width: 578px) {
53+
padding: 0;
54+
}
3355
`;
3456

3557
export const listItem = css`
@@ -38,6 +60,10 @@ export const listItem = css`
3860
3961
&:last-of-type {
4062
margin-right: 2.4rem;
63+
64+
@media (max-width: 578px) {
65+
margin-right: 0;
66+
}
4167
}
4268
`;
4369

‎front/src/common-app/components/footer/footer.styles.ts‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ export const footerContainer = css`
99
height: ${spacing(300)};
1010
padding: ${spacing(20)} ${spacing(100)};
1111
background-color: ${palette.text.primary};
12+
13+
@media (max-width: 728px) {
14+
padding: ${spacing(20)} ${spacing(40)} ${spacing(30)} ${spacing(40)};
15+
}
16+
17+
@media (max-width: 380px) {
18+
height: ${spacing(350)};
19+
}
1220
`;
1321

1422
export const topContainer = css`
@@ -17,6 +25,13 @@ export const topContainer = css`
1725
justify-content: space-between;
1826
height: ${spacing(195)};
1927
align-items: center;
28+
29+
@media (max-width: 380px) {
30+
flex-direction: column-reverse;
31+
align-items: center;
32+
justify-content: center;
33+
height: ${spacing(220)};
34+
}
2035
`;
2136

2237
export const topContainerCenter = css`
@@ -31,6 +46,11 @@ export const linkList = css`
3146
padding: 0;
3247
margin: 0;
3348
list-style: none;
49+
50+
@media (max-width: 380px) {
51+
text-align: center;
52+
margin-top: 1.2rem;
53+
}
3454
`;
3555

3656
export const link = css`
@@ -47,6 +67,12 @@ export const bottomContainer = css`
4767
justify-content: space-between;
4868
border-top: 1px solid #d9d900;
4969
padding-top: 1rem;
70+
71+
@media (max-width: 380px) {
72+
flex-direction: column;
73+
align-items: center;
74+
justify-content: center;
75+
}
5076
`;
5177

5278
export const lemoncodeIcon = css`
@@ -90,4 +116,7 @@ export const githubIcon = css`
90116

91117
export const copyright = css`
92118
color: #eee;
119+
@media (max-width: 380px) {
120+
margin-top: 0.4rem;
121+
}
93122
`;

‎front/src/pods/create-session/create-session.styles.ts‎

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { css } from 'emotion';
22
import { theme } from 'core/theme';
33
import background from 'assets/bg-create-session.png';
4-
const { spacing, breakpoints } = theme;
4+
5+
const { spacing, breakpoints, palette } = theme;
56

67
export const mainContainer = css`
78
position: relative;
@@ -14,9 +15,15 @@ export const mainContainer = css`
1415
padding: 0;
1516
width: 100%;
1617
height: calc(100vh - ${spacing(86)});
17-
@media screen and (max-width: ${breakpoints.values.md}px) {
18+
@media screen and (max-width: 960px) {
1819
background-image: none;
1920
}
21+
22+
@media (max-width: 578px) {
23+
height: calc(100vh - ${spacing(147)});
24+
width: 90%;
25+
margin: 0 auto;
26+
}
2027
`;
2128

2229
export const buttonContainer = css`
@@ -29,12 +36,22 @@ export const buttonContainer = css`
2936
margin-left: auto;
3037
margin-right: auto;
3138
}
39+
@media (max-width: 960px) {
40+
margin-left: auto;
41+
}
3242
`;
3343

3444
export const descriptionText = css`
3545
text-align: center;
3646
font-size: 1.8rem;
3747
font-weight: 400;
48+
49+
@media (max-width: 578px) {
50+
font-size: 1.6rem;
51+
}
52+
@media (max-width: 380px) {
53+
font-size: 1.5rem;
54+
}
3855
`;
3956

4057
export const createSessionBtn = css`
@@ -58,9 +75,27 @@ export const createSessionBtn = css`
5875
color: white;
5976
outline: none;
6077
}
78+
@media (max-width: 578px) {
79+
color: white;
80+
background: none;
81+
background-color: rgb(255, 87, 51);
82+
border: none;
83+
&:hover,
84+
&:active {
85+
background-color: ${palette.text.primary};
86+
outline: none;
87+
}
88+
}
89+
@media (max-width: 380px) {
90+
padding: ${spacing(20)} ${spacing(24)};
91+
font-size: 1.2rem;
92+
}
6193
`;
6294

6395
export const arrowIcon = css`
6496
margin-left: 0.8rem;
6597
font-size: 2rem;
98+
@media (max-width: 380px) {
99+
font-size: 1.6rem;
100+
}
66101
`;

‎front/src/pods/student/student.styles.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ const { typography, spacing, palette } = theme;
55
export const mainContainer = css`
66
width: 60%;
77
margin: ${spacing(80)} auto;
8+
9+
@media (max-width: 728px) {
10+
width: 80%;
11+
}
812
`;
913

1014
export const studentBoard = css`
1115
box-sizing: border-box;
1216
font-size: 16px;
1317
width: 100%;
18+
white-space: nowrap;
1419
margin-bottom: ${spacing(10)};
1520
margin-top: ${spacing(10)};
1621
padding: ${spacing(16)};
@@ -31,6 +36,7 @@ export const labelTextarea = css`
3136

3237
export const sessionName = css`
3338
font-size: 18px;
39+
text-align: center;
3440
margin-bottom: ${spacing(40)};
3541
padding-bottom: 5px;
3642
border-bottom: 2px solid #d9d900;

‎front/src/pods/trainer/components/header.styles.ts‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export const inputIconContainer = css`
3030

3131
export const textArea = css`
3232
font-family: ${typography.fontFamily};
33+
min-width: 0;
3334
color: ${palette.text.primary};
35+
margin-right: 0;
3436
border: 2px solid #ccc;
3537
border-top-left-radius: 0.4rem;
3638
border-bottom-left-radius: 0.4rem;
@@ -46,11 +48,18 @@ export const textArea = css`
4648
&::selection {
4749
background: #ccc;
4850
}
49-
margin-right: 0%;
51+
52+
@media (max-width: 380px) {
53+
font-size: 14px;
54+
padding: 16px;
55+
}
5056
`;
5157

5258
export const copyIcon = css`
5359
font-size: 30px;
60+
@media (max-width: 380px) {
61+
font-size: 26px;
62+
}
5463
`;
5564

5665
export const copyBtn = css`
@@ -71,4 +80,9 @@ export const copyBtn = css`
7180
&:active {
7281
background-color: #fff;
7382
}
83+
84+
@media (max-width: 380px) {
85+
height: 52px;
86+
width: 52px;
87+
}
7488
`;

‎front/src/pods/trainer/components/new-text.styles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const labelTextarea = css`
1717
export const editTextArea = css`
1818
box-sizing: border-box;
1919
font-size: 16px;
20+
white-space: nowrap;
2021
width: 100%;
2122
margin-bottom: ${spacing(20)};
2223
margin-top: ${spacing(10)};

‎front/src/pods/trainer/components/session.styles.ts‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const studentBoard = css`
1111
box-sizing: border-box;
1212
font-size: 16px;
1313
width: 100%;
14+
white-space: nowrap;
1415
margin-bottom: ${spacing(10)};
1516
margin-top: ${spacing(10)};
1617
padding: ${spacing(16)};
@@ -42,18 +43,32 @@ export const sendBtn = css`
4243
background-color: white;
4344
border: 2px solid #11ae64;
4445
color: #11ae64;
45-
transition: 1ll 0.2s;
46+
transition: all 0.2s;
4647
&:hover,
4748
&:active {
4849
background-color: #11ae64;
4950
border: 2px solid #11ae64;
5051
color: white;
52+
outline: none;
53+
}
54+
@media (max-width: 380px) {
55+
background-color: #11ae64;
56+
color: white;
57+
border: none;
58+
}
59+
&:hover,
60+
&:active {
61+
background-color: #0f834c;
62+
border: none;
5163
}
5264
`;
5365

5466
export const sendIcon = css`
5567
font-size: 20px;
5668
margin-left: 10px;
69+
@media (max-width: 380px) {
70+
display: none;
71+
}
5772
`;
5873

5974
export const undoBtn = css`
@@ -68,18 +83,32 @@ export const undoBtn = css`
6883
background-color: white;
6984
border: 2px solid rgb(255, 87, 51);
7085
color: rgb(255, 87, 51);
71-
transition: 1ll 0.2s;
86+
transition: all 0.2s;
7287
&:hover,
7388
&:active {
7489
background-color: rgb(255, 87, 51);
7590
border: 2px solid rgb(255, 87, 51);
7691
color: white;
92+
outline: none;
93+
}
94+
@media (max-width: 380px) {
95+
background-color: rgb(255, 87, 51);
96+
color: white;
97+
border: none;
98+
}
99+
&:hover,
100+
&:active {
101+
background-color: rgb(207, 70, 41);
102+
border: none;
77103
}
78104
`;
79105

80106
export const undoIcon = css`
81107
font-size: 20px;
82108
margin-right: 10px;
109+
@media (max-width: 380px) {
110+
display: none;
111+
}
83112
`;
84113

85114
export const labelTextarea = css`

‎front/src/pods/trainer/trainer.styles.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ export const backgroundContainer = css`
1111
export const content = css`
1212
width: 60%;
1313
margin: 0px auto 0 auto;
14+
15+
@media (max-width: 728px) {
16+
width: 80%;
17+
}
1418
`;

0 commit comments

Comments
 (0)