Update Backup-html
Browse files- Backup-html +77 -94
Backup-html
CHANGED
@@ -1,110 +1,93 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
</head>
|
9 |
<body>
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<
|
17 |
-
<
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
const rightButton = document.getElementById('right-button');
|
24 |
-
const scoreDisplay = document.getElementById('score');
|
25 |
-
const gameContainer = document.querySelector('.game-container');
|
26 |
-
|
27 |
-
let platformPosition = 50; // Platform awal di tengah.
|
28 |
-
let ballPosition = { top: 0, left: Math.random() * 90 }; // Bola muncul secara acak.
|
29 |
-
let isCaught = false; // Apakah bola ditangkap.
|
30 |
-
let score = 0; // Skor awal.
|
31 |
-
|
32 |
-
// Fungsi untuk memindahkan platform ke kiri
|
33 |
-
function movePlatformLeft() {
|
34 |
-
if (platformPosition > 0) {
|
35 |
-
platformPosition -= 5;
|
36 |
-
}
|
37 |
-
platform.style.left = platformPosition + '%';
|
38 |
-
}
|
39 |
-
|
40 |
-
// Fungsi untuk memindahkan platform ke kanan
|
41 |
-
function movePlatformRight() {
|
42 |
-
if (platformPosition < 90) {
|
43 |
-
platformPosition += 5;
|
44 |
-
}
|
45 |
-
platform.style.left = platformPosition + '%';
|
46 |
-
}
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
rightButton.addEventListener('click', movePlatformRight);
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
|
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
score++; // Tambahkan skor.
|
83 |
-
scoreDisplay.textContent = score; // Update skor di layar.
|
84 |
-
resetGame();
|
85 |
-
}
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
score = 0; // Reset skor.
|
92 |
-
scoreDisplay.textContent = score; // Update skor.
|
93 |
-
}
|
94 |
-
resetGame();
|
95 |
-
}
|
96 |
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
ballPosition = { top: 0, left: Math.random() * 90 }; // Bola muncul ulang.
|
104 |
-
}
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
</body>
|
110 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Portfolio Interaktif</title>
|
7 |
+
<link rel="stylesheet" href="style.css">
|
8 |
</head>
|
9 |
<body>
|
10 |
+
<header>
|
11 |
+
<h1>Selamat Datang di Portfolio Saya</h1>
|
12 |
+
<nav>
|
13 |
+
<ul>
|
14 |
+
<li><a href="#home">Home</a></li>
|
15 |
+
<li><a href="#skills">Skills</a></li>
|
16 |
+
<li><a href="#projects">Projects</a></li>
|
17 |
+
<li><a href="#contact">Contact</a></li>
|
18 |
+
</ul>
|
19 |
+
</nav>
|
20 |
+
<!-- Tombol Mode Gelap dengan Ikon -->
|
21 |
+
<button id="toggleDarkMode" aria-label="Toggle Dark Mode">π</button>
|
22 |
+
</header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
<section id="home">
|
25 |
+
<h2>Hi, Saya [Nama Kamu]</h2>
|
26 |
+
<p>Seorang developer AI dan Blockchain yang selalu belajar.</p>
|
27 |
+
<button id="chatButton">Tanya Saya</button>
|
28 |
+
<div id="chatbox" class="hidden">
|
29 |
+
<p id="chatMessage">Halo! Saya adalah chatbot mini. Tanyakan apa saja tentang saya!</p>
|
30 |
+
</div>
|
31 |
+
</section>
|
|
|
32 |
|
33 |
+
<section id="skills">
|
34 |
+
<h2>Skills</h2>
|
35 |
+
<ul>
|
36 |
+
<li>Generative AI</li>
|
37 |
+
<li>Blockchain</li>
|
38 |
+
<li>Software Engineering</li>
|
39 |
+
</ul>
|
40 |
+
</section>
|
41 |
|
42 |
+
<section id="projects">
|
43 |
+
<h2>Projects</h2>
|
44 |
+
<div class="project">
|
45 |
+
<h3>Sentiment Analysis</h3>
|
46 |
+
<p>Web app untuk analisis sentimen dalam Bahasa Indonesia.</p>
|
47 |
+
</div>
|
48 |
+
<div class="project">
|
49 |
+
<h3>Visualisasi Squad Sepak Bola</h3>
|
50 |
+
<p>Tools untuk membuat formasi tim sepak bola dengan statistik pemain.</p>
|
51 |
+
</div>
|
52 |
+
</section>
|
53 |
|
54 |
+
<section id="contact">
|
55 |
+
<h2>Contact</h2>
|
56 |
+
<form>
|
57 |
+
<input type="text" placeholder="Nama" required>
|
58 |
+
<input type="email" placeholder="Email" required>
|
59 |
+
<textarea placeholder="Pesan"></textarea>
|
60 |
+
<button type="submit">Kirim</button>
|
61 |
+
</form>
|
62 |
+
</section>
|
63 |
|
64 |
+
<footer>
|
65 |
+
<p>© 2025 [Nama Kamu]</p>
|
66 |
+
</footer>
|
|
|
|
|
|
|
|
|
67 |
|
68 |
+
<!-- JavaScript -->
|
69 |
+
<script>
|
70 |
+
// Fungsi untuk mengubah mode gelap
|
71 |
+
const toggleDarkModeButton = document.getElementById("toggleDarkMode");
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
+
// Cek apakah mode gelap sudah dipilih sebelumnya
|
74 |
+
if (localStorage.getItem('darkMode') === 'enabled') {
|
75 |
+
document.body.classList.add('dark-mode');
|
76 |
+
toggleDarkModeButton.textContent = 'βοΈ'; // Ubah ikon ke matahari
|
77 |
+
}
|
78 |
|
79 |
+
// Event listener untuk tombol mode gelap
|
80 |
+
toggleDarkModeButton.addEventListener("click", function () {
|
81 |
+
document.body.classList.toggle("dark-mode");
|
|
|
|
|
82 |
|
83 |
+
if (document.body.classList.contains("dark-mode")) {
|
84 |
+
localStorage.setItem("darkMode", "enabled");
|
85 |
+
toggleDarkModeButton.textContent = 'βοΈ'; // Ubah ikon ke matahari
|
86 |
+
} else {
|
87 |
+
localStorage.setItem("darkMode", "disabled");
|
88 |
+
toggleDarkModeButton.textContent = 'π'; // Ubah ikon ke bulan
|
89 |
+
}
|
90 |
+
});
|
91 |
+
</script>
|
92 |
</body>
|
93 |
</html>
|