Update index.html
Browse files- index.html +69 -134
index.html
CHANGED
@@ -1,142 +1,77 @@
|
|
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 |
</div>
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
isTouching = false;
|
69 |
-
});
|
70 |
-
|
71 |
-
let updateLives = () => {
|
72 |
-
let hearts = '';
|
73 |
-
for (let i = 0; i < remainingLives; i++) {
|
74 |
-
hearts += '♥️';
|
75 |
-
}
|
76 |
-
livesDisplay.innerHTML = hearts;
|
77 |
-
};
|
78 |
-
|
79 |
-
let updateBallPosition = () => {
|
80 |
-
ballY += ballSpeed;
|
81 |
-
|
82 |
-
// Update ball position directly with JavaScript
|
83 |
-
ball.style.top = ballY + "px";
|
84 |
-
ball.style.left = ballX + "px";
|
85 |
-
|
86 |
-
let ballRect = ball.getBoundingClientRect();
|
87 |
-
let platformRect = platform.getBoundingClientRect();
|
88 |
-
|
89 |
-
if (ballY + 30 >= platformRect.top && ballY + 30 <= platformRect.bottom) {
|
90 |
-
if (ballX + 30 >= platformRect.left && ballX <= platformRect.right) {
|
91 |
-
// Ball hits the platform
|
92 |
-
currentScore++;
|
93 |
-
if (currentScore % 10 === 0) {
|
94 |
-
level++;
|
95 |
-
levelDisplay.innerHTML = "Level: " + level;
|
96 |
-
ballSpeed += 0.2; // Increase ball speed every 10 points
|
97 |
-
}
|
98 |
-
score.innerHTML = "Score: " + currentScore;
|
99 |
-
resetBall();
|
100 |
-
}
|
101 |
-
} else if (ballY >= window.innerHeight) {
|
102 |
-
// Ball missed the platform
|
103 |
-
if (remainingLives > 0) {
|
104 |
-
remainingLives--;
|
105 |
-
updateLives();
|
106 |
-
resetBall();
|
107 |
-
}
|
108 |
-
|
109 |
-
if (remainingLives <= 0) {
|
110 |
-
alert("Game Over! Your score is: " + currentScore);
|
111 |
-
resetGame();
|
112 |
-
}
|
113 |
-
}
|
114 |
-
};
|
115 |
-
|
116 |
-
let resetBall = () => {
|
117 |
-
ballY = -30; // Reset ball to start position
|
118 |
-
ballX = Math.floor(Math.random() * (window.innerWidth - 30)); // New random X position
|
119 |
-
ball.style.top = ballY + "px";
|
120 |
-
ball.style.left = ballX + "px";
|
121 |
-
};
|
122 |
-
|
123 |
-
let resetGame = () => {
|
124 |
-
remainingLives = 3;
|
125 |
-
currentScore = 0;
|
126 |
-
level = 1;
|
127 |
-
ballSpeed = 3; // Start with a faster speed
|
128 |
-
score.innerHTML = "Score: " + currentScore;
|
129 |
-
levelDisplay.innerHTML = "Level: " + level;
|
130 |
-
updateLives();
|
131 |
-
resetBall();
|
132 |
-
};
|
133 |
-
|
134 |
-
let gameLoop = () => {
|
135 |
-
updateBallPosition();
|
136 |
-
requestAnimationFrame(gameLoop); // Loop the game
|
137 |
-
};
|
138 |
-
|
139 |
-
gameLoop(); // Start the game loop
|
140 |
-
</script>
|
141 |
</body>
|
142 |
</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 |
+
</header>
|
21 |
+
|
22 |
+
<section id="home">
|
23 |
+
<h2>Hi, Saya [Nama Kamu]</h2>
|
24 |
+
<p>Seorang developer AI dan Blockchain yang selalu belajar.</p>
|
25 |
+
<button id="chatButton">Tanya Saya</button>
|
26 |
+
<div id="chatbox" class="hidden">
|
27 |
+
<p id="chatMessage">Halo! Saya adalah chatbot mini. Tanyakan apa saja tentang saya!</p>
|
28 |
</div>
|
29 |
+
</section>
|
30 |
+
|
31 |
+
<section id="skills">
|
32 |
+
<h2>Skills</h2>
|
33 |
+
<ul>
|
34 |
+
<li>Generative AI</li>
|
35 |
+
<li>Blockchain</li>
|
36 |
+
<li>Software Engineering</li>
|
37 |
+
</ul>
|
38 |
+
</section>
|
39 |
+
|
40 |
+
<section id="projects">
|
41 |
+
<h2>Projects</h2>
|
42 |
+
<div class="project">
|
43 |
+
<h3>Sentiment Analysis</h3>
|
44 |
+
<p>Web app untuk analisis sentimen dalam Bahasa Indonesia.</p>
|
45 |
+
</div>
|
46 |
+
<div class="project">
|
47 |
+
<h3>Visualisasi Squad Sepak Bola</h3>
|
48 |
+
<p>Tools untuk membuat formasi tim sepak bola dengan statistik pemain.</p>
|
49 |
+
</div>
|
50 |
+
</section>
|
51 |
+
|
52 |
+
<section id="contact">
|
53 |
+
<h2>Contact</h2>
|
54 |
+
<form>
|
55 |
+
<input type="text" placeholder="Nama" required>
|
56 |
+
<input type="email" placeholder="Email" required>
|
57 |
+
<textarea placeholder="Pesan"></textarea>
|
58 |
+
<button type="submit">Kirim</button>
|
59 |
+
</form>
|
60 |
+
</section>
|
61 |
+
|
62 |
+
<footer>
|
63 |
+
<p>© 2025 [Nama Kamu]</p>
|
64 |
+
</footer>
|
65 |
+
|
66 |
+
<!-- JavaScript -->
|
67 |
+
<script>
|
68 |
+
document.getElementById("chatButton").addEventListener("click", function () {
|
69 |
+
const chatbox = document.getElementById("chatbox");
|
70 |
+
const message = document.getElementById("chatMessage");
|
71 |
+
|
72 |
+
chatbox.style.display = "block";
|
73 |
+
message.textContent = "Halo! Tanyakan tentang skill atau project saya.";
|
74 |
+
});
|
75 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
</body>
|
77 |
</html>
|