Skip to content

Commit 4d53145

Browse files
committed
Add functions
1 parent 00dc7b4 commit 4d53145

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

.hintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
"meta-viewport",
1616
"no-inline-styles:error"
1717
]
18-
}
18+
}

dist/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
<h1 class="header">Leaderboard</h1>
1111
</header>
1212
<main>
13-
<section class="left-section">
14-
<div class="top">
13+
<section class="board-1">
14+
<div class="recent-goals">
1515
<h2>Recent Goals</h2>
1616
<button type="button">Refresh</button>
1717
</div>
1818

19-
<ul class="bottom">
19+
<ul class="table">
2020

2121
</ul>
2222
</section>
23-
<section class="right-section">
24-
<div class="top">
23+
<section class="board-2">
24+
<div class="table">
2525
<h2>Add the goals</h2>
2626
</div>
27-
<form action="#" class="add-score">
27+
<form action="#" class="name-goal">
2828
<input type="text" name="name" placeholder="Player name">
29-
<input type="number" name="score" placeholder="Player goals">
29+
<input type="number" name="goals" placeholder="Player goals">
3030
<button type="submit" class="submit">Submit</button>
3131
</form>
3232
</section>

dist/main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 class="header">Leaderboard</h1>
1313
<section class="board-1">
1414
<div class="recent-goals">
1515
<h2>Recent Goals</h2>
16-
<button type="button" class="refresh">Refresh</button>
16+
<button type="button">Refresh</button>
1717
</div>
1818

1919
<ul class="table">

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import './style.css';
2-
import playerGoals from './goals.js';
2+
import playerGoals from './modules/goals.js';
33

44
document.addEventListener('DOMContentLoaded', playerGoals);

src/goals.js renamed to src/modules/goals.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ const goals = [
2525
},
2626
];
2727

28-
const players = document.querySelector('.left-section .bottom');
28+
const players = document.querySelector('.board-1 .table');
2929

3030
const playerGoals = () => {
3131
goals.forEach((goal) => {
3232
const player = document.createElement('li');
33-
player.className = 'list-item';
33+
player.className = 'table-records';
3434
player.textContent = `${goal.name}: ${goal.goals}`;
3535
players.appendChild(player);
3636
});

src/style.css

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,79 +4,79 @@ body {
44
box-sizing: border-box;
55
}
66

7-
header {
8-
padding: 2%;
7+
.header {
8+
padding: 0 4rem;
99
}
1010

1111
main {
1212
display: flex;
13-
padding: 0 4%;
14-
gap: 10%;
13+
padding: 0 6rem;
14+
gap: 8rem;
1515
}
1616

17-
.left-section,
18-
.right-section {
17+
.board-1 .board-2 {
1918
display: flex;
2019
flex-direction: column;
21-
gap: 30px;
20+
gap: 2rem;
2221
}
2322

24-
.left-section .top {
23+
.board-1 .recent-goals {
2524
display: flex;
26-
gap: 10px;
25+
gap: 2rem;
26+
padding: 2rem;
2727
}
2828

29-
.left-section .top h2,
30-
.right-section .top h2 {
29+
.board-1 .recent-goals h2,
30+
.board-2 .recent-goals h2 {
3131
padding: 0;
3232
margin: 0;
3333
}
3434

35-
.right-section form button {
35+
.board-2 form button {
3636
display: flex;
3737
align-self: flex-end;
38-
width: max-content;
39-
height: max-content;
38+
width: 4rem;
39+
height: 2rem;
4040
padding: 5px;
41-
background: #fff;
41+
background: rgb(240, 238, 238);
4242
box-shadow: 1px 1px rgb(87, 85, 85);
4343
}
4444

45-
.left-section .top button {
46-
width: max-content;
47-
height: max-content;
45+
.board-1 .recent-goals button {
46+
width: 6rem;
47+
height: 2rem;
4848
padding: 5px;
49-
background: #fff;
49+
background: rgb(240, 238, 238);
5050
box-shadow: 1px 1px rgb(90, 87, 87);
5151
}
5252

53-
.left-section .bottom {
54-
border: 2px solid rgb(119, 112, 112);
53+
.board-1 .table {
54+
border: 3px solid rgb(119, 112, 112);
5555
min-height: 50px;
5656
margin: 0;
5757
padding: 0;
5858
}
5959

60-
.left-section .bottom .list-item {
60+
.board-1 .table .table-records {
6161
list-style: none;
62-
padding: 2%;
62+
padding: 5px;
6363
}
6464

65-
.left-section .bottom .list-item:nth-child(odd) {
65+
.board-1 .table .table-records:nth-child(odd) {
6666
background: rgb(206, 204, 204);
6767
}
6868

69-
.right-section form {
69+
.board-2 form {
7070
display: flex;
7171
flex-direction: column;
7272
gap: 15px;
7373
}
7474

75-
.right-section form input {
75+
.board-2 form input {
7676
border: 2px solid rgb(66, 62, 62);
77-
padding: 2%;
77+
padding: 10px;
7878
}
7979

80-
.right-section form input::placeholder {
80+
.board-2 form input::placeholder {
8181
color: rgb(87, 80, 80);
8282
}

0 commit comments

Comments
 (0)