Files
2026-06-01 18:08:37 -04:00

39 lines
1.4 KiB
PHP

<?php
$title = 'Contact';
$description = 'The wise man does not hide. He simply waits to be found.';
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/assets/data/contact.json'), true);
$contacts = $data['contacts'] ?? [];
include $_SERVER['DOCUMENT_ROOT'] . '/includes/head.php';
?>
<body>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/nav.php'; ?>
<main class="page">
<div class="wrap">
<h1>Contact</h1>
<p class="incantation">Get in touch. Feel free to send me gifs.</p>
<div class="card-list">
<?php foreach ($contacts as $c):
$external = strpos($c['url'], 'mailto:') !== 0;
$host = parse_url($c['url'], PHP_URL_HOST);
?>
<a href="<?= htmlspecialchars($c['url']) ?>"<?= $external ? ' target="_blank" rel="noopener"' : '' ?> class="card">
<div class="card-row">
<div>
<h2 class="card-title"><?= htmlspecialchars($c['label']) ?></h2>
<p class="card-note"><?= htmlspecialchars($c['value']) ?></p>
</div>
<?php if ($host): ?>
<span class="card-host"><?= htmlspecialchars($host) ?></span>
<?php endif; ?>
</div>
</a>
<?php endforeach; ?>
</div>
</div>
</main>
</body>
</html>