first push

This commit is contained in:
Thijs Stobbelaar 2023-09-21 09:19:12 +02:00
parent a3c232a5a8
commit c5a0aee73a
12 changed files with 394 additions and 1 deletions

3
includes/footer.php Normal file
View file

@ -0,0 +1,3 @@
<footer>
<p>&copy; 2023 DTCH Clan. All rights reserved.</p>
</footer>

7
includes/navigation.php Normal file
View file

@ -0,0 +1,7 @@
<nav>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="clan_stats.php">Clan Stats</a></li>
<li><a href="user_stats.php">User Stats</a></li>
</ul>
</nav>

41
includes/ratelimiter.php Normal file
View file

@ -0,0 +1,41 @@
<?php
session_start();
$allowed_refreshes = 3;
$allowed_time = 10;
if (!isset($_SESSION['access_times'])) {
$_SESSION['access_times'] = [];
}
$now = time();
$_SESSION['access_times'][] = $now;
foreach ($_SESSION['access_times'] as $key => $timestamp) {
if ($now - $timestamp > $allowed_time) {
unset($_SESSION['access_times'][$key]);
}
}
if (count($_SESSION['access_times']) > $allowed_refreshes) {
die('
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="3">
<title>RustAGHH</title>
</head>
<body>
<p>RUSTAAAGGHHHH je mag de pagina niet vaker dan ' . $allowed_refreshes . 'x per ' . $allowed_time . ' seconde refreshen. Over een paar seconde word je weet terug geleid</p>
</body>
</html>
');
}
?>

100
includes/styles.css Normal file
View file

@ -0,0 +1,100 @@
/* Reset some default styles */
body, h1, h2, p, ul, li, a {
margin: 0;
padding: 0;
text-decoration: none;
}
body {
font-family: Arial, sans-serif;
background-color: black;
color: white;
}
nav {
background-color: #333;
}
nav ul {
list-style-type: none;
padding: 0;
}
nav li {
display: inline-block;
margin-right: 10px;
}
nav li:last-child {
margin-right: 0;
}
nav a {
color: white;
padding: 10px 15px;
display: block;
}
nav a:hover {
background-color: #555;
}
header, main, footer {
max-width: 800px;
margin: 20px auto;
padding: 10px 20px;
border: 1px solid white;
}
header h1, section h2 {
border-bottom: 1px solid white;
margin-bottom: 10px;
padding-bottom: 5px;
}
footer {
text-align: center;
}
/* Responsive Styles */
@media (max-width: 600px) {
nav li {
display: block;
margin-right: 0;
}
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid white;
}
th, td {
padding: 10px;
text-align: left;
}
th {
background-color: #555;
}
tr:hover {
background-color: #444;
}
.discord-logo {
width: 50px; /* Reduced from 50px to 30px */
height: auto;
margin-top: 10px;
cursor: pointer;
transition: opacity 0.3s;
}
.discord-logo:hover {
opacity: 0.8;
}