243 lines
7.1 KiB
PHP
243 lines
7.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
require_once __DIR__ . '/includes/i18n.php';
|
|
require_once __DIR__ . '/db/config.php';
|
|
|
|
$slug = $_GET['slug'] ?? '';
|
|
$pdo = db();
|
|
$stmt = $pdo->prepare("SELECT * FROM projects WHERE slug = ?");
|
|
$stmt->execute([$slug]);
|
|
$project = $stmt->fetch();
|
|
|
|
if (!$project) {
|
|
header("Location: index.php");
|
|
exit;
|
|
}
|
|
|
|
$projectName = $_SERVER['PROJECT_NAME'] ?? 'Zhang Portfolio';
|
|
?>
|
|
<!doctype html>
|
|
<html lang="<?= $lang ?>" dir="<?= ($lang === 'ar' ? 'rtl' : 'ltr') ?>">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title><?= htmlspecialchars($project['title']) ?> | <?= htmlspecialchars($projectName) ?></title>
|
|
|
|
<link rel="icon" type="image/svg+xml" href="assets/logo.svg">
|
|
|
|
<!-- Fonts -->
|
|
<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=Montserrat:wght@400;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap" rel="stylesheet">
|
|
|
|
<!-- Icons -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time() ?>">
|
|
<style>
|
|
body { font-family: 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif; }
|
|
.project-hero {
|
|
height: 60vh;
|
|
background-size: cover;
|
|
background-position: center;
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: white;
|
|
text-align: center;
|
|
}
|
|
.project-hero::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0; left: 0; width: 100%; height: 100%;
|
|
background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
|
|
}
|
|
.project-hero-content {
|
|
position: relative;
|
|
z-index: 1;
|
|
max-width: 800px;
|
|
padding: 0 20px;
|
|
}
|
|
.project-hero h1 {
|
|
font-size: 3.5rem;
|
|
color: white;
|
|
margin-bottom: 20px;
|
|
}
|
|
.project-meta-top {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 30px;
|
|
font-weight: 600;
|
|
opacity: 0.9;
|
|
}
|
|
.project-main {
|
|
padding: 80px 0;
|
|
}
|
|
.project-layout {
|
|
display: grid;
|
|
grid-template-columns: 2fr 1fr;
|
|
gap: 60px;
|
|
}
|
|
.project-content {
|
|
background: white;
|
|
padding: 40px;
|
|
border-radius: 20px;
|
|
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
|
|
}
|
|
.project-content h3 {
|
|
font-size: 1.8rem;
|
|
margin: 30px 0 20px;
|
|
color: var(--primary);
|
|
}
|
|
.project-content p {
|
|
font-size: 1.1rem;
|
|
margin-bottom: 20px;
|
|
color: var(--gray-dark);
|
|
line-height: 1.8;
|
|
}
|
|
.project-content ul {
|
|
margin-bottom: 30px;
|
|
}
|
|
.project-content li {
|
|
margin-bottom: 12px;
|
|
padding-left: 25px;
|
|
position: relative;
|
|
}
|
|
.project-content li::before {
|
|
content: '\f00c';
|
|
font-family: 'Font Awesome 6 Free';
|
|
font-weight: 900;
|
|
position: absolute;
|
|
left: 0;
|
|
color: var(--secondary);
|
|
}
|
|
.project-sidebar {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 30px;
|
|
}
|
|
.sidebar-widget {
|
|
background: #f8fafc;
|
|
padding: 30px;
|
|
border-radius: 20px;
|
|
border: 1px solid var(--gray-light);
|
|
}
|
|
.sidebar-widget h4 {
|
|
font-size: 1.2rem;
|
|
margin-bottom: 20px;
|
|
border-bottom: 2px solid var(--primary);
|
|
display: inline-block;
|
|
padding-bottom: 5px;
|
|
}
|
|
.info-list li {
|
|
margin-bottom: 15px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.info-list span {
|
|
font-size: 0.85rem;
|
|
color: var(--gray);
|
|
text-transform: uppercase;
|
|
font-weight: 700;
|
|
margin-bottom: 3px;
|
|
}
|
|
.info-list strong {
|
|
color: var(--dark);
|
|
font-size: 1.05rem;
|
|
}
|
|
.back-nav {
|
|
position: absolute;
|
|
top: 30px;
|
|
left: 30px;
|
|
z-index: 10;
|
|
}
|
|
.back-btn {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
backdrop-filter: blur(10px);
|
|
color: white;
|
|
padding: 10px 20px;
|
|
border-radius: 50px;
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
font-weight: 600;
|
|
}
|
|
.back-btn:hover {
|
|
background: white;
|
|
color: var(--primary);
|
|
}
|
|
@media (max-width: 992px) {
|
|
.project-layout { grid-template-columns: 1fr; }
|
|
.project-hero h1 { font-size: 2.5rem; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header class="project-hero" style="background-image: url('<?= htmlspecialchars($project['image_url']) ?>');">
|
|
<div class="back-nav">
|
|
<a href="index.php#portfolio" class="back-btn"><i class="fas fa-arrow-left"></i> <?= t('filter_all') ?></a>
|
|
</div>
|
|
<div class="project-hero-content">
|
|
<span class="badge"><?= htmlspecialchars($project['category']) ?></span>
|
|
<h1><?= htmlspecialchars($project['title']) ?></h1>
|
|
<div class="project-meta-top">
|
|
<span><i class="far fa-calendar-alt"></i> <?= htmlspecialchars($project['project_date']) ?></span>
|
|
<span><i class="far fa-user"></i> <?= htmlspecialchars($project['client_name']) ?></span>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="project-main">
|
|
<div class="container">
|
|
<div class="project-layout">
|
|
<div class="project-content">
|
|
<?= $project['full_content'] ?>
|
|
|
|
<div class="project-actions" style="margin-top: 50px; border-top: 1px solid #eee; padding-top: 30px;">
|
|
<a href="index.php#contact" class="btn btn-primary"><?= t('nav_contact') ?></a>
|
|
</div>
|
|
</div>
|
|
|
|
<aside class="project-sidebar">
|
|
<div class="sidebar-widget">
|
|
<h4>Overview</h4>
|
|
<ul class="info-list">
|
|
<li>
|
|
<span>Client</span>
|
|
<strong><?= htmlspecialchars($project['client_name']) ?></strong>
|
|
</li>
|
|
<li>
|
|
<span>Date</span>
|
|
<strong><?= htmlspecialchars($project['project_date']) ?></strong>
|
|
</li>
|
|
<li>
|
|
<span>Stack</span>
|
|
<strong><?= htmlspecialchars($project['tech_stack']) ?></strong>
|
|
</li>
|
|
<li>
|
|
<span>Category</span>
|
|
<strong><?= htmlspecialchars(strtoupper($project['category'])) ?></strong>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="sidebar-widget">
|
|
<h4>Expert Advice</h4>
|
|
<p style="margin-bottom: 20px; font-size: 0.95rem;">Interested in this case? We can provide a professional technical assessment.</p>
|
|
<a href="https://t.me/zhangshihao818" class="btn btn-primary btn-block" target="_blank">
|
|
<i class="fab fa-telegram"></i> Telegram
|
|
</a>
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer style="padding: 60px 0;">
|
|
<div class="container" style="text-align: center;">
|
|
<p>© <?= date('Y') ?> <?= htmlspecialchars($projectName) ?>. All Rights Reserved.</p>
|
|
</div>
|
|
</footer>
|
|
|
|
</body>
|
|
</html>
|