36276-vm/index.php
Flatlogic Bot fee9213453 1.0
2025-11-25 14:54:52 +00:00

162 lines
6.6 KiB
PHP

<?php
// Mock data for the dashboard
$top_games = [
[
'title' => 'Just Chatting',
'viewers' => '350K',
'tags' => ['IRL'],
'img' => 'https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg'
],
[
'title' => 'League of Legends',
'viewers' => '125K',
'tags' => ['MOBA', 'Action'],
'img' => 'https://static-cdn.jtvnw.net/ttv-boxart/21779-285x380.jpg'
],
[
'title' => 'VALORANT',
'viewers' => '98K',
'tags' => ['FPS', 'Shooter'],
'img' => 'https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg'
],
[
'title' => 'Grand Theft Auto V',
'viewers' => '88K',
'tags' => ['Adventure'],
'img' => 'https://static-cdn.jtvnw.net/ttv-boxart/32982_IGDB-285x380.jpg'
],
];
$live_channels = [
[
'name' => 'xQc',
'game' => 'Just Chatting',
'viewers' => '78K',
'img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/xqc-profile_image-9298d2877057642a-70x70.png'
],
[
'name' => 'Tarik',
'game' => 'VALORANT',
'viewers' => '45K',
'img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/tarik-profile_image-d6f82a69354da623-70x70.png'
],
[
'name' => 'summit1g',
'game' => 'Old School RuneScape',
'viewers' => '21K',
'img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/summit1g-profile_image-d29b89b15533818c-70x70.png'
],
[
'name' => 'LIRIK',
'game' => 'DayZ',
'viewers' => '15K',
'img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/lirik-profile_image-4ac8c3250307d433-70x70.png'
],
];
// Read project preview data from environment
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Twitch.TV Statistics Dashboard';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
$projectName = $_SERVER['PROJECT_NAME'] ?? 'Twitch Stats';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title><?= htmlspecialchars($projectName) ?> - Dashboard</title>
<!-- Meta description -->
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>"/>
<!-- Open Graph meta tags -->
<meta property="og:title" content="<?= htmlspecialchars($projectName) ?>"/>
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>"/>
<!-- Twitter meta tags -->
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:title" content="<?= htmlspecialchars($projectName) ?>"/>
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>"/>
<?php if ($projectImageUrl): ?>
<!-- Open Graph image -->
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>"/>
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>"/>
<?php endif; ?>
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<!-- Google Fonts & Icons -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#"><i class="fab fa-twitch"></i> <?= htmlspecialchars($projectName) ?></a>
</div>
</nav>
<main class="container my-5">
<h1 class="mb-4">Top Categories</h1>
<div class="row g-4">
<?php foreach ($top_games as $game): ?>
<div class="col-6 col-md-4 col-lg-3">
<div class="card h-100">
<img src="<?= htmlspecialchars($game['img']) ?>" class="card-img-top" alt="<?= htmlspecialchars($game['title']) ?>">
<div class="card-body">
<h5 class="card-title mb-1"><?= htmlspecialchars($game['title']) ?></h5>
<p class="viewers mb-2"><i class="fas fa-circle icon"></i> <?= htmlspecialchars($game['viewers']) ?> viewers</p>
<div>
<?php foreach ($game['tags'] as $tag): ?>
<span class="badge rounded-pill badge-genre"><?= htmlspecialchars($tag) ?></span>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<h1 class="my-4 pt-4">Recommended Live Channels</h1>
<div class="row g-3">
<?php foreach ($live_channels as $channel): ?>
<div class="col-12 col-md-6 col-lg-4">
<div class="card">
<div class="card-body d-flex align-items-center">
<img src="<?= htmlspecialchars($channel['img']) ?>" class="rounded-circle me-3" alt="<?= htmlspecialchars($channel['name']) ?>" width="60" height="60">
<div class="flex-grow-1">
<h5 class="card-title mb-0"><?= htmlspecialchars($channel['name']) ?></h5>
<p class="card-text mb-1"><?= htmlspecialchars($channel['game']) ?></p>
</div>
<div class="viewers text-end">
<i class="fas fa-circle icon"></i> <?= htmlspecialchars($channel['viewers']) ?>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</main>
<footer class="footer mt-5">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> <?= htmlspecialchars($projectName) ?>. All rights reserved.</p>
<p>Powered by Flatlogic.</p>
</div>
</footer>
<!-- Bootstrap 5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>