Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
final version
  • Loading branch information
Cut0x committed Oct 14, 2024
1 parent 643f38a commit 4bac934
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 64 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# discord-website-bot
Template for your Discord bot site
Template for your website Discord bot.

This template allows you to make a dynamic web page for your Discord bot!

# How to configure the site?
## Information between ` [] `
All you have to do is change the values ​​to your own.
```
Example: [BOT_NAME] to Wyno
```

## Edit the ` config.php ` file
Simply replace the information with yours in the **config.php** file.

> `config.php`
```php
<?php
// Configurations for your project

// Database connection information
define('DB_HOST', 'localhost'); // Database host (usually 'localhost')
define('DB_USER', 'root'); // Database username
define('DB_PASSWORD', 'password'); // Database password
define('DB_NAME', 'bot_database'); // Database name

// Discord bot token (replace with the real token)
define('DISCORD_BOT_TOKEN', 'TOKEN_BOT');

// Discord API URL to get bot guilds
define('DISCORD_API_URL', 'https://discord.com/api/v10/users/@me/guilds');

// Other global configurations
define('SITE_NAME', 'BOT_NAME');
define('SITE_URL', 'WEBSITE_URL');
```
67 changes: 67 additions & 0 deletions commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
// Inclure la configuration
require 'config.php';

// Lire et décoder le fichier JSON contenant les commandes
$json_data = file_get_contents('src/commands.json');
$commands = json_decode($json_data, true);
?>

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[BOT_NAME] - Commands</title>

<link rel="stylesheet" href="src/css/style.css">

<?php include('./src/inc/head.php'); ?>
</head>
<body>
<nav>
<div class="brand"><i class="fas fa-robot"></i> [BOT_NAME]</div>
<div class="nav-links">
<a href="./"><i class="fas fa-home"></i> Home</a>
<a href="commands.php"><i class="fas fa-list"></i> Commands</a>
<a href="dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</div>

<div class="mobile-menu-icon" onclick="toggleMenu()">
<i class="fas fa-bars"></i>
</div>
</nav>

<div class="mobile-menu" id="mobileMenu">
<a href="./"><i class="fas fa-home"></i> Home</a>
<a href="commands.php"><i class="fas fa-list"></i> Commands</a>
<a href="dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</div>

<!-- Contents of the Commands page -->
<section class="commands-section">
<h1>[BOT_NAME] commands</h1>
<p>Here is the list of main commands available on [BOT_NAME] :</p>

<div class="commands-list">
<?php if (isset($commands['commands']) && !empty($commands['commands'])): ?>
<?php foreach ($commands['commands'] as $command): ?>
<div class="command">
<i class="<?php echo htmlspecialchars($command['icon']); ?>"></i>
<div class="command-details">
<h3><?php echo htmlspecialchars($command['name']); ?></h3>
<p><?php echo htmlspecialchars($command['description']); ?></p>
</div>
</div>
<?php endforeach; ?>
<?php else: ?>
<p>No commands available.</p>
<?php endif; ?>
</div>
</section>

<?php include('src/inc/footer.php'); ?>

<script src="src/js/script.js"></script>
</body>
</html>
24 changes: 10 additions & 14 deletions config.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<?php
// Configurations pour ton projet
// Configurations for your project

// Informations de connexion à la base de données
define('DB_HOST', 'localhost'); // Hôte de la base de données (généralement 'localhost')
define('DB_USER', 'root'); // Nom d'utilisateur de la base de données
define('DB_PASSWORD', 'password'); // Mot de passe de la base de données
define('DB_NAME', 'bot_database'); // Nom de la base de données
// Database connection information
define('DB_HOST', 'localhost'); // Database host (usually 'localhost')
define('DB_USER', 'root'); // Database username
define('DB_PASSWORD', 'password'); // Database password
define('DB_NAME', 'bot_database'); // Database name

// Token du bot Discord (remplacer par le vrai token)
// Discord bot token (replace with the real token)
define('DISCORD_BOT_TOKEN', 'TOKEN_BOT');

// URL de l'API Discord pour obtenir les guildes du bot
// Discord API URL to get bot guilds
define('DISCORD_API_URL', 'https://discord.com/api/v10/users/@me/guilds');

// Autres configurations globales
// Other global configurations
define('SITE_NAME', 'BOT_NAME');
define('SITE_URL', 'WEBSITE_URL');

// Paramètres divers
define('DEFAULT_LANGUAGE', 'fr'); // Langue par défaut du site
define('TIMEZONE', 'Europe/Paris'); // Fuseau horaire par défaut
define('SITE_URL', 'WEBSITE_URL');
46 changes: 46 additions & 0 deletions dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
// Inclure la configuration
require 'config.php';
?>

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[NAME_BOT] - Dashboard</title>

<link rel="stylesheet" href="src/css/style.css">

