Website-fabianschieder/index.php

149 lines
4.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
/*
* Absolute Webpfade verwenden!
* Ordnerstruktur im Webroot:
* /icons/...
* /style.css
*/
$projects = [
"privat" => [
[
"title" => "Gitea",
"description" => "Mein privates Git-Repository Quellcode, Projekte & mehr.",
"url" => "/git",
"logo" => "/icons/gitea.svg",
"color" => "#609926"
],
[
"title" => "Nextcloud",
"description" => "Meine persönliche Cloud Dateien, Kalender & Kontakte.",
"url" => "/nextcloud",
"logo" => "/icons/nextcloud.svg",
"color" => "#0082c9"
],
],
"schule" => [
[
"title" => "Geizkragen.store",
"description" => "Schulprojekt Ein Online-Shop für Schnäppchenjäger.",
"url" => "https://geizkragen.store",
"logo" => "/icons/geizkragen.png",
"color" => "#e8281e",
"external" => true
],
],
"dienste" => [
[
"title" => "Home Assistant",
"description" => "Meine Smart-Home-Zentrale Automatisierungen & Geräte.",
"url" => "http://homeassistant.fabianschieder.com",
"logo" => "/icons/homeassistant.svg",
"color" => "#18BCF2",
"external" => true
],
[
"title" => "NAS",
"description" => "Mein Netzwerkspeicher Daten & Backups.",
"url" => "http://nas.fabianschieder.com",
"logo" => "/icons/nas.svg",
"color" => "#a855f7",
"external" => true
],
],
];
/**
* Optional: Prüft serverseitig, ob die Logo-Datei existiert.
* Verhindert Broken Images.
*/
function logoExists(string $webPath): bool {
$base = rtrim($_SERVER['DOCUMENT_ROOT'] ?? '/var/www/fabianschieder.com', '/');
$full = $base . ltrim($webPath, '.');
// Debug: echo "<!-- checking: $full -->\n";
return is_file($full);
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fabian Schieder</title>
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
</head>
<body>
<div class="background-blur"></div>
<header>
<div class="avatar">FS</div>
<h1>Fabian Schieder</h1>
<p class="tagline">Entwickler · Schüler · Macher</p>
</header>
<main>
<?php foreach ($projects as $category => $items): ?>
<section>
<h2 class="category-title">
<?php
switch ($category) {
case "privat":
echo '<i class="fas fa-lock"></i> Privat';
break;
case "schule":
echo '<i class="fas fa-graduation-cap"></i> Schule';
break;
case "dienste":
echo '<i class="fas fa-network-wired"></i> Dienste';
break;
}
?>
</h2>
<div class="cards">
<?php foreach ($items as $project): ?>
<a
href="<?= htmlspecialchars($project['url'], ENT_QUOTES) ?>"
class="card"
<?= !empty($project['external']) ? 'target="_blank" rel="noopener noreferrer"' : '' ?>
style="--accent: <?= htmlspecialchars($project['color'], ENT_QUOTES) ?>;"
>
<div class="card-icon">
<?php if (!empty($project['logo'])): ?>
<img
src="<?= htmlspecialchars($project['logo'], ENT_QUOTES) ?>"
alt="<?= htmlspecialchars($project['title'], ENT_QUOTES) ?> Logo"
class="card-logo"
>
<?php else: ?>
<i class="fas fa-folder"></i>
<?php endif; ?>
</div>
<div class="card-body">
<h3><?= htmlspecialchars($project['title'], ENT_QUOTES) ?></h3>
<p><?= htmlspecialchars($project['description'], ENT_QUOTES) ?></p>
</div>
<div class="card-arrow">
<i class="fas fa-arrow-right"></i>
</div>
</a>
<?php endforeach; ?>
</div>
</section>
<?php endforeach; ?>
</main>
<footer>
<p>&copy; <?= date('Y') ?> Fabian Schieder — Alle Rechte vorbehalten.</p>
</footer>
</body>
</html>