-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
393 lines (340 loc) · 12.9 KB
/
Copy pathindex.php
File metadata and controls
393 lines (340 loc) · 12.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/lang.php';
?>
<?php
// Funktion um .env zu laden
function loadEnv($path) {
if (!file_exists($path)) {
die(".env Datei nicht gefunden!");
}
$lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$env = [];
foreach ($lines as $line) {
if (strpos(trim($line), '#') === 0) continue; // Kommentare überspringen
list($key, $value) = explode('=', $line, 2);
$env[trim($key)] = trim($value);
}
return $env;
}
// Lade die .env (Pfad anpassen falls nötig)
$env = loadEnv(__DIR__ . '/.env');
// Benutze die geladenen Variablen
$servername = $env['DB_HOST'];
$username = $env['DB_USER'];
$password = $env['DB_PASS'];
$dbname = $env['DB_NAME'];
// Verbindung herstellen
$conn = new mysqli($servername, $username, $password, $dbname);
// Verbindung prüfen
if ($conn->connect_error) {
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
}
// Beispiel-Abfrage
$sql = "SELECT id, servercount, usercount, commandCount, channelCount FROM website_stats";
$result = $conn->query($sql);
// Daten auslesen
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$servercount = $row['servercount'];
$usercount = $row['usercount'];
$commandCount = $row['commandCount'];
$channelCount = $row['channelCount'];
}
} else {
$servercount = 0;
$usercount = 0;
$commandCount = 0;
$channelCount = 0;
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Astra | Discord Bot</title>
<meta name="description" content="Astra – All-in-One Discord Bot mit Levelsystem, Economy, Moderation, Tickets, Mini-Games & mehr.">
<meta name="theme-color" content="#251f5b">
<link rel="icon" href="/public/favicon_transparent.png">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/style.css?v=2.4"/>
<meta property="og:title" content="Astra | Discord Bot">
<meta property="og:description" content="All-in-One Discord Bot mit Levels, Economy, Moderation, Tickets, Mini-Games & mehr.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://astra-bot.de/">
<meta property="og:image" content="https://astra-bot.de/public/og-image.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:type" content="image/png">
<script defer src="https://cloud.umami.is/script.js" data-website-id="caafee2b-2478-4148-8e69-3ebecc18416c"></script>
</head>
<body>
<script>
if (window.self !== window.top) {
const loader = document.getElementById('astra-loader');
if (loader) loader.remove();
}
</script>
<div id="astra-loader">
<div class="astra-loader-bg"></div>
<!-- Floating bubbles -->
<div class="astra-loader-bubbles">
<span></span><span></span><span></span><span></span><span></span>
</div>
<div class="astra-loader-core">
<div class="astra-loader-ring"></div>
<img src="/public/favicon_transparent.png" class="astra-loader-logo" alt="Astra">
<span class="astra-loader-text">Booting Astra</span>
</div>
</div>
<?php include "includes/header.php"; ?>
<main>
<!-- HERO -->
<section id="hero" class="astra-hero-card">
<div class="bubbles-bg">
<svg width="100%" height="100%">
<circle cx="18%" cy="18%" r="38" fill="#65e6ce33"/>
<circle cx="90%" cy="25%" r="64" fill="#a7c8fd22"/>
<circle cx="52%" cy="77%" r="44" fill="#7c41ee22"/>
<circle cx="95%" cy="90%" r="24" fill="#7c41ee22"/>
<circle cx="6%" cy="89%" r="41" fill="#60e9cb22"/>
</svg>
</div>
<div class="astra-hero-content">
<div>
<div class="astra-label-row">
<span class="astra-label green"><?= $t['label_level'] ?></span>
<span class="astra-label blue"><?= $t['label_mod'] ?></span>
<span class="astra-label yellow"><?= $t['label_eco'] ?></span>
</div>
<h1 class="hero-headline">
<span class="headline-static"><?= $t['hero_static'] ?></span>
<span id="typing-text" class="headline-dynamic"></span>
</h1>
<div class="astra-desc">
<b><?= $t['hero_title'] ?></b><br>
<?= $t['hero_desc'] ?>
</div>
<div class="astra-btn-row">
<a href="/invite.php?src=hero"
class="astra-btn main"
onclick="window.umami?.track('invite_click', { source: 'hero' })">
<?= $t['invite_bot'] ?>
</a>
<a href="/support.php" class="astra-btn outline"><?= $t['support_server'] ?></a>
</div>
<div class="astra-badges-row">
<span class="astra-badge mint"><?= $t['badge_xp'] ?></span>
<span class="astra-badge violet"><?= $t['badge_games'] ?></span>
<span class="astra-badge yellow"><?= $t['badge_tickets'] ?></span>
<span class="astra-badge blue"><?= $t['badge_automod'] ?></span>
</div>
<div class="cta-absatz">
<b><?= $t['hero_cta'] ?></b>
</div>
</div>
<div>
<img src="/public/favicon_transparent.png" alt="Astra Logo" class="astra-hero-logo">
</div>
</div>
</section>
<!-- STATS -->
<section id="stats" class="astra-stats">
<div class="stat-card">
<span class="stat-num" data-val="<?= $servercount ?>">0</span>
<div class="stat-title"><?= $t['servers'] ?></div>
</div>
<div class="stat-card">
<span class="stat-num" data-val="<?= $usercount ?>">0</span>
<div class="stat-title"><?= $t['users'] ?></div>
</div>
<div class="stat-card">
<span class="stat-num" data-val="<?= $commandCount ?>">0</span>
<div class="stat-title"><?= $t['commands'] ?></div>
</div>
<div class="stat-card">
<span class="stat-num" data-val="<?= $channelCount ?>">0</span>
<div class="stat-title"><?= $t['channels'] ?></div>
</div>
</section>
<!-- ABOUT -->
<section id="about" class="astra-about-card">
<div class="about-img-wrap">
<img src="/public/favicon_transparent.png" alt="Astra About" class="about-img">
</div>
<div>
<h2><?= $t['about_title'] ?></h2>
<p><?= $t['about_text'] ?></p>
<ul>
<?php foreach ($t['about_list'] as $item): ?>
<li><?= $item ?></li>
<?php endforeach; ?>
</ul>
<a href="/commands" class="about-link"><?= $t['about_link'] ?></a>
</div>
</section>
<!-- FEATURES -->
<section id="features" class="astra-features-grid">
<div class="feature-card">
<div class="feature-title green"><?= $t['feature_level'] ?></div>
<div><?= $t['feature_level_desc'] ?></div>
</div>
<div class="feature-card">
<div class="feature-title yellow"><?= $t['feature_eco'] ?></div>
<div><?= $t['feature_eco_desc'] ?></div>
</div>
<div class="feature-card">
<div class="feature-title blue"><?= $t['feature_mod'] ?></div>
<div><?= $t['feature_mod_desc'] ?></div>
</div>
<div class="feature-card">
<div class="feature-title violet"><?= $t['feature_tools'] ?></div>
<div><?= $t['feature_tools_desc'] ?></div>
</div>
</section>
<!-- FAQ -->
<section id="faq" class="astra-faq-section">
<h2><?= $t['faq_title'] ?></h2>
<div class="faq-list">
<?php foreach ($t['faq'] as $faq): ?>
<div class="faq-item">
<button class="faq-question"><?= $faq['q'] ?></button>
<div class="faq-answer"><?= $faq['a'] ?></div>
</div>
<?php endforeach; ?>
</div>
</section>
</main>
<?php include "includes/footer.php";?>
<script>
(function () {
const loader = document.getElementById('astra-loader');
const KEY = 'astra_loader_shown';
// Nur beim ersten Besuch
if (sessionStorage.getItem(KEY)) {
loader.remove();
return;
}
sessionStorage.setItem(KEY, 'true');
window.addEventListener('load', () => {
setTimeout(() => {
loader.classList.add('hide');
setTimeout(() => loader.remove(), 500);
}, 1300); // fühlt sich smooth an, nicht künstlich
});
})();
</script>
<script>
const navToggle = document.querySelector('.astra-nav-toggle');
navToggle.addEventListener('click', () => {
document.body.classList.toggle('nav-open');
// aria-expanded toggle
const expanded = navToggle.getAttribute('aria-expanded') === 'true';
navToggle.setAttribute('aria-expanded', !expanded);
});
</script>
<!-- FAQ Dropdown Script -->
<script>
document.querySelectorAll('.faq-question').forEach(q => {
q.addEventListener('click', function() {
const item = this.parentElement;
const answer = item.querySelector('.faq-answer');
if (item.classList.contains('open')) {
answer.style.maxHeight = null;
item.classList.remove('open');
} else {
// Alle anderen schließen
document.querySelectorAll('.faq-item.open').forEach(openItem => {
openItem.classList.remove('open');
openItem.querySelector('.faq-answer').style.maxHeight = null;
});
// Dieses öffnen
answer.style.maxHeight = answer.scrollHeight + "px";
item.classList.add('open');
}
});
});
</script>
<!-- Counter Animation -->
<script>
document.querySelectorAll('.stat-num').forEach(el => {
const end = +el.getAttribute('data-val');
let n = 0, step = Math.max(1, Math.floor(end / 40));
const inc = () => {
n += step;
if(n >= end) { el.textContent = end; }
else { el.textContent = n; requestAnimationFrame(inc); }
};
inc();
});
</script>
<!-- Scrollto Script (smooth scroll for nav) -->
<script>
document.querySelectorAll('.scrollto').forEach(link => {
link.addEventListener('click', function(e) {
const id = this.getAttribute('href').split('#')[1];
const target = document.getElementById(id);
if (target) {
e.preventDefault();
window.scrollTo({ top: target.offsetTop - 80, behavior: 'smooth' });
document.body.classList.remove('nav-open');
}
});
});
</script>
<script>
const navToggle = document.querySelector('.astra-nav-toggle');
navToggle.addEventListener('click', (e) => {
e.stopPropagation();
body.classList.toggle('nav-open');
const expanded = navToggle.getAttribute('aria-expanded') === 'true';
navToggle.setAttribute('aria-expanded', String(!expanded));
// Sofort Fokus entfernen, damit :focus oder :active nicht hängen bleiben
navToggle.blur();
});
</script>
<script>
const words = [
"modern.",
"zuverlässig.",
"effizient.",
"modular.",
"stabil.",
"innovativ."
];
const el = document.getElementById("typing-text");
let wordIndex = 0;
let charIndex = 0;
let state = "typing";
const typingSpeed = 90;
const deletingSpeed = 50;
const pauseAfterTyping = 1400;
const pauseAfterDeleting = 400;
function loop() {
const word = words[wordIndex];
if (state === "typing") {
el.textContent = word.slice(0, charIndex + 1);
charIndex++;
if (charIndex === word.length) {
state = "pause";
setTimeout(() => state = "deleting", pauseAfterTyping);
}
}
else if (state === "deleting") {
el.textContent = word.slice(0, charIndex - 1);
charIndex--;
if (charIndex === 0) {
state = "pause";
wordIndex = (wordIndex + 1) % words.length;
setTimeout(() => state = "typing", pauseAfterDeleting);
}
}
setTimeout(loop, state === "typing" ? typingSpeed : deletingSpeed);
}
loop();
</script>
<script>
const words = <?= json_encode($t['typing_words']) ?>;
</script>
</body>
</html>