<?php include('./src/inc/head.php'); ?>
</head>
<body>
<nav>
<div class="brand"><i class="fas fa-robot"></i> T'Bot</div>
<div class="nav-links">
<a href="./"><i class="fas fa-home"></i> Home</a>
<a href="commands.php"><i class="fas fa-list"></i> Commandes</a>
<a href="dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</div>
<div class="mobile-menu-icon" onclick="toggleMenu()">
<i class="fas fa-bars"></i>
</div>
</nav>

<div class="mobile-menu" id="mobileMenu">
<a href="./"><i class="fas fa-home"></i> Home</a>
<a href="commandes.php"><i class="fas fa-list"></i> Commandes</a>
<a href="dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</div>

<!-- Dashboard de systèmes -->
<section class="dashboard-section">
<h1><i class="fas fa-cogs"></i> Hello <span style="color: lightblue;"><?php ?></span>!</h1>
<p>And welcome.</p>
</section>

<?php include('src/inc/footer.php'); ?>

<script src="src/js/script.js"></script>
</body>
</html>
59 changes: 14 additions & 45 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include('./src/inc/stats-count.php');

// Calculer le nombre total de serveurs et d'utilisateurs
// Calculate total number of servers and users
$total_servers = count($guilds);
?>

Expand All @@ -21,8 +21,8 @@
<div class="brand"><i class="fas fa-robot"></i> [BOT_NAME]</div>
<div class="nav-links">
<a href="./"><i class="fas fa-home"></i> Home</a>
<a href="#commands"><i class="fas fa-list"></i> Commandes</a>
<a href="#dashboard"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
<a href="commands.php"><i class="fas fa-list"></i> Commands</a>
<a href="dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</div>

<div class="mobile-menu-icon" onclick="toggleMenu()">
Expand All @@ -31,14 +31,14 @@
</nav>

<div class="mobile-menu" id="mobileMenu">
<a href="#home"><i class="fas fa-home"></i> Home</a>
<a href="#commands"><i class="fas fa-list"></i> Commandes</a>
<a href="#dashboard"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
<a href="./"><i class="fas fa-home"></i> Home</a>
<a href="commands.php"><i class="fas fa-list"></i> Commands</a>
<a href="dashboard.php"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
</div>

<div class="content">
<h1><i class="fas fa-magic"></i> Bienvenue sur [BOT_NAME]</h1>
<p><i class="fas fa-cogs"></i> Le bot qui sert à tout et à rien, constamment en amélioration.</p>
<h1><i class="fas fa-magic"></i> Welcome to [BOT_NAME]</h1>
<p><i class="fas fa-cogs"></i> The bot that is used for everything and nothing, constantly improving.</p>
</div>

<div class="bot-stats">
Expand All @@ -47,15 +47,15 @@
<div class="stat">
<i class="fas fa-server"></i>
<div class="stat-details">
<h3>Serveurs</h3>
<h3>Guilds</h3>
<p id="serverCount" data-count="<?php echo $total_servers; ?>">0</p>
</div>
</div>

<div class="stat">
<i class="fas fa-terminal"></i>
<div class="stat-details">
<h3>Commandes</h3>
<h3>Commands</h3>
<p id="commandCount" data-count="300">0</p>
</div>
</div>
Expand All @@ -68,7 +68,7 @@
<img src="src/images/features/feature_3.PNG" alt="Image flottante 3" class="float-image">
</div>

<!-- Profil du créateur -->
<!-- Creator profile -->
<section class="creator-profile">
<div class="banner">
<img src="src/images/me/your_banner.png" alt="Bannière du créateur">
Expand All @@ -92,38 +92,7 @@

<?php include('./src/inc/footer.php'); ?>

<script>
function toggleMenu() {
var menu = document.getElementById("mobileMenu");
if (menu) {
menu.classList.toggle("active");
} else {
console.error("L'élément mobileMenu n'a pas été trouvé");
}
}

// Fonction pour animer les compteurs
function animateCounter(element, start, end, duration) {
let startTimestamp = null;
const step = (timestamp) => {
if (!startTimestamp) startTimestamp = timestamp;
const progress = Math.min((timestamp - startTimestamp) / duration, 1);
element.textContent = Math.floor(progress * (end - start) + start);
if (progress < 1) {
window.requestAnimationFrame(step);
}
};
window.requestAnimationFrame(step);
}

// Lancer l'animation pour chaque statistique
document.addEventListener("DOMContentLoaded", function() {
const serverCount = document.getElementById("serverCount");
const commandCount = document.getElementById("commandCount");

animateCounter(serverCount, 0, parseInt(serverCount.getAttribute('data-count')), 2000);
animateCounter(commandCount, 0, parseInt(commandCount.getAttribute('data-count')), 2000);
});
</script>
<script src="src/js/script.js"></script>
<script src="src/js/countEffect.js"></script>
</body>
</html>
</html>
54 changes: 54 additions & 0 deletions src/commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"commands": [
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
},
{
"name": "/commands",
"description": "title of the command.",
"icon": "fas fa-info-circle"
}
]
}
Loading

0 comments on commit 4bac934

Please sign in to comment.