commit e3c040b5d7d2242fdf2432f6d2e9ad7d4e111f27 Author: Anisetus gp Date: Thu Oct 29 09:32:18 2026 +0700 test diff --git a/images/controller.jpeg b/images/controller.jpeg new file mode 100644 index 0000000..043437d Binary files /dev/null and b/images/controller.jpeg differ diff --git a/images/headset.png b/images/headset.png new file mode 100644 index 0000000..ddf4956 Binary files /dev/null and b/images/headset.png differ diff --git a/images/keyboard.jpg b/images/keyboard.jpg new file mode 100644 index 0000000..8309d50 Binary files /dev/null and b/images/keyboard.jpg differ diff --git a/images/laptop.jpg b/images/laptop.jpg new file mode 100644 index 0000000..ff2930e Binary files /dev/null and b/images/laptop.jpg differ diff --git a/images/monitor.jpeg b/images/monitor.jpeg new file mode 100644 index 0000000..f37b430 Binary files /dev/null and b/images/monitor.jpeg differ diff --git a/images/mouse_logitech.jpg b/images/mouse_logitech.jpg new file mode 100644 index 0000000..f9c17b8 Binary files /dev/null and b/images/mouse_logitech.jpg differ diff --git a/images/speaker.jpeg b/images/speaker.jpeg new file mode 100644 index 0000000..90fcb70 Binary files /dev/null and b/images/speaker.jpeg differ diff --git a/images/webcam.jpeg b/images/webcam.jpeg new file mode 100644 index 0000000..132afb5 Binary files /dev/null and b/images/webcam.jpeg differ diff --git a/tugas baru.zip b/tugas baru.zip new file mode 100644 index 0000000..5a8b5aa Binary files /dev/null and b/tugas baru.zip differ diff --git a/tugas baru/index.html b/tugas baru/index.html new file mode 100644 index 0000000..0a1966b --- /dev/null +++ b/tugas baru/index.html @@ -0,0 +1,128 @@ + + + + + + Jawaban Latihan Project 08 + + + + +

Jawaban Latihan Project 08

+ + +
+

Exercise 1: Looping Angka 1-10

+ +
+ + +
+

Exercise 2: Filter Nama Huruf "A"

+ +
+ + +
+

Exercise 3: Toggle Button (Show/Hide)

+ +
Ini Kotak!
+
+ + +
+

Exercise 4: Live Character Counter

+ +

Jumlah karakter: 0

+
+ + +
+

Exercise 5: Mini To-Do List

+ + + +
+ + + + \ No newline at end of file diff --git a/tugas/Untitled-1.html b/tugas/Untitled-1.html new file mode 100644 index 0000000..e515aa4 --- /dev/null +++ b/tugas/Untitled-1.html @@ -0,0 +1,44 @@ + + + + + + +
+ +
+

dashboard siswa

+

tahun ajaran 2026/2027

+
+
+
+ +
+ \
+ + \ No newline at end of file diff --git a/tugas/gittry.md b/tugas/gittry.md new file mode 100644 index 0000000..e69de29 diff --git a/tugas/index.html b/tugas/index.html new file mode 100644 index 0000000..8c9cb06 --- /dev/null +++ b/tugas/index.html @@ -0,0 +1,113 @@ + + + + + + Project 07 - Shopping Cart + + + +
+ +

+ Product Catalog +

+ + + +
+ +
+ +
+ + +
+ + +
+ Controller +

Controller

+

Rp 750.000

+ +
+ + +
+ Headset +

Headset

+

Rp 1.200.000

+ +
+ + +
+ Keyboard +

Keyboard

+

Rp 1.800.000

+ +
+ + +
+ Laptop +

Laptop

+

Rp 14.985.000

+ +
+ + +
+ Monitor +

Monitor

+

Rp 3.000.000

+ +
+ + +
+ Mouse Logitech +

Mouse Logitech

+

Rp 600.000

+ +
+ +
+ speaker +

speaker

+

Rp 800.000

+ +
+ +
+ webcam +

webcam

+

Rp 1.200.000

+ +
+ +
+ + +
+

Keranjang Belanja

+ +

Keranjang masih kosong

+
    + +
    + Total: Rp 0 +
    +
    + +
    + + + + \ No newline at end of file diff --git a/tugas/javascriptngelu.js b/tugas/javascriptngelu.js new file mode 100644 index 0000000..c0e2ccf --- /dev/null +++ b/tugas/javascriptngelu.js @@ -0,0 +1,62 @@ +let cart = []; + +const cartItemsContainer = document.getElementById('cart-items'); +const cartTotalElement = document.getElementById('cart-total'); +const emptyCartMsg = document.getElementById('empty-cart-msg'); +const addButtons = document.querySelectorAll('.add-to-cart-btn'); + + +addButtons.forEach(button => { + button.addEventListener('click', function() { + const name = this.getAttribute('data-name'); + const price = parseFloat(this.getAttribute('data-price')); + + cart.push({ name, price }); + renderCart(); + }); +}); + + +cartItemsContainer.addEventListener('click', function () { + if (event.target.matches('.remove-btn') || event.target.closest('.remove-btn')) { + const itemIndex = event.target.getAttribute('data-index'); + cart.splice(itemIndex, 1); + renderCart(); + } +}); + + +function renderCart() { + cartItemsContainer.innerHTML = ''; + + let total = 0; + + if (cart.length === 0) { + emptyCartMsg.style.display = 'block'; + } else { + emptyCartMsg.style.display = 'none'; + + cart.forEach((item, index) => { + total += item.price; + + const li = document.createElement('li'); + li.className = 'flex justify-between items-center bg-gray-50 p-2 rounded border'; + + const span = document.createElement('span'); + // Mengubah format harga menjadi style Rupiah (id-ID) + span.textContent = `${item.name} - Rp ${item.price.toLocaleString('id-ID')}`; + + const removeBtn = document.createElement('button'); + removeBtn.textContent = 'Remove'; + removeBtn.className = 'remove-btn bg-red-500 text-white px-2 py-1 rounded text-sm hover:bg-red-600'; + removeBtn.setAttribute('data-index', index); + + li.appendChild(span); + li.appendChild(removeBtn); + cartItemsContainer.appendChild(li); + }); + } + + + cartTotalElement.textContent = total.toLocaleString('id-ID'); +} \ No newline at end of file