Skip to content

Commit fd807ad

Browse files
authored
Merge pull request #657 from cornell-dti/rwq3/responsive-landing
task: fix landing responsiveness
2 parents 60410b5 + 2b65c3e commit fd807ad

2 files changed

Lines changed: 37 additions & 55 deletions

File tree

frontend/src/pages/Landing/Landing.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Landing = ({ students, admins, drivers, ssoError }: LandingPropType) => {
2222
document.title = 'Login - Carriage';
2323
}, []);
2424
return (
25-
<main id="main">
25+
<main id="main" className={styles.pageMain}>
2626
<div className={styles.home}>
2727
<div className={styles.tosButtonContainer}>
2828
<a href={cuLiftTerms} target="_blank" rel="noreferrer">
@@ -67,7 +67,11 @@ const Landing = ({ students, admins, drivers, ssoError }: LandingPropType) => {
6767
viewBox="0 0 1200 120"
6868
preserveAspectRatio="none"
6969
>
70-
<path d={WAVE_PATH.trim()} className={styles.shapeFill}></path>
70+
<path
71+
d={WAVE_PATH.trim()}
72+
className={styles.shapeFill}
73+
transform="translate(0, 120) scale(1, -1)"
74+
/>
7175
</svg>
7276
</div>
7377
</div>

frontend/src/pages/Landing/landing.module.css

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1+
.pageMain {
2+
width: 100%;
3+
max-width: 100%;
4+
overflow-x: hidden;
5+
}
6+
17
.home {
28
position: relative;
3-
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
4-
url(./campus.jpg) no-repeat center center fixed;
5-
-webkit-background-size: cover;
6-
-moz-background-size: cover;
7-
-o-background-size: cover;
9+
background: url(./campus.jpg);
810
background-size: cover;
9-
height: 100vh;
11+
min-height: min-content;
12+
width: 100%;
1013
display: flex;
11-
flex-direction: row;
14+
flex-direction: column;
1215
justify-content: center;
13-
align-items: flex-start;
14-
padding: 0 1.25rem;
16+
align-items: center;
1517
}
1618

1719
.main {
18-
border: 1px solid black;
1920
border-radius: 16px;
20-
max-width: 850px;
21-
height: 550px;
21+
padding: 8rem 0;
2222
display: flex;
23-
flex-grow: 1;
24-
margin-top: 7.5rem;
23+
min-height: min-content;
2524
}
2625

2726
.tosButtonContainer {
@@ -106,7 +105,7 @@
106105
justify-content: space-between;
107106
align-items: center;
108107
text-align: center;
109-
padding: 8px;
108+
padding: 4rem;
110109
position: relative;
111110
}
112111

@@ -116,28 +115,6 @@
116115
align-items: center;
117116
}
118117

119-
.customShape {
120-
position: absolute;
121-
bottom: 0;
122-
left: 0;
123-
width: 100%;
124-
overflow: hidden;
125-
line-height: 0;
126-
transform: rotate(180deg);
127-
height: 15%;
128-
z-index: 10;
129-
}
130-
131-
.customShape svg {
132-
position: absolute;
133-
display: block;
134-
width: calc(142% + 1.3px);
135-
}
136-
137-
.shapeFill {
138-
fill: white;
139-
}
140-
141118
.information {
142119
position: relative;
143120
display: flex;
@@ -155,6 +132,21 @@
155132
justify-content: center;
156133
}
157134

135+
.customShape {
136+
width: 100%;
137+
padding: 0;
138+
line-height: 0;
139+
transform: translateY(2px);
140+
}
141+
142+
.customShape svg {
143+
display: block;
144+
}
145+
146+
.shapeFill {
147+
fill: white;
148+
}
149+
158150
.adminInfo p {
159151
font-size: 40px;
160152
min-width: 30%;
@@ -194,15 +186,13 @@
194186
height: 100%;
195187
}
196188

197-
/* Landing page is almost fully responsive. It still needs to vertical media queries. */
198-
199-
@media (max-width: 400px) {
189+
@media (max-width: 800px) {
200190
.container {
201191
flex-direction: column;
202192
}
203193
}
204194

205-
@media (max-width: 550px) {
195+
@media (max-width: 800px) {
206196
.main {
207197
flex-direction: column;
208198
}
@@ -214,12 +204,6 @@
214204
}
215205
}
216206

217-
@media (max-width: 600px) {
218-
.main {
219-
min-height: 0px;
220-
}
221-
}
222-
223207
@media (max-width: 1425px) {
224208
.studentInfo {
225209
flex-direction: column;
@@ -279,12 +263,6 @@
279263
}
280264
}
281265

282-
@media (max-height: 600px) {
283-
.main {
284-
min-height: 0px;
285-
}
286-
}
287-
288266
.input {
289267
width: 100%;
290268
outline: 0;

0 commit comments

Comments
 (0)