Compare commits

...

2 Commits

4 changed files with 14 additions and 27 deletions

View File

@ -18,10 +18,6 @@
window.location.href = "Leaderboard.html";
});
document.getElementById("logoutBtn").addEventListener("click", () => {
alert("Logout berhasil!");
});
// OVERLAY CREDITS
function openCredits() {
document.getElementById('creditsOverlay').style.display = 'flex';

7
logout.php Normal file
View File

@ -0,0 +1,7 @@
<?php
session_start();
session_destroy();
header('index.php')
?>

View File

@ -6,24 +6,19 @@
<title>Memory Flip Card Game</title>
<style>
/* ================================
1. BODY (KUNCI ANTI-SCROLL)
================================== */
body {
margin: 0;
font-family: Poppins, Arial, sans-serif;
background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd);
height: 100vh; /* Kunci tinggi layar */
overflow: hidden; /* Hilangkan scrollbar */
height: 100vh;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
/* ================================
2. CONTAINER (UKURAN TETAP / STAY)
================================== */
.container {
width: 90%;
max-width: 800px;
@ -43,7 +38,6 @@ body {
to { opacity: 1; transform: translateY(0); }
}
/* Header & Tombol */
.header {
background: rgba(255,255,255,0.65);
padding: 15px 22px;
@ -93,10 +87,7 @@ body {
border: none;
}
.icon { font-size: 40px; display: block; }
/* ================================
3. BACKGROUND FRUITS
================================== */
/*Background*/
.fruit {
position: absolute;
width: 90px;
@ -115,15 +106,13 @@ body {
50% { transform: translateY(-20px) rotate(5deg); }
}
/* ================================
4. OVERLAY CREDITS (ANIMASI JALAN)
================================== */
/* overlay animation*/
.credits-overlay {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.95);
backdrop-filter: blur(10px);
display: none; /* Muncul lewat JS */
display: none;
flex-direction: column;
justify-content: center;
align-items: center;
@ -244,7 +233,7 @@ body {
</div>
<script>
// LOGIKA MUSIK
const musicBtn = document.getElementById('musicBtn');
const bgMusic = document.getElementById('bgMusic');
let isMusicPlaying = false;
@ -255,7 +244,6 @@ body {
isMusicPlaying = !isMusicPlaying;
});
// NAVIGATION
function selectStage(stage) {
window.location.href = "gameboard-" + stage + ".html";
}
@ -268,7 +256,6 @@ body {
alert("Logout berhasil!");
});
// OVERLAY CREDITS
function openCredits() {
document.getElementById('creditsOverlay').style.display = 'flex';
}

View File

@ -1,16 +1,13 @@
<?php
session_start();
// --- 1. CEK LOGIN (SATPAM) ---
if (!isset($_SESSION['user'])) {
header("Location: index.php");
exit();
}
// --- 2. SIAPKAN DATA USER (ANTI ERROR) ---
$user = $_SESSION['user'];
$username = isset($user['username']) ? $user['username'] : 'Player';
// Cek role, jika admin beri mahkota, jika player beri stik game
$roleRaw = isset($user['role']) ? $user['role'] : 'player';
$roleDisplay = ($roleRaw === 'admin') ? 'Administrator' : 'Player';
$roleIcon = ($roleRaw === 'admin') ? '👑' : '🎮';