Skip to content

Commit 80fdddd

Browse files
committed
finished editing responsive design css
1 parent dbcfb8c commit 80fdddd

File tree

3 files changed

+67
-7
lines changed

3 files changed

+67
-7
lines changed

assets/css/style.css

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ h1,h2,h3,h4,h5,h6 {
4545
float: inline-start;
4646
}
4747

48-
#start:hover {
49-
opacity: 0.85;
50-
}
51-
5248
.button-left {
5349
left: 25%;
5450
}
@@ -82,6 +78,10 @@ h1,h2,h3,h4,h5,h6 {
8278
top: 30%;
8379
}
8480

81+
#start:hover {
82+
opacity: 0.85;
83+
}
84+
8585
/* ---------------- button reactiveness */
8686

8787
.light {
@@ -92,6 +92,10 @@ h1,h2,h3,h4,h5,h6 {
9292
border: 5px inset #000000;
9393
}
9494

95+
.hide {
96+
visibility: hidden;
97+
}
98+
9599
/* ---------------- responsive design for different screen sizes */
96100

97101
@media screen and (max-width: 1024px) {
@@ -138,4 +142,61 @@ h1,h2,h3,h4,h5,h6 {
138142
top: 25%;
139143
left: 40%;
140144
}
145+
}
146+
147+
@media screen and (max-width: 426px) {
148+
h1,h2,h3,h4,h5,h6 {
149+
padding: 0rem;
150+
}
151+
152+
.button-left {
153+
left: 8%;
154+
}
155+
156+
.button-right {
157+
left: 30%;
158+
}
159+
160+
#start {
161+
left: 35%;
162+
}
163+
}
164+
165+
@media screen and (max-width: 376px) {
166+
167+
.button-left {
168+
left: 4%;
169+
}
170+
171+
.button-right {
172+
left: 24%;
173+
}
174+
175+
#start {
176+
left: 32.5%;
177+
}
178+
}
179+
180+
@media screen and (max-width: 321px) {
181+
182+
h4 {
183+
font-size: 0.9rem;
184+
}
185+
186+
.heading-container {
187+
height: 6rem;
188+
padding-left: 18%;
189+
}
190+
191+
.button-left {
192+
left: 1%;
193+
}
194+
195+
.button-right {
196+
left: 15%;
197+
}
198+
199+
#start {
200+
left: 28.5%;
201+
}
141202
}

assets/js/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const newGame = () => {
3535

3636
gameReset();
3737

38-
// we want to hide the Start Game button after clicking it. That code will go here.
38+
document.querySelector('#start').classList.add("hide");
3939

4040
// start the game. This entire part was copied from the Simon game codealong challenge () and edited for my purposes.
4141
for (const node of listOfNodes) {
@@ -150,7 +150,7 @@ const playerTurn = () => {
150150
document.querySelector('#maxlength').innerHTML = gameConfig.patternCount;
151151
};
152152
gameReset();
153-
// we want code to resummon the start button.
153+
document.querySelector('#start').classList.remove("hide");
154154
};
155155
};
156156

assets/js/tests/script.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ describe("scores are updating properly", () => {
150150
gameConfig.currentPat = [4, 6, 1, 7, 2, 3, 5];
151151
gameConfig.playerInput = [4, 6, 1, 7, 2, 3, 2];
152152
gameConfig.score = 27;
153-
playerTurn();
154153
});
155154
test("high score is correctly updated", () => {
156155
expect(document.querySelector('#highscore').innerHTML).toBe("27");

0 commit comments

Comments
 (0)