Files
sistav.com/log/index.php
T
2026-05-19 21:36:23 -04:00

45 lines
1.8 KiB
PHP

<?php
$title = 'Log';
$description = "Running tab of my time.";
include $_SERVER['DOCUMENT_ROOT'] . '/includes/head.php';
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/assets/data/log.json'), true);
$entries = $data['entries'] ?? [];
$fields = ['listening', 'watching','playing', 'reading', 'working on', 'thinking'];
?>
<body class="bg-[#0a0a0a] text-white min-h-screen">
<?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/nav.php'; ?>
<main class="pt-16">
<div class="max-w-3xl mx-auto px-4 sm:px-6 py-12">
<h1 class="text-2xl font-semibold mb-6">Log</h1>
<p class="text-neutral-300 text-lg mb-16 text-center">What I've been spending my time on. It's most likely not upto date.</p>
<div class="space-y-12">
<?php if (empty($entries)): ?>
<p class="text-neutral-700 text-base">Nothing yet.</p>
<?php endif; ?>
<?php foreach ($entries as $entry): ?>
<article>
<h2 class="text-xl text-neutral-300 uppercase tracking-widest mb-5"><?= htmlspecialchars($entry['title']) ?></h2>
<p class="text-[#a3a3a3] text-sm font-mono mb-6"><?= date('F j, Y', strtotime($entry['date'])) ?></p>
<dl class="space-y-3">
<?php foreach ($fields as $field): ?>
<?php if (!empty($entry[$field])): ?>
<div class="grid grid-cols-[110px_1fr] gap-4">
<dt class="text-neutral-400 text-base"><?= $field ?></dt>
<dd class="text-neutral-200 text-base"><?= htmlspecialchars($entry[$field]) ?></dd>
</div>
<?php endif; ?>
<?php endforeach; ?>
</dl>
</article>
<?php endforeach; ?>
</div>
</div>
</main>
</body>
</html>