Skip to content

Commit 7f2020a

Browse files
author
Hannah Dunsmore
committed
added styling for mobile and tablet
1 parent e038dd1 commit 7f2020a

File tree

2 files changed

+92
-6
lines changed

2 files changed

+92
-6
lines changed

src/Components/RoverDetails/RoverDetails.scss

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
margin: 40px auto;
1010
font-family: $MartianMono;
1111
}
12+
#scroll-message{
13+
display: none;
14+
}
1215
}
1316

1417
#rover-button-container {
1518
display: flex;
1619
justify-content: space-between;
1720
margin: 0 auto;
18-
width: 30vw;
21+
width: 50vw;
1922
font-family: $PublicSans;
2023
button {
2124
all: unset;
@@ -30,13 +33,95 @@
3033
margin: 10px 0;
3134
color: whitesmoke;
3235
}
33-
.selected-rover {
34-
span {
35-
text-decoration: underline;
36-
}
37-
}
3836
}
37+
.selected-rover {
38+
span {
39+
text-decoration: underline;
40+
}
41+
}
3942
img {
4043
width: 150px;
4144
}
4245
}
46+
47+
// Media Queries
48+
49+
@media(min-width: 1440px) {
50+
#rover-button-container {
51+
width: 40vw;
52+
}
53+
}
54+
55+
@media(max-width: 898px) {
56+
#rover-button-container {
57+
width: 65vw;
58+
}
59+
}
60+
61+
@media(max-width: 766px) {
62+
#rover-information-container {
63+
#rover-header {
64+
margin: 40px auto 15px auto;
65+
}
66+
#scroll-message{
67+
display: block;
68+
color: whitesmoke;
69+
font-family: $MartianMono;
70+
font-size: 12px;
71+
text-align: center;
72+
}
73+
}
74+
#rover-button-container {
75+
width:20vw;
76+
}
77+
78+
.button-carousel {
79+
display: flex;
80+
overflow-x: auto;
81+
gap: 1rem;
82+
padding: 1rem;
83+
scroll-snap-type: x mandatory;
84+
85+
button {
86+
flex: 0 0 auto;
87+
scroll-snap-align: start;
88+
89+
}
90+
}
91+
}
92+
93+
@media(max-width: 425px) {
94+
95+
#rover-header {
96+
margin: 15px auto;
97+
}
98+
#rover-button-container {
99+
width: 35vw;
100+
}
101+
102+
.button-carousel {
103+
display: flex;
104+
overflow-x: auto;
105+
gap: 1rem;
106+
padding: 1rem;
107+
scroll-snap-type: x mandatory;
108+
109+
button {
110+
flex: 0 0 auto;
111+
scroll-snap-align: start;
112+
113+
}
114+
}
115+
}
116+
117+
@media(max-width: 376px) {
118+
#rover-button-container {
119+
width: 40vw;
120+
}
121+
}
122+
123+
@media(max-width: 320px) {
124+
#rover-button-container {
125+
width: 47vw;
126+
}
127+
}

src/Components/RoverDetails/RoverDetails.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function RoverDetails() {
3636
return (
3737
<div id="rover-information-container">
3838
<h2 id="rover-header">CHOOSE A ROVER</h2>
39+
<span id="scroll-message">Scroll to pick a rover!</span>
3940
<div id="rover-button-container" className="button-carousel">
4041
<button
4142
className={rover === "spirit" ? "selected-rover" : "not-selected"}

0 commit comments

Comments
 (0)