Compare commits
No commits in common. "414178b437a80d6e3b0db4157f9cef48b6db9cdf" and "528f5e6adb0ce74e00c9459580b9acd7e8ce92e2" have entirely different histories.
414178b437
...
528f5e6adb
@ -1,36 +1,37 @@
|
|||||||
// LOGIKA MUSIK
|
// LOGIKA MUSIK
|
||||||
const musicBtn = document.getElementById('musicBtn');
|
const musicBtn = document.getElementById('musicBtn');
|
||||||
const bgMusic = document.getElementById('bgMusic');
|
const bgMusic = document.getElementById('bgMusic');
|
||||||
let isMusicPlaying = false;
|
let isMusicPlaying = false;
|
||||||
|
|
||||||
musicBtn.addEventListener('click', () => {
|
musicBtn.addEventListener('click', () => {
|
||||||
isMusicPlaying ? bgMusic.pause() : bgMusic.play();
|
isMusicPlaying ? bgMusic.pause() : bgMusic.play();
|
||||||
musicBtn.innerText = isMusicPlaying ? '🔇' : '🔊';
|
musicBtn.innerText = isMusicPlaying ? '🔇' : '🔊';
|
||||||
isMusicPlaying = !isMusicPlaying;
|
isMusicPlaying = !isMusicPlaying;
|
||||||
});
|
});
|
||||||
|
|
||||||
// NAVIGATION (Ini yang penting, sudah .php)
|
// NAVIGATION
|
||||||
function selectStage(stage) {
|
function selectStage(stage) {
|
||||||
window.location.href = "gameboard-" + stage + ".php";
|
window.location.href = "gameboard-" + stage + ".html";
|
||||||
}
|
}
|
||||||
|
|
||||||
// OVERLAY CREDITS
|
document.getElementById("leaderboardBtn").addEventListener("click", () => {
|
||||||
function openCredits() {
|
|
||||||
document.getElementById('creditsOverlay').style.display = 'flex';
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeCredits() {
|
|
||||||
document.getElementById('creditsOverlay').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
// LOGOUT
|
|
||||||
document.getElementById("logoutBtn").addEventListener("click", () => {
|
|
||||||
window.location.href = "logout.php";
|
|
||||||
});
|
|
||||||
|
|
||||||
// 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";
|
window.location.href = "Leaderboard.html";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// OVERLAY CREDITS
|
||||||
|
function openCredits() {
|
||||||
|
document.getElementById('creditsOverlay').style.display = 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
|
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", () => {
|
||||||
|
window.location.href = "logout.php";
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("leaderboardBtn").addEventListener("click", () => {
|
||||||
|
window.location.href = "Leaderboard.html"; // Atau Leaderboard.php jika sudah diubah
|
||||||
|
});
|
||||||
@ -7,7 +7,6 @@ exit();
|
|||||||
}
|
}
|
||||||
$user = $_SESSION['user'];
|
$user = $_SESSION['user'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|||||||
@ -60,12 +60,10 @@ $roleIcon = ($roleRaw === 'admin') ? '👑' : '🎮';
|
|||||||
<span class="icon">😊</span>
|
<span class="icon">😊</span>
|
||||||
<h3>Easy Mode</h3>
|
<h3>Easy Mode</h3>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="stage-btn" onclick="selectStage('medium')">
|
<button class="stage-btn" onclick="selectStage('medium')">
|
||||||
<span class="icon">🤔</span>
|
<span class="icon">🤔</span>
|
||||||
<h3>Medium Mode</h3>
|
<h3>Medium Mode</h3>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="stage-btn" onclick="selectStage('hard')">
|
<button class="stage-btn" onclick="selectStage('hard')">
|
||||||
<span class="icon">😤</span>
|
<span class="icon">😤</span>
|
||||||
<h3>Hard Mode</h3>
|
<h3>Hard Mode</h3>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user