Compare commits

..

No commits in common. "c8d99786f3ea5679ec3a4f3e471a8638521c5812" and "226ecdef449ed1c345e507ddc6813763ed97452e" have entirely different histories.

4 changed files with 27 additions and 14 deletions

View File

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

View File

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

View File

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

View File

@ -1,13 +1,16 @@
<?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') ? '👑' : '🎮';