98 lines
2.1 KiB
PHP
98 lines
2.1 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION['user'])) {
|
|
header("Location: index.php");
|
|
exit;
|
|
}
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Menu Utama</title>
|
|
<link rel="stylesheet" href="assets/style.css">
|
|
|
|
<style>
|
|
/* Popup background */
|
|
#settingsPopup {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0,0,0,0.7);
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
/* Popup box */
|
|
.popup-box {
|
|
background: #1e1e1e;
|
|
width: 350px;
|
|
padding: 20px;
|
|
border-radius: 12px;
|
|
text-align: center;
|
|
color: white;
|
|
box-shadow: 0 0 20px black;
|
|
}
|
|
|
|
.popup-option {
|
|
width: 100%;
|
|
padding: 12px;
|
|
margin-top: 8px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 15px;
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="box" style="width: 350px;">
|
|
<h2>Menu Utama</h2>
|
|
<p>Halo, <b><?= $_SESSION['user'] ?></b></p>
|
|
|
|
<a href="game.php">
|
|
<button style="width: 100%;">Mulai Game</button>
|
|
</a>
|
|
|
|
<!-- Tombol Settings membuka popup -->
|
|
<button onclick="openSettings()" style="width: 100%; background:#00d37e;">Pengaturan</button>
|
|
|
|
<a href="logout.php">
|
|
<button style="width: 100%; background: #ff4d4d;">Keluar</button>
|
|
</a>
|
|
</div>
|
|
|
|
|
|
<!-- ================= SETTINGS POPUP ================== -->
|
|
<div id="settingsPopup">
|
|
<div class="popup-box">
|
|
<h2>Pengaturan</h2>
|
|
|
|
<a href="skins.php">
|
|
<button class="popup-option" style="background:#ffaa00;">Pilih Skin</button>
|
|
</a>
|
|
|
|
<button class="popup-option" onclick="closeSettings()" style="background:#555;">Kembali</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
function openSettings() {
|
|
document.getElementById("settingsPopup").style.display = "flex";
|
|
}
|
|
|
|
function closeSettings() {
|
|
document.getElementById("settingsPopup").style.display = "none";
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|