Skip to content

Commit ba11498

Browse files
polmfenric4000
andauthored
Fixes mobile (#208)
Co-authored-by: enric4000 <enric.andujar@gmail.com>
1 parent 290d6b7 commit ba11498

8 files changed

Lines changed: 1011 additions & 956 deletions

File tree

public/maons_mobile.svg

Lines changed: 937 additions & 937 deletions
Loading

src/app/components/During.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const DuringContainer = styled(Section)`
1414
z-index: 1;
1515
`;
1616

17+
const StyledSectionTitle = styled(SectionTitle)`
18+
margin-bottom: 0px;
19+
`;
20+
1721
const StyledBody = styled(Body)`
1822
display: flex;
1923
flex-direction: column;
@@ -61,6 +65,12 @@ const MobileMapImage = styled(MapImageBase)`
6165
@media (min-width: ${MobileBreakpoint}) {
6266
display: none;
6367
}
68+
69+
@media (max-width: ${MobileBreakpoint}) {
70+
width: 100vw;
71+
margin-left: calc(50% - 50vw);
72+
margin-right: calc(50% - 50vw);
73+
}
6474
`;
6575

6676
const DesktopMapImage = styled(MapImageBase)`
@@ -72,7 +82,9 @@ const DesktopMapImage = styled(MapImageBase)`
7282
export default function During() {
7383
return (
7484
<DuringContainer id="during">
75-
<SectionTitle className={lora.className}>DURING THE EVENT</SectionTitle>
85+
<StyledSectionTitle className={lora.className}>
86+
DURING THE EVENT
87+
</StyledSectionTitle>
7688
<StyledBody>
7789
Coding is the main part of HackUPC, but we have many more activities!
7890
</StyledBody>

src/app/components/FAQs.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const ColumnsQuestions = styled.div`
7676
7777
@media (max-width: ${MobileBreakpoint}) {
7878
width: 100%;
79+
gap: 0px;
7980
}
8081
`;
8182

@@ -86,6 +87,12 @@ const QuestionsBlock = styled.div`
8687
gap: ${SpacingS};
8788
`;
8889

90+
const ApplicationQuestionsBlock = styled(QuestionsBlock)`
91+
@media (max-width: ${MobileBreakpoint}) {
92+
padding-top: 0px;
93+
}
94+
`;
95+
8996
const Question = styled.div`
9097
display: flex;
9198
flex-direction: column;
@@ -404,10 +411,10 @@ export default function FAQs() {
404411
</ColumnsQuestions>
405412

406413
<ColumnsQuestions>
407-
<QuestionsBlock>
414+
<ApplicationQuestionsBlock>
408415
<BlockTitleStyled>Applications</BlockTitleStyled>
409416
{applications_faqs.map(renderFaq)}
410-
</QuestionsBlock>
417+
</ApplicationQuestionsBlock>
411418

412419
<QuestionsBlock>
413420
<BlockTitleStyled>Teams</BlockTitleStyled>

src/app/components/Footer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ import {
2222
} from "@fortawesome/free-brands-svg-icons";
2323

2424
const FooterWrapper = styled.div`
25-
width: 100vw;
25+
width: 100%;
2626
background-color: #65936d;
27+
margin-top: -1px;
2728
`;
2829

2930
const SocialsAndOthers = styled.div`

src/app/components/Hero.tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,27 @@ const CharactersSection = styled.div`
174174

175175
const RibbonContainer = styled.div`
176176
position: absolute;
177-
top: -120px;
177+
top: -130px;
178178
left: 50%;
179179
transform: translateX(-50%);
180180
width: 100%;
181181
display: flex;
182182
justify-content: center;
183+
184+
@media (max-width: ${MobileBreakpoint}) {
185+
top: -70px;
186+
}
183187
`;
184188

185189
const RibbonImageWrapper = styled.div`
186190
position: relative;
187191
width: clamp(320px, 95vw, 620px);
188192
aspect-ratio: 45 / 8;
193+
194+
@media (max-width: ${MobileBreakpoint}) {
195+
width: clamp(360px, 100vw, 620px);
196+
aspect-ratio: 45 / 6;
197+
}
189198
`;
190199

191200
const CharacterGrid = styled.div`
@@ -195,7 +204,7 @@ const CharacterGrid = styled.div`
195204
justify-content: center;
196205
197206
@media (max-width: ${MobileBreakpoint}) {
198-
gap: 70px;
207+
gap: 40px;
199208
margin-top: 220px;
200209
}
201210
`;
@@ -218,8 +227,8 @@ const CharacterCard = styled.div`
218227
}
219228
220229
@media (max-width: ${MobileBreakpoint}) {
221-
width: 42%;
222-
max-width: 150px;
230+
width: 150px;
231+
flex: 0 0 150px;
223232
}
224233
`;
225234

@@ -252,12 +261,22 @@ const ComingSoon = styled.div`
252261
25% 0%,
253262
10% 12%
254263
);
264+
265+
@media (max-width: ${MobileBreakpoint}) {
266+
inset: auto 0 0 0;
267+
height: 85%;
268+
border-top-left-radius: 60px;
269+
border-top-right-radius: 60px;
270+
letter-spacing: 1px;
271+
font-size: 14px;
272+
}
255273
`;
256274

257275
const StackedImages = styled.div`
258276
position: relative;
259277
width: 100%;
260278
height: 230px;
279+
flex-shrink: 0;
261280
display: flex;
262281
justify-content: center;
263282
align-items: flex-end;
@@ -275,6 +294,7 @@ const CharacterImg = styled(Image)`
275294
position: relative;
276295
z-index: 2;
277296
width: 70%;
297+
height: auto;
278298
margin-bottom: 30px;
279299
filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
280300
`;

src/app/components/ThroughTheYears.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ export default function ThroughTheYears() {
422422
</Link>
423423
</Flower2017fSection>
424424
<Flower2016wSection>
425-
<Link href="https://w2016.hackupc.com" passHref>
425+
<Link href="https://f2016.hackupc.com" passHref>
426426
<Image
427-
src="/ThroughTheYears/2016w.svg"
428-
alt="2016w Image"
427+
src="/ThroughTheYears/2016f.svg"
428+
alt="2016f Image"
429429
width={75}
430430
height={150}
431431
/>

src/app/genericComponents/EmblaCarousel.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import styled from "styled-components";
99
import Image from "next/image";
1010
import Link from "next/link";
1111
import useEmblaCarousel from "embla-carousel-react";
12+
import { MaxScreenSize } from "./tokens";
1213

1314
type Edition = {
1415
url: string;
@@ -23,8 +24,9 @@ type PropType = {
2324
const Embla = styled.div`
2425
position: relative;
2526
display: flex;
26-
max-width: 100%;
27-
margin: 0 auto;
27+
justify-content: center;
28+
align-items: center;
29+
width: 100%;
2830
padding-top: 20px;
2931
background-color: #65936d;
3032
--slide-spacing: 1rem;
@@ -37,6 +39,8 @@ const Embla = styled.div`
3739

3840
const EmblaViewport = styled.div`
3941
overflow: hidden;
42+
max-width: ${MaxScreenSize};
43+
width: 100%;
4044
`;
4145

4246
const EmblaContainer = styled.div`
@@ -80,6 +84,16 @@ const ArrowButton = styled.button`
8084
justify-content: center;
8185
`;
8286

87+
const RightArrowButton = styled(ArrowButton)`
88+
margin-left: 10px;
89+
margin-right: 20px;
90+
`;
91+
92+
const LeftArrowButton = styled(ArrowButton)`
93+
margin-left: 20px;
94+
margin-right: 10px;
95+
`;
96+
8397
const EmblaCarousel: React.FC<PropType> = ({ slides, options }) => {
8498
const [emblaRef, emblaApi] = useEmblaCarousel(options, []);
8599

@@ -112,14 +126,14 @@ const EmblaCarousel: React.FC<PropType> = ({ slides, options }) => {
112126

113127
return (
114128
<Embla>
115-
<ArrowButton className="embla__prev" onClick={scrollPrev}>
129+
<LeftArrowButton className="embla__prev" onClick={scrollPrev}>
116130
<Image
117131
src="/ThroughTheYears/LeftArrow.svg"
118132
alt="Previous"
119133
width="100"
120134
height="75"
121135
/>
122-
</ArrowButton>
136+
</LeftArrowButton>
123137
<EmblaViewport ref={emblaRef}>
124138
<EmblaContainer>
125139
{slides.map((edition, index) => (
@@ -147,14 +161,14 @@ const EmblaCarousel: React.FC<PropType> = ({ slides, options }) => {
147161
))}
148162
</EmblaContainer>
149163
</EmblaViewport>
150-
<ArrowButton className="embla__next" onClick={scrollNext}>
164+
<RightArrowButton className="embla__next" onClick={scrollNext}>
151165
<Image
152166
src="/ThroughTheYears/RightArrow.svg"
153167
alt="Next"
154168
width="100"
155169
height="75"
156170
/>
157-
</ArrowButton>
171+
</RightArrowButton>
158172
</Embla>
159173
);
160174
};

src/app/genericComponents/General.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
MobileBreakpoint,
66
SpacingL,
77
SpacingM,
8+
SpacingS,
89
} from "@/app/genericComponents/tokens";
910

1011
interface SectionProps {
@@ -22,7 +23,7 @@ export const SectionBackground = styled.div<SectionProps>`
2223
`;
2324

2425
export const Section = styled.div`
25-
padding: ${SpacingL};
26+
padding: ${SpacingM};
2627
display: flex;
2728
flex-direction: column;
2829
align-items: center;
@@ -39,7 +40,7 @@ export const Section = styled.div`
3940
export const WhiteContainer = styled.div`
4041
background-color: rgba(255, 255, 255, 0.51);
4142
border-radius: 10px;
42-
padding: ${SpacingM};
43+
padding: ${SpacingS};
4344
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
4445
display: flex;
4546
flex-direction: column;

0 commit comments

Comments
 (0)