Move portfolio case studies to data-driven template system and archive old individual files

This commit is contained in:
Ovidiu U
2026-03-15 18:04:56 +00:00
parent ac917dbc0a
commit 28cd60a427
21 changed files with 1789 additions and 1188 deletions

View File

@@ -1,12 +1,22 @@
<?php
$slugs = array_keys($projects);
$idx = array_search($cs_slug, $slugs);
$prev = $idx > 0 ? $slugs[$idx - 1] : null;
$next = $idx < count($slugs) - 1 ? $slugs[$idx + 1] : null;
?>
<section class="section section-cta">
<div class="section-label"> Next</div>
<div class="section-content">
<a href="/portfolio" class="cs-back cs-back--lg"> Back to All Work</a>
<p class="large-text">Got a project in mind?</p>
<a href="mailto:hello@uovidiu.com" class="btn">Let's Talk →</a>
</div>
</section>
<div class="project-nav">
<?php if ($prev): ?>
<a href="/portfolio/<?php echo htmlspecialchars($prev); ?>/" class="project-nav-link">← <?php echo htmlspecialchars($projects[$prev]['title']); ?></a>
<?php else: ?>
<a href="/portfolio" class="project-nav-link">← Back to Portfolio</a>
<?php endif; ?>
<?php if ($next): ?>
<a href="/portfolio/<?php echo htmlspecialchars($next); ?>/" class="project-nav-link">Next Project → <?php echo htmlspecialchars($projects[$next]['title']); ?></a>
<?php else: ?>
<a href="/portfolio" class="project-nav-link">← Back to Portfolio</a>
<?php endif; ?>
</div>
<script src="/js/screenshot-scroll-hint.js"></script>
<?php require __DIR__ . '/footer.php'; ?>

View File

@@ -3,13 +3,8 @@
/*
* Case Study Header Partial
* ─────────────────────────────────────────────────────────────────
* Requires the following variables set by the calling page BEFORE
* requiring this file:
*
* Requires the following variable set by the calling page:
* $cs_slug string Key into $projects, e.g. 'thompson'
*
* Everything else ($title, $description, hero content) is read from
* $projects[$cs_slug] in data/projects.php.
* ─────────────────────────────────────────────────────────────────
*/
@@ -18,21 +13,42 @@ require __DIR__ . '/../data/projects.php';
$p = $projects[$cs_slug];
$title = $p['page_title'];
$description = $p['page_desc'];
$nav_back = ['url' => '/portfolio', 'label' => '← Portfolio'];
//$nav_cta = ['url' => 'https://' . $p['domain'], 'label' => 'Visit Site →'];
require __DIR__ . '/header.php';
?>
<div class="cs-breadcrumb">
<a href="/portfolio" class="cs-back">← All Work</a>
<span class="cs-breadcrumb-label">[<?= htmlspecialchars($p['num']) ?> / <?= htmlspecialchars($p['code']) ?>]</span>
</div>
<header class="hero">
<div class="section-label">Case Study — <?= htmlspecialchars($p['num']) ?></div>
<h1><?= htmlspecialchars($p['h1'][0]) ?><br><span class="h1-sub"><?= htmlspecialchars($p['h1'][1]) ?></span></h1>
<p class="hero-sub"><?= htmlspecialchars($p['sub']) ?></p>
<ul class="cs-meta-bar">
<li><?= htmlspecialchars($p['stack']) ?></li>
<li><?= htmlspecialchars($p['location']) ?></li>
<li><?= htmlspecialchars($p['year']) ?></li>
</ul>
<header class="hero hero--cs">
<div class="hero-content">
<div class="hero-divider"></div>
<div class="hero-meta-row">
<div class="hero-meta">
<span><?php echo htmlspecialchars($p['num']); ?> / WEB_DEV · <?php echo htmlspecialchars($p['year']); ?></span>
<span><?php echo htmlspecialchars($p['location']); ?></span>
</div>
</div>
<h1 class="hero-headline">
<span class="line1"><?php echo htmlspecialchars($p['h1'][0]); ?></span>
<span class="line2"><?php echo htmlspecialchars($p['h1'][1]); ?></span>
</h1>
</div>
</header>
<div class="meta-bar">
<div class="meta-col">
<span class="meta-col-label">Client</span>
<span class="meta-col-value"><?php echo htmlspecialchars($p['title']); ?></span>
</div>
<div class="meta-col">
<span class="meta-col-label">Year</span>
<span class="meta-col-value"><?php echo htmlspecialchars($p['year']); ?></span>
</div>
<div class="meta-col">
<span class="meta-col-label">Stack</span>
<span class="meta-col-value"><?php echo htmlspecialchars($p['stack']); ?></span>
</div>
<div class="meta-col">
<span class="meta-col-label">Location</span>
<span class="meta-col-value"><?php echo htmlspecialchars($p['location']); ?></span>
</div>
</div>

