Compare commits
2 Commits
528f5e6adb
...
414178b437
| Author | SHA1 | Date | |
|---|---|---|---|
| 414178b437 | |||
|
|
9af82122b5 |
@ -1,37 +1,36 @@
|
||||
// LOGIKA MUSIK
|
||||
const musicBtn = document.getElementById('musicBtn');
|
||||
const bgMusic = document.getElementById('bgMusic');
|
||||
let isMusicPlaying = false;
|
||||
const musicBtn = document.getElementById('musicBtn');
|
||||
const bgMusic = document.getElementById('bgMusic');
|
||||
let isMusicPlaying = false;
|
||||
|
||||
musicBtn.addEventListener('click', () => {
|
||||
musicBtn.addEventListener('click', () => {
|
||||
isMusicPlaying ? bgMusic.pause() : bgMusic.play();
|
||||
musicBtn.innerText = isMusicPlaying ? '🔇' : '🔊';
|
||||
isMusicPlaying = !isMusicPlaying;
|
||||
});
|
||||
});
|
||||
|
||||
// NAVIGATION
|
||||
function selectStage(stage) {
|
||||
window.location.href = "gameboard-" + stage + ".html";
|
||||
}
|
||||
// NAVIGATION (Ini yang penting, sudah .php)
|
||||
function selectStage(stage) {
|
||||
window.location.href = "gameboard-" + stage + ".php";
|
||||
}
|
||||
|
||||
document.getElementById("leaderboardBtn").addEventListener("click", () => {
|
||||
window.location.href = "Leaderboard.html";
|
||||
});
|
||||
|
||||
// OVERLAY CREDITS
|
||||
function openCredits() {
|
||||
// OVERLAY CREDITS
|
||||
function openCredits() {
|
||||
document.getElementById('creditsOverlay').style.display = 'flex';
|
||||
}
|
||||
}
|
||||
|
||||
function closeCredits() {
|
||||
function closeCredits() {
|
||||
document.getElementById('creditsOverlay').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// Karena JS eksternal mungkin tidak tahu lokasi logout.php, kita bantu disini
|
||||
document.getElementById("logoutBtn").addEventListener("click", () => {
|
||||
// LOGOUT
|
||||
document.getElementById("logoutBtn").addEventListener("click", () => {
|
||||
window.location.href = "logout.php";
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("leaderboardBtn").addEventListener("click", () => {
|
||||
window.location.href = "Leaderboard.html"; // Atau Leaderboard.php jika sudah diubah
|
||||
});
|
||||
// LEADERBOARD (Cukup ditulis satu kali saja)
|
||||
document.getElementById("leaderboardBtn").addEventListener("click", () => {
|
||||
// Pastikan file aslinya bernama Leaderboard.html
|
||||
// Kalau sudah diubah jadi PHP, ganti jadi "Leaderboard.php"
|
||||
window.location.href = "Leaderboard.html";
|
||||
});
|
||||
@ -7,6 +7,7 @@ exit();
|
||||
}
|
||||
$user = $_SESSION['user'];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
@ -60,10 +60,12 @@ $roleIcon = ($roleRaw === 'admin') ? '👑' : '🎮';
|
||||
<span class="icon">😊</span>
|
||||
<h3>Easy Mode</h3>
|
||||
</button>
|
||||
|
||||
<button class="stage-btn" onclick="selectStage('medium')">
|
||||
<span class="icon">🤔</span>
|
||||
<h3>Medium Mode</h3>
|
||||
</button>
|
||||
|
||||
<button class="stage-btn" onclick="selectStage('hard')">
|
||||
<span class="icon">😤</span>
|
||||
<h3>Hard Mode</h3>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user