Skip to content

Commit 7f3f40d

Browse files
fixing responssiveness of the landing page
1 parent 9794df4 commit 7f3f40d

File tree

3 files changed

+232
-1
lines changed

3 files changed

+232
-1
lines changed

client/src/pages/Home/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import securedPlatform from "../../assets/web-security 2.svg";
1313
import realTimeResults from "../../assets/pie-chart 1.svg";
1414
import { AuthContext } from "../../components/Context/AuthorizationContext";
1515
import "./styles.css";
16+
import "./responsive.css";
1617

1718
const Home = () => {
1819
const { user } = useContext(AuthContext);
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
/* Home Page Responsive Styles */
2+
3+
/* Large screens */
4+
@media screen and (max-width: 1200px) {
5+
.landing-page-text h2 {
6+
width: 80%;
7+
}
8+
9+
.our-features-cards {
10+
width: 90%;
11+
}
12+
}
13+
14+
/* Medium screens */
15+
@media screen and (max-width: 992px) {
16+
.landing-page-description {
17+
flex-direction: column;
18+
gap: 2rem;
19+
}
20+
21+
.landing-page-text,
22+
.politician-img-container {
23+
width: 90%;
24+
text-align: center;
25+
}
26+
27+
.landing-page-text h2 {
28+
width: 100%;
29+
}
30+
31+
.landing-page-btn-container {
32+
justify-content: center;
33+
}
34+
35+
.politician-img-container {
36+
padding: 2rem;
37+
order: 2;
38+
}
39+
40+
.landing-page-cards {
41+
flex-direction: column;
42+
height: auto;
43+
padding: 4rem 0 1rem;
44+
gap: 1.5rem;
45+
}
46+
47+
.card {
48+
border-radius: 10px;
49+
width: 90%;
50+
margin: 0 auto;
51+
}
52+
53+
.landing-page-cards-text {
54+
height: auto;
55+
padding: 3rem 1rem;
56+
text-align: center;
57+
}
58+
59+
.our-features-cards {
60+
flex-direction: column;
61+
width: 90%;
62+
align-items: center;
63+
}
64+
65+
.our-features-card {
66+
width: 100%;
67+
max-width: 350px;
68+
}
69+
70+
.about-us-body {
71+
flex-direction: column;
72+
align-items: center;
73+
}
74+
75+
.about-us-body>div,
76+
.about-us-body img {
77+
width: 90%;
78+
}
79+
}
80+
81+
/* Tablet */
82+
@media screen and (max-width: 768px) {
83+
.landing-page-container {
84+
gap: 4rem;
85+
}
86+
87+
.landing-page-cards-container {
88+
margin-top: -3rem;
89+
}
90+
91+
.landing-page-text h2 {
92+
font-size: calc(var(--font-size-header-2) * 0.85);
93+
}
94+
95+
.landing-page-text p {
96+
font-size: calc(var(--font-size-header-4) * 0.9);
97+
}
98+
99+
.card {
100+
height: auto;
101+
padding: 1.5rem;
102+
flex-direction: column;
103+
}
104+
105+
.card-text {
106+
width: 100%;
107+
height: auto;
108+
text-align: center;
109+
align-items: center;
110+
}
111+
112+
.our-features-header>p {
113+
width: 90%;
114+
}
115+
116+
.about-us-list {
117+
flex-direction: column;
118+
align-items: center;
119+
text-align: center;
120+
}
121+
122+
.rounded-number {
123+
margin: 0 auto 1rem auto;
124+
}
125+
126+
.our-features-card {
127+
animation-delay: 0.2s !important;
128+
}
129+
130+
.our-features-card:nth-child(2) {
131+
animation-delay: 0.4s !important;
132+
}
133+
134+
.our-features-card:nth-child(3) {
135+
animation-delay: 0.6s !important;
136+
}
137+
}
138+
139+
/* Mobile */
140+
@media screen and (max-width: 576px) {
141+
.landing-page-container {
142+
gap: 3rem;
143+
}
144+
145+
.landing-page-cards-container {
146+
margin-top: -2rem;
147+
}
148+
149+
.landing-page-cards {
150+
padding: 2rem 0 1rem;
151+
}
152+
153+
.our-features-header h2,
154+
.about-us-text h2,
155+
.faqs-title {
156+
font-size: calc(var(--font-size-header-2) * 0.8);
157+
padding: 0 1rem;
158+
text-align: center;
159+
}
160+
161+
.faqs-title {
162+
height: auto;
163+
padding: 2rem 1rem;
164+
}
165+
166+
.politician-img-container {
167+
padding: 1rem;
168+
}
169+
170+
.card {
171+
width: 95%;
172+
padding: 1rem;
173+
}
174+
175+
.landing-page-text h2 {
176+
font-size: calc(var(--font-size-header-2) * 0.75);
177+
}
178+
179+
.about-us-text {
180+
padding: 1.5rem;
181+
}
182+
183+
.our-features-header p {
184+
width: 100%;
185+
}
186+
}
187+
188+
/* Very small screens */
189+
@media screen and (max-width: 400px) {
190+
.card {
191+
width: 98%;
192+
padding: 0.75rem;
193+
}
194+
195+
.card img {
196+
max-width: 70px;
197+
}
198+
199+
.our-features-card {
200+
height: auto;
201+
padding: 1rem;
202+
}
203+
204+
.about-us-body>div {
205+
min-width: auto;
206+
}
207+
}

client/src/pages/Home/styles.css

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
animation: slideInRight 1s ease-out;
6464
}
6565

66+
.politician-img-container img {
67+
width: 100%;
68+
}
69+
6670
.landing-page-text {
6771
display: flex;
6872
flex-direction: column;
@@ -286,6 +290,19 @@
286290
margin-bottom: 2.5rem;
287291
}
288292

293+
.rounded-number {
294+
display: flex;
295+
align-items: center;
296+
justify-content: center;
297+
background-color: var(--primary-color);
298+
color: white;
299+
width: 35px;
300+
height: 35px;
301+
min-width: 35px;
302+
border-radius: 50%;
303+
font-weight: var(--font-weight-bold);
304+
}
305+
289306
div>h4 {
290307
font-size: var(--font-size-header-4);
291308
}
@@ -450,6 +467,10 @@ div>h4 {
450467

451468
/* Footer Responsive Design */
452469
@media screen and (max-width: 968px) {
470+
.landing-page-text{
471+
margin-top: 5rem;
472+
}
473+
453474
.footer-content {
454475
flex-wrap: wrap;
455476
gap: 2rem;
@@ -513,4 +534,6 @@ div>h4 {
513534
100% {
514535
transform: translateY(0px);
515536
}
516-
}
537+
}
538+
539+
/* Responsive Design for Home Page can be found in responsive.css */

0 commit comments

Comments
 (0)