View File

@@ -1,7 +1,47 @@
<footer class="footer">
<span>© <?php echo date('Y'); ?> Ovidiu Ungureanu</span>
<span>Built with PHP, no JS frameworks were harmed.</span>
</footer>
<footer class="footer">
<div class="footer-grid">
<div>
<h4 class="footer-heading">Studio</h4>
<address class="footer-address">
Peterborough, UK<br>
<a href="mailto:hello@uovidiu.com">hello@uovidiu.com</a>
</address>
</div>
<div>
<h4 class="footer-heading">Navigate</h4>
<ul class="footer-links">
<li><a href="/#about">About</a></li>
<li><a href="/#services">Services</a></li>
<li><a href="/portfolio">Portfolio</a></li>
<li><a href="/#contact">Contact</a></li>
</ul>
</div>
<!-- <div>-->
<!-- <div class="footer-cta">-->
<!-- <label for="footer-email">Start a project</label>-->
<!-- <div class="footer-input-row">-->
<!-- <input type="email" id="footer-email" placeholder="Your email" autocomplete="email">-->
<!-- <button type="button">Send</button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="footer-bottom">
<span class="footer-ghost">U. ovidiu</span>
<span class="footer-legal">© <?php echo date('Y'); ?> Ovidiu Ungureanu</span>
</div>
</footer>
<script>
const nav = document.querySelector('.nav');
window.addEventListener('scroll', () => {
nav.classList.toggle('nav--scrolled', window.scrollY > 50);
}, { passive: true });
</script>
</body>
</html>

View File

@@ -1,32 +1,50 @@
<?php $current = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($title); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($description); ?>">
<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=JetBrains+Mono:wght@400;700;900&family=DM+Sans:wght@400;500&family=Archivo+Black&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/style.css">
<?php if (!empty($extra_css)): ?>
<link rel="stylesheet" href="<?php echo htmlspecialchars($extra_css); ?>">
<?php endif; ?>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($title); ?></title>
<meta name="description" content="<?php echo htmlspecialchars($description); ?>">
<link rel="preconnect" href="https://api.fontshare.com">
<link href="https://api.fontshare.com/v2/css?f[]=clash-grotesk@700,600,500,400&f[]=general-sans@700,600,500,400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/style.css">
<?php if (!empty($extra_css)): ?>
<link rel="stylesheet" href="<?php echo htmlspecialchars($extra_css); ?>">
<?php endif; ?>
</head>
<body>
<?php $current = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); ?>
<nav class="nav">
<div class="nav-left">
<a href="/" class="nav-logo">OU</a>
<?php if (str_starts_with($current, '/portfolio/')): ?>
<a href="/portfolio" class="nav-back">←(back)</a>
<?php endif; ?>
</div>
<div class="nav-links">
<a href="/#about">About</a>
<a href="/#services">Services</a>
<a href="/portfolio"<?php echo (str_starts_with($current, '/portfolio')) ? ' class="active"' : ''; ?>>Work</a>
<a href="/#contact">Contact</a>
</div>
</nav>
<div class="noise" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<filter id="n">
<feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/>
</filter>
<rect width="100%" height="100%" filter="url(#n)"/>
</svg>
</div>
<nav class="nav">
<?php if (!empty($nav_back)): ?>
<div class="nav-left">
<a href="<?php echo htmlspecialchars($nav_back['url']); ?>" class="nav-back"><?php echo htmlspecialchars($nav_back['label']); ?></a>
<a href="/" class="nav-logo">U. ovidiu</a>
</div>
<div class="nav-links">
<a href="/#about" class="nav-link">About</a>
<a href="/#services" class="nav-link">Services</a>
<a href="/#contact" class="nav-link">Contact</a>
</div>
<?php if (!empty($nav_cta)): ?>
<a href="<?php echo htmlspecialchars($nav_cta['url']); ?>" target="_blank" rel="noopener" class="nav-cta"><?php echo htmlspecialchars($nav_cta['label']); ?></a>
<?php endif; ?>
<?php else: ?>
<a href="/" class="nav-logo">U. ovidiu</a>
<div class="nav-links">
<a href="/#about" class="nav-link">About</a>
<a href="/#services" class="nav-link">Services</a>
<a href="/portfolio" class="nav-link<?php echo str_starts_with($current, '/portfolio') ? ' nav-link--active' : ''; ?>">Work</a>
<a href="/#contact" class="nav-link">Contact</a>
</div>
<?php endif; ?>
</nav>