Skip to content

Commit 226720b

Browse files
committed
fix search lyrics pagination and breakout colors
1 parent c2debbc commit 226720b

File tree

3 files changed

+36
-27
lines changed

3 files changed

+36
-27
lines changed

Diff for: 73-lyrics search app/script.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const form = document.getElementById("form");
22
const search = document.getElementById("search");
33
const result = document.getElementById("result");
4-
// const more = document.getElementById("more");
4+
const more = document.getElementById("more");
55

66
const apiURL = "https://api.lyrics.ovh";
77

@@ -25,14 +25,14 @@ async function getLyrics(artist, songTitle) {
2525
<span>${lyrics}</span>
2626
`;
2727
}
28-
// more.innerHTML = "";
28+
more.innerHTML = "";
2929
}
3030

31-
// async function getMoreSongs(url) {
32-
// const res = await fetch(`https://cors-anywhere.herokuapp.com/${url}`); // 403 without
33-
// const data = await res.json();
34-
// showData(data);
35-
// }
31+
async function getMoreSongs(url) {
32+
const res = await fetch(`https://cors-anywhere.herokuapp.com/${url}`); // proxy is required to avoid CORS issue
33+
const data = await res.json();
34+
showData(data);
35+
}
3636

3737
function showData(data) {
3838
result.innerHTML = `
@@ -48,20 +48,20 @@ function showData(data) {
4848
</ul>
4949
`;
5050
// Pagination
51-
// if (data.prev || data.next) {
52-
// more.innerHTML = `
53-
// ${
54-
// data.prev
55-
// ? `<button class="btn" onclick="getMoreSongs('${data.prev}')">Prev</button>`
56-
// : ""
57-
// }
58-
// ${
59-
// data.next
60-
// ? `<button class="btn" onclick="getMoreSongs('${data.next}')">Next</button>`
61-
// : ""
62-
// }
63-
// `;
64-
// } else more.innerHTML = "";
51+
if (data.prev || data.next) {
52+
more.innerHTML = `
53+
${
54+
data.prev
55+
? `<button class="btn" onclick="getMoreSongs('${data.prev}')">Prev</button>`
56+
: ""
57+
}
58+
${
59+
data.next
60+
? `<button class="btn" onclick="getMoreSongs('${data.next}')">Next</button>`
61+
: ""
62+
}
63+
`;
64+
} else more.innerHTML = "";
6565
}
6666

6767
function showAlert(message) {

Diff for: 75-breakout game/style.css

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
@import url("https://fonts.googleapis.com/css2?family=Balsamiq+Sans:wght@400;700&display=swap");
22

33
:root {
4-
--background-color: #0095dd;
4+
--background-color: #081150;
5+
--background-secondary-color: #1842da;
56
--canvas-color: #f0f0f0;
67
--text-color: rgba(255, 255, 255, 0.87);
7-
--hover-color: #222;
8-
--sidebar-color: #333;
9-
--button-color: #000;
8+
--sidebar-color: #4d515e;
9+
--button-color: #00094f;
10+
--hover-color: #3e499c;
1011
}
1112

1213
* {
@@ -15,6 +16,12 @@
1516

1617
body {
1718
background-color: var(--background-color);
19+
background-image: radial-gradient(
20+
circle,
21+
var(--button-color) 0%,
22+
var(--background-color) 35%,
23+
var(--background-secondary-color) 100%
24+
);
1825
font-family: "Balsamiq Sans", cursive;
1926
display: flex;
2027
flex-direction: column;
@@ -42,6 +49,8 @@ canvas {
4249
background-color: var(--button-color);
4350
color: var(--text-color);
4451
border-radius: 5px;
52+
font-family: inherit;
53+
font-size: 1rem;
4554
}
4655

4756
.btn:focus {
@@ -70,7 +79,7 @@ canvas {
7079
color: var(--text-color);
7180
min-height: 100vh;
7281
width: 400px;
73-
padding: 1.25rem;
82+
padding: 3rem;
7483
line-height: 1.5;
7584
transform: translateX(-400px);
7685
transition: transform 1s ease-in-out;

Diff for: 78-speak number guessing game/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
body {
88
background: #27273d
9-
url("https://images.unsplash.com/photo-1534595461757-4974c5072dff?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80")
9+
url("https://images.unsplash.com/photo-1552749412-091909ed9f82?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80")
1010
no-repeat center center/cover;
1111
color: rgba(255, 255, 255, 0.87);
1212
font-family: "Recursive", sans-serif;

0 commit comments

Comments
 (0)