Compare commits
No commits in common. "c8d99786f3ea5679ec3a4f3e471a8638521c5812" and "226ecdef449ed1c345e507ddc6813763ed97452e" have entirely different histories.
c8d99786f3
...
226ecdef44
@ -18,6 +18,10 @@
|
|||||||
window.location.href = "Leaderboard.html";
|
window.location.href = "Leaderboard.html";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById("logoutBtn").addEventListener("click", () => {
|
||||||
|
alert("Logout berhasil!");
|
||||||
|
});
|
||||||
|
|
||||||
// OVERLAY CREDITS
|
// OVERLAY CREDITS
|
||||||
function openCredits() {
|
function openCredits() {
|
||||||
document.getElementById('creditsOverlay').style.display = 'flex';
|
document.getElementById('creditsOverlay').style.display = 'flex';
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
session_destroy();
|
|
||||||
|
|
||||||
header('index.php')
|
|
||||||
?>
|
|
||||||
@ -6,19 +6,24 @@
|
|||||||
<title>Memory Flip Card Game</title>
|
<title>Memory Flip Card Game</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
/* ================================
|
||||||
|
1. BODY (KUNCI ANTI-SCROLL)
|
||||||
|
================================== */
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: Poppins, Arial, sans-serif;
|
font-family: Poppins, Arial, sans-serif;
|
||||||
background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd);
|
background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd);
|
||||||
height: 100vh;
|
height: 100vh; /* Kunci tinggi layar */
|
||||||
overflow: hidden;
|
overflow: hidden; /* Hilangkan scrollbar */
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ================================
|
||||||
|
2. CONTAINER (UKURAN TETAP / STAY)
|
||||||
|
================================== */
|
||||||
.container {
|
.container {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
@ -38,6 +43,7 @@ body {
|
|||||||
to { opacity: 1; transform: translateY(0); }
|
to { opacity: 1; transform: translateY(0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Header & Tombol */
|
||||||
.header {
|
.header {
|
||||||
background: rgba(255,255,255,0.65);
|
background: rgba(255,255,255,0.65);
|
||||||
padding: 15px 22px;
|
padding: 15px 22px;
|
||||||
@ -87,7 +93,10 @@ body {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
.icon { font-size: 40px; display: block; }
|
.icon { font-size: 40px; display: block; }
|
||||||
/*Background*/
|
|
||||||
|
/* ================================
|
||||||
|
3. BACKGROUND FRUITS
|
||||||
|
================================== */
|
||||||
.fruit {
|
.fruit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 90px;
|
width: 90px;
|
||||||
@ -106,13 +115,15 @@ body {
|
|||||||
50% { transform: translateY(-20px) rotate(5deg); }
|
50% { transform: translateY(-20px) rotate(5deg); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* overlay animation*/
|
/* ================================
|
||||||
|
4. OVERLAY CREDITS (ANIMASI JALAN)
|
||||||
|
================================== */
|
||||||
.credits-overlay {
|
.credits-overlay {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0; left: 0; width: 100%; height: 100%;
|
top: 0; left: 0; width: 100%; height: 100%;
|
||||||
background: rgba(0, 0, 0, 0.95);
|
background: rgba(0, 0, 0, 0.95);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
display: none;
|
display: none; /* Muncul lewat JS */
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -233,7 +244,7 @@ body {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// 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;
|
||||||
@ -244,6 +255,7 @@ body {
|
|||||||
isMusicPlaying = !isMusicPlaying;
|
isMusicPlaying = !isMusicPlaying;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// NAVIGATION
|
||||||
function selectStage(stage) {
|
function selectStage(stage) {
|
||||||
window.location.href = "gameboard-" + stage + ".html";
|
window.location.href = "gameboard-" + stage + ".html";
|
||||||
}
|
}
|
||||||
@ -256,6 +268,7 @@ body {
|
|||||||
alert("Logout berhasil!");
|
alert("Logout berhasil!");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// OVERLAY CREDITS
|
||||||
function openCredits() {
|
function openCredits() {
|
||||||
document.getElementById('creditsOverlay').style.display = 'flex';
|
document.getElementById('creditsOverlay').style.display = 'flex';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
// --- 1. CEK LOGIN (SATPAM) ---
|
||||||
if (!isset($_SESSION['user'])) {
|
if (!isset($_SESSION['user'])) {
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- 2. SIAPKAN DATA USER (ANTI ERROR) ---
|
||||||
$user = $_SESSION['user'];
|
$user = $_SESSION['user'];
|
||||||
$username = isset($user['username']) ? $user['username'] : 'Player';
|
$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';
|
$roleRaw = isset($user['role']) ? $user['role'] : 'player';
|
||||||
$roleDisplay = ($roleRaw === 'admin') ? 'Administrator' : 'Player';
|
$roleDisplay = ($roleRaw === 'admin') ? 'Administrator' : 'Player';
|
||||||
$roleIcon = ($roleRaw === 'admin') ? '👑' : '🎮';
|
$roleIcon = ($roleRaw === 'admin') ? '👑' : '🎮';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user