Skip to content

Commit 9fde55d

Browse files
committed
Translate Event: sliding-menu - 100%
1 parent 28165db commit 9fde55d

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed

2-ui/2-events/01-introduction-browser-events/05-sliding-menu/solution.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,47 @@
11

22
# HTML/CSS
3-
First let's create HTML/CSS.
3+
Pertama buat HTML/CSS.
44

5-
A menu is a standalone graphical component on the page, so it's better to put it into a single DOM element.
5+
Sebuah menu adalah komponen tersendiri pada halaman, jadi lebih baik untuk menaruhnya kedalam satu elemen DOM.
66

7-
A list of menu items can be laid out as a list `ul/li`.
7+
Sebuah daftar dari item menu bisa dapat diatur kedalam daftar menggunakan `ul/li`.
88

9-
Here's the example structure:
9+
Ini contoh strukturnya:
1010

1111
```html
1212
<div class="menu">
13-
<span class="title">Sweeties (click me)!</span>
13+
<span class="title">Manis-Manis (Tekan saya)!</span>
1414
<ul>
15-
<li>Cake</li>
16-
<li>Donut</li>
17-
<li>Honey</li>
15+
<li>Kue</li>
16+
<li>Donat</li>
17+
<li>Madu</li>
1818
</ul>
1919
</div>
2020
```
2121

22-
We use `<span>` for the title, because `<div>` has an implicit `display:block` on it, and it will occupy 100% of the horizontal width.
22+
Kita dapat menggunakan `<span>` untuk judul, karena `<div>` memiliki `display:block`, dan akan memenuhi 100% horisontal lebar elemen.
2323

24-
Like this:
24+
Seperti ini:
2525

2626
```html autorun height=50
27-
<div style="border: solid red 1px" onclick="alert(1)">Sweeties (click me)!</div>
27+
<div style="border: solid red 1px" onclick="alert(1)">Manis-Manis (Tekan saya)!</div>
2828
```
2929

30-
So if we set `onclick` on it, then it will catch clicks to the right of the text.
30+
Jadi jika kita mengatur `onclick` pada judul, maka itu akan menangkap klik diselah kanan teks.
3131

32-
As `<span>` has an implicit `display: inline`, it occupies exactly enough place to fit all the text:
32+
Sedangkan `<span>` memiliki `display:inline`, dan akan memenuhi ruang yang cukup sesuai dengan teks:
3333

3434
```html autorun height=50
35-
<span style="border: solid red 1px" onclick="alert(1)">Sweeties (click me)!</span>
35+
<span style="border: solid red 1px" onclick="alert(1)">Manis-Manis (Tekan saya)!</span>
3636
```
3737

38-
# Toggling the menu
38+
# Membuka dan menutup menu
3939

40-
Toggling the menu should change the arrow and show/hide the menu list.
40+
Membuka dan menutup menu seharusnya menganti posisi anak panah dan menunjukan atau menyembunyikan daftar menu.
4141

42-
All these changes are perfectly handled by CSS. In JavaScript we should label the current state of the menu by adding/removing the class `.open`.
43-
44-
Without it, the menu will be closed:
42+
Semua pergantian ini sangat sempurna untuk di tanggani oleh CSS. Pada Javascript kita harus memberi label pada kondisi menu saat ini dengan menambahkan/menghapuskan kelas(_class_) `.open`.
4543

44+
Tanpanya, menu akan tetap tertutup:
4645
```css
4746
.menu ul {
4847
margin: 0;
@@ -58,7 +57,7 @@ Without it, the menu will be closed:
5857
}
5958
```
6059

61-
...And with `.open` the arrow changes and the list shows up:
60+
...Dan dengan `.open` anak panah akan berubah dan daftar akan kelihatan:
6261

6362
```css
6463
.menu.open .title::before {

2-ui/2-events/01-introduction-browser-events/05-sliding-menu/solution.view/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
color: green;
2323
}
2424

25-
.menu.open .title::before {
25+
.menu.buka .title::before {
2626
content: '▼ ';
2727
}
2828

29-
.menu.open ul {
29+
.menu.buka ul {
3030
display: block;
3131
}
3232
</style>
@@ -35,11 +35,11 @@
3535
<body>
3636

3737
<div id="sweeties" class="menu">
38-
<span class="title">Sweeties (click me)!</span>
38+
<span class="title">Manis-Manis (Klik Saya)!</span>
3939
<ul>
40-
<li>Cake</li>
41-
<li>Donut</li>
42-
<li>Honey</li>
40+
<li>Kue</li>
41+
<li>Donat</li>
42+
<li>Madu</li>
4343
</ul>
4444

4545
</div>
@@ -49,7 +49,7 @@
4949
let titleElem = menuElem.querySelector('.title');
5050

5151
titleElem.onclick = function() {
52-
menuElem.classList.toggle('open');
52+
menuElem.classList.toggle('buka');
5353
};
5454
</script>
5555

2-ui/2-events/01-introduction-browser-events/05-sliding-menu/source.view/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
</head>
66
<body>
77

8-
▶ ▼ Sweeties (click me)!
8+
▶ ▼ Manis-Manis (Klik Saya)!
99
<ul>
10-
<li>Cake</li>
11-
<li>Donut</li>
12-
<li>Honey</li>
10+
<li>Kue</li>
11+
<li>Donat</li>
12+
<li>Madu</li>
1313
</ul>
1414

1515
</body>

2-ui/2-events/01-introduction-browser-events/05-sliding-menu/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ importance: 5
22

33
---
44

5-
# Create a sliding menu
5+
# Buat sebuah menu geser
66

7-
Create a menu that opens/collapses on click:
7+
Buat sebuah menu yang terbuka/tertutup pada saat ditekan:
88

99
[iframe border=1 height=100 src="solution"]
1010

11-
P.S. HTML/CSS of the source document is to be modified.
11+
Tambahan: HTML/CSS dari dokumen harus dimodifikasi.

0 commit comments

Comments
 (0)