Skip to content

Commit 2781c8d

Browse files
committed
Make timeline work on mobile
1 parent b159e57 commit 2781c8d

File tree

3 files changed

+55
-27
lines changed

3 files changed

+55
-27
lines changed

src/components/Footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CONTACT_EMAIL, CONTACT_NAME, SOCIAL_MEDIA_LINKS } from "../consts";
55
<footer>
66
<div>
77
<p class="contact-header">Contact</p>
8-
<p class="contact-name">{CONTACT_NAME}</p>
8+
<p class="contact-name">Team Liaison: {CONTACT_NAME}</p>
99
<p>Email: <a href={`mailto:${CONTACT_EMAIL}`}>{CONTACT_EMAIL}</a></p>
1010
</div>
1111
<div class="social-links">

src/components/timeline/TimelineItem.astro

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const { title } = Astro.props;
88
</div>
99

1010
<style lang="scss">
11+
@import "../../styles/common.scss";
12+
1113
$dotSize: 12px;
1214
$row-gap: 1rem;
1315
$col-gap: 1rem;
@@ -16,11 +18,14 @@ const { title } = Astro.props;
1618
div {
1719
display: block;
1820
position: relative;
19-
min-width: 50%;
20-
max-width: 50%;
2121
padding-top: $row-gap;
2222
}
2323

24+
h2 {
25+
font-weight: 600;
26+
font-size: 1.7rem;
27+
}
28+
2429
@mixin timeline-dot {
2530
position: absolute;
2631
top: $row-gap;
@@ -37,36 +42,59 @@ const { title } = Astro.props;
3742
background-color: var(--bg-color);
3843
}
3944

40-
div:nth-child(odd) {
41-
text-align: right;
42-
margin-left: 0;
43-
margin-right: auto;
44-
padding-right: $col-gap;
45+
// Styling for phones: put the line on the left and put all the text on the right
46+
@media (max-width: $tabletMinWidth) {
47+
div {
48+
text-align: left;
49+
margin-left: 0.75rem;
50+
padding-left: $col-gap;
4551

46-
border-right: $borderWidth solid var(--timeline-color);
52+
box-shadow: -$borderWidth 0px var(--timeline-color);
4753

48-
&::after {
49-
@include timeline-dot();
50-
right: -$dotSize;
54+
&::before {
55+
@include timeline-dot();
56+
left: -$dotSize;
57+
}
5158
}
5259
}
5360

54-
div:nth-child(even) {
55-
text-align: left;
56-
margin-left: auto;
57-
margin-right: 0;
58-
padding-left: $col-gap;
61+
// Styling for tablets and bigger screens: put the line in the middle and put the
62+
// text on the left and right of the line, alternating
63+
@media (min-width: $tabletMinWidth) {
64+
div {
65+
display: block;
66+
position: relative;
67+
min-width: 50%;
68+
max-width: 50%;
69+
padding-top: $row-gap;
70+
}
71+
72+
div:nth-child(odd) {
73+
text-align: right;
74+
margin-left: 0;
75+
margin-right: auto;
76+
padding-right: $col-gap;
5977

60-
box-shadow: -$borderWidth 0px var(--timeline-color);
78+
border-right: $borderWidth solid var(--timeline-color);
6179

62-
&::before {
63-
@include timeline-dot();
64-
left: -$dotSize;
80+
&::after {
81+
@include timeline-dot();
82+
right: -$dotSize;
83+
}
6584
}
66-
}
6785

68-
h2 {
69-
font-weight: 600;
70-
font-size: 1.7rem;
86+
div:nth-child(even) {
87+
text-align: left;
88+
margin-left: auto;
89+
margin-right: 0;
90+
padding-left: $col-gap;
91+
92+
box-shadow: -$borderWidth 0px var(--timeline-color);
93+
94+
&::before {
95+
@include timeline-dot();
96+
left: -$dotSize;
97+
}
98+
}
7199
}
72100
</style>

src/consts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
export const SITE_TITLE = "CYB3RL4NG";
55
export const SITE_DESCRIPTION = "Website for Team CYB3RL4NG";
66

7-
export const CONTACT_NAME = "Team Liaison";
8-
export const CONTACT_EMAIL = "[email protected]";
7+
export const CONTACT_NAME = "Terra Oh";
8+
export const CONTACT_EMAIL = "[email protected]";
99

1010
export const PAGES = [
1111
{ link: "/about", name: "About", leetName: "AB0UT" },

0 commit comments

Comments
 (0)