view project fixes

This commit is contained in:
2026-11-19 20:40:34 +05:45
parent e9e7940410
commit 2718d3d889
2 changed files with 392 additions and 158 deletions
+322 -114
View File
@@ -3996,7 +3996,7 @@ button {
.cert-hero {
position: relative;
overflow: hidden;
padding: 50px 0 90px;
padding: 40px 0 40px;
background: var(--cert-bg);
}
.cert-hero::after {
@@ -6779,8 +6779,7 @@ button {
transform: scale(1.04);
}
.student-work .student-card__badge,
.project-detail .project-detail__badge {
.student-work .student-card__badge {
display: inline-flex;
align-items: center;
padding: 6px 12px;
@@ -6964,75 +6963,32 @@ button {
line-height: 1.7;
}
/* ---------- Detail page (view-project.php) ---------- */
/* ============================================================
VIEW PROJECT PAGE
============================================================ */
/* ---------- Hero ---------- */
.project-detail {
--cert-bg: #0D0D0D;
--cert-white: var(--text);
--cert-muted: var(--muted);
--cert-red: var(--accent);
background-color: var(--bg);
font-family: var(--font-main);
}
.project-detail .section {
padding-block: 64px;
}
.project-detail .section__head {
max-width: none;
margin-bottom: 26px;
}
.project-detail .project-detail__hero .eyebrow,
.project-detail .project-detail__info .eyebrow,
.project-detail .section__head .eyebrow {
gap: 8px;
margin-bottom: 0;
color: var(--white);
font-size: 10px;
font-weight: 500;
line-height: 1.4;
letter-spacing: 0.15em;
text-transform: uppercase;
}
.project-detail .eyebrow::before {
width: 14px;
height: 2px;
border-radius: 0;
background: var(--white);
}
.project-detail .section__title {
margin: 14px 0 0;
color: var(--text);
font-size: clamp(26px, 3.4vw, 36px);
font-weight: 700;
line-height: 1.15;
letter-spacing: -0.01em;
}
.project-detail .project-detail__missing {
padding-top: calc(var(--header-h) + 32px);
}
.project-detail .project-detail__missing-inner {
max-width: 720px;
}
.project-detail .project-detail__missing-inner .btn {
margin-top: 24px;
}
.project-detail .project-detail__hero {
padding-top: calc(var(--header-h) - 8px);
padding-bottom: 48px;
border-bottom: 1px solid var(--border);
background-color: var(--bg-deep);
.project-detail a:focus-visible,
.project-detail button:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
}
.project-detail .project-detail__hero-inner {
max-width: 860px;
margin-bottom: 26px;
max-width: 760px;
}
.project-detail .breadcrumb {
margin-bottom: 16px;
.project-detail .project-detail__breadcrumb {
margin-bottom: 22px;
}
.project-detail .breadcrumb__list {
@@ -7040,6 +6996,9 @@ button {
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
@@ -7058,6 +7017,7 @@ button {
.project-detail .breadcrumb__item a {
color: var(--muted);
text-decoration: none;
transition: color var(--transition);
}
@@ -7069,61 +7029,127 @@ button {
color: var(--text);
}
.project-detail .project-detail__course {
display: block;
color: var(--accent);
font-size: 12px;
font-weight: 600;
line-height: 1.4;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.project-detail .project-detail__title {
margin-top: 14px;
color: var(--text);
font-size: clamp(30px, 4.5vw, 46px);
font-weight: 700;
line-height: 1.1;
letter-spacing: -0.02em;
}
.project-detail .project-detail__lead {
max-width: 720px;
max-width: 680px;
margin-top: 16px;
color: var(--muted);
font-size: 15px;
line-height: 1.7;
line-height: 1.75;
}
.project-detail .project-detail__media {
overflow: hidden;
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow);
/* ---------- Layout ---------- */
.project-detail .project-detail__missing {
padding-top: calc(var(--section-y) / 2);
}
.project-detail .project-detail__media img {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
.project-detail .project-detail__missing-inner {
max-width: 720px;
}
.project-detail .project-detail__missing-inner .btn {
margin-top: 24px;
}
.project-detail .project-detail__grid {
display: grid;
grid-template-columns: 1fr;
grid-template-columns: minmax(0, 1fr);
gap: 28px;
align-items: start;
}
.project-detail .project-detail__main {
display: flex;
min-width: 0;
flex-direction: column;
gap: 30px;
gap: 24px;
}
.project-detail .project-detail__block {
min-width: 0;
padding: 26px;
}
.project-detail .project-detail__block-head {
margin-bottom: 18px;
}
.project-detail .project-detail__block .eyebrow {
gap: 8px;
margin-bottom: 8px;
color: var(--accent);
font-size: 11px;
}
.project-detail .project-detail__block .eyebrow::before {
width: 14px;
height: 2px;
border-radius: 0;
background: var(--accent);
}
.project-detail .project-detail__block-title {
margin: 0;
color: var(--text);
font-size: 20px;
font-weight: 700;
line-height: 1.3;
letter-spacing: -0.015em;
}
/* ---------- Content blocks ---------- */
.project-detail .project-detail__disclaimer {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
border-radius: var(--radius);
background-color: var(--surface);
}
.project-detail .project-detail__disclaimer-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
flex: none;
border-radius: 50%;
background-color: var(--accent-soft);
color: var(--accent);
}
.project-detail .project-detail__disclaimer-icon .icon {
width: 14px;
height: 14px;
}
.project-detail .project-detail__disclaimer p {
color: var(--muted);
font-size: 13px;
line-height: 1.6;
}
.project-detail .project-detail__block + .project-detail__block {
padding-top: 30px;
border-top: 1px solid var(--border);
}
.project-detail .project-detail__text {
color: var(--muted);
font-size: 15px;
@@ -7140,7 +7166,7 @@ button {
display: flex;
align-items: flex-start;
gap: 12px;
color: var(--text-muted);
color: var(--text);
font-size: 15px;
line-height: 1.7;
}
@@ -7153,7 +7179,7 @@ button {
height: 28px;
margin-top: 1px;
flex: none;
border-radius: 8px;
border-radius: 50%;
background-color: var(--accent-soft);
color: var(--accent);
}
@@ -7163,6 +7189,8 @@ button {
height: 14px;
}
/* ---------- Skills ---------- */
.project-detail .project-detail__skills {
display: grid;
grid-template-columns: 1fr;
@@ -7171,6 +7199,7 @@ button {
.project-detail .project-detail__skill {
display: flex;
min-width: 0;
align-items: center;
gap: 14px;
padding: 16px 18px;
@@ -7183,8 +7212,8 @@ button {
width: 40px;
height: 40px;
flex: none;
border-radius: 10px;
background-color: var(--float-icon-bg);
border-radius: 50%;
background-color: var(--accent-soft);
color: var(--accent);
}
@@ -7200,6 +7229,7 @@ button {
line-height: 1.4;
}
/* ---------- Thinking cards ---------- */
.project-detail .project-detail__thinking-grid {
display: grid;
grid-template-columns: 1fr;
@@ -7207,11 +7237,17 @@ button {
}
.project-detail .project-detail__thinking-card {
padding: 22px;
display: flex;
height: 100%;
flex-direction: column;
padding: 24px;
}
/* ---------- Sidebar ---------- */
.project-detail .project-detail__sidebar {
display: flex;
min-width: 0;
flex-direction: column;
gap: 16px;
}
@@ -7221,7 +7257,7 @@ button {
}
.project-detail .project-detail__meta-title {
margin-bottom: 18px;
margin: 0;
color: var(--text);
font-size: 18px;
font-weight: 600;
@@ -7231,14 +7267,14 @@ button {
.project-detail .project-detail__meta-list {
display: flex;
flex-direction: column;
gap: 16px;
gap: 14px;
}
.project-detail .project-detail__meta-item {
display: flex;
flex-direction: column;
gap: 6px;
padding-top: 16px;
padding-top: 14px;
border-top: 1px solid var(--border);
}
@@ -7273,7 +7309,7 @@ button {
border: 1px solid var(--border);
border-radius: var(--radius-pill);
background-color: var(--surface);
color: var(--text-muted);
color: var(--text);
font-size: 12px;
line-height: 1.4;
}
@@ -7282,10 +7318,199 @@ button {
width: 100%;
}
/* ---------- More projects ---------- */
.project-detail .project-detail__more .section__head {
margin-bottom: 32px;
}
.project-detail .student-work__grid--more {
display: grid;
grid-template-columns: 1fr;
gap: 24px;
}
.project-detail .student-work__grid--more .student-card {
display: flex;
height: 100%;
min-width: 0;
flex-direction: column;
}
.project-detail .student-work__grid--more .student-card__media {
position: relative;
aspect-ratio: 16 / 10;
overflow: hidden;
background-color: var(--bg-alt);
}
.project-detail .student-work__grid--more .student-card__img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.6s ease;
}
.project-detail .student-work__grid--more .student-card:hover .student-card__img {
transform: scale(1.04);
}
.project-detail .student-work__grid--more .student-card__badge {
position: absolute;
top: 14px;
left: 14px;
}
.project-detail .student-work__grid--more .student-card__body {
display: flex;
flex: 1;
flex-direction: column;
gap: 10px;
padding: 22px;
}
.project-detail .student-work__grid--more .student-card__course {
color: var(--accent);
font-size: 11px;
font-weight: 600;
line-height: 1.4;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.project-detail .student-work__grid--more .student-card__title {
color: var(--text);
font-size: 20px;
font-weight: 600;
line-height: 1.3;
letter-spacing: -0.015em;
}
.project-detail .student-work__grid--more .student-card__desc {
color: var(--muted);
font-size: 14px;
line-height: 1.7;
}
.project-detail .student-work__grid--more .student-card__meta {
color: var(--muted-2);
font-size: 13px;
line-height: 1.6;
}
.project-detail .student-work__grid--more .student-card__skills {
color: var(--muted);
font-size: 13px;
font-weight: 500;
line-height: 1.6;
}
.project-detail .student-work__grid--more .student-card__footer {
display: flex;
flex-direction: column;
gap: 14px;
margin-top: auto;
padding-top: 6px;
}
.project-detail .student-work__grid--more .student-card__divider {
display: block;
width: 100%;
height: 1px;
background-color: var(--border);
}
.project-detail .student-work__grid--more .student-card__link {
display: inline-flex;
align-items: center;
gap: 8px;
align-self: flex-end;
color: var(--text);
font-size: 14px;
font-weight: 500;
line-height: 1.4;
transition: color var(--transition);
}
.project-detail .student-work__grid--more .student-card__link .icon {
width: 16px;
height: 16px;
transition: transform var(--transition);
}
.project-detail .student-work__grid--more .student-card__link:hover {
color: var(--accent);
}
.project-detail .student-work__grid--more .student-card__link:hover .icon {
transform: translateX(3px);
}
/* ---------- Responsive ---------- */
@media (min-width: 640px) {
.project-detail .project-detail__skills {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.project-detail .student-work__grid--more {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 768px) {
.project-detail .project-detail__thinking-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 980px) {
.project-detail .project-detail__grid {
grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
gap: 40px;
}
.project-detail .project-detail__thinking-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.project-detail .project-detail__sidebar {
position: sticky;
top: calc(var(--header-h) + 24px);
align-self: start;
}
.project-detail .student-work__grid--more {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 576px) {
.project-detail .project-detail__block,
.project-detail .project-detail__meta {
padding: 18px;
}
.project-detail .student-work__grid--more .student-card__body {
padding: 18px;
}
}
@media (prefers-reduced-motion: reduce) {
.project-detail *,
.project-detail *::before,
.project-detail *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
.project-detail .reveal {
opacity: 1;
transform: none;
}
}
/* ---------- CTA ---------- */
.student-work .student-work__cta-note {
margin-top: 18px;
@@ -7300,20 +7525,17 @@ button {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.student-work .student-work__grid,
.project-detail .project-detail__skills {
.student-work .student-work__grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.student-work .student-work__process-grid,
.project-detail .project-detail__thinking-grid {
.student-work .student-work__process-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 768px) {
.student-work .section,
.project-detail .section {
.student-work .section {
padding-block: 72px;
}
@@ -7328,25 +7550,13 @@ button {
gap: 40px;
}
.student-work .student-work__process-grid,
.project-detail .project-detail__thinking-grid {
.student-work .student-work__process-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.project-detail .project-detail__grid {
grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
gap: 40px;
}
.project-detail .project-detail__sidebar {
position: sticky;
top: calc(var(--header-h) + 24px);
}
}
@media (max-width: 576px) {
.student-work .section,
.project-detail .section {
.student-work .section {
padding-block: 52px;
}
@@ -7361,9 +7571,7 @@ button {
}
.student-work .student-card__body,
.student-work .student-work__process-card,
.project-detail .project-detail__meta,
.project-detail .project-detail__thinking-card {
.student-work .student-work__process-card {
padding: 18px;
}
}
+70 -44
View File
@@ -57,10 +57,35 @@ require __DIR__ . '/includes/header.php';
$skillIcons = !empty($currentProject['skill_icons']) && is_array($currentProject['skill_icons'])
? $currentProject['skill_icons']
: (!empty($currentProject['skills']) && is_array($currentProject['skills']) ? $currentProject['skills'] : []);
$skillIconMap = [];
if (is_array($skillIcons)) {
foreach ($skillIcons as $index => $skillIconEntry) {
if (!is_array($skillIconEntry)) {
continue;
}
$iconLabel = (string) ($skillIconEntry['label'] ?? '');
if ($iconLabel === '') {
$iconLabel = (string) ($projectSkills[$index] ?? '');
}
if ($iconLabel !== '') {
$skillIconMap[$iconLabel] = (string) ($skillIconEntry['icon'] ?? 'sparkles');
}
}
}
$projectSkillItems = [];
foreach ($projectSkills as $skillLabel) {
if (isset($projectSkillItems[$skillLabel])) {
continue;
}
$projectSkillItems[$skillLabel] = [
'label' => $skillLabel,
'icon' => $skillIconMap[$skillLabel] ?? 'sparkles',
];
}
?>
<!-- ===== PROJECT HERO ===== -->
<section class="project-detail__hero section">
<section class="project-detail__hero cert-hero section">
<div class="container">
<div class="project-detail__hero-inner reveal">
<nav class="breadcrumb project-detail__breadcrumb" aria-label="Breadcrumb">
@@ -71,23 +96,16 @@ require __DIR__ . '/includes/header.php';
</ol>
</nav>
<span class="project-detail__badge">Placeholder project</span>
<?php if ($projectCourse !== ''): ?>
<span class="project-detail__course"><?= e($projectCourse) ?></span>
<?php endif; ?>
<h1 class="section__title project-detail__title"><?= e($currentProject['title']) ?></h1>
<h1 class="project-detail__title"><?= e($currentProject['title']) ?></h1>
<?php if (!empty($currentProject['description'])): ?>
<p class="section__lead project-detail__lead"><?= e($currentProject['description']) ?></p>
<p class="project-detail__lead"><?= e($currentProject['description']) ?></p>
<?php endif; ?>
</div>
<div class="project-detail__media reveal">
<img
src="<?= e($currentProject['image']) ?>"
alt="<?= e($currentProject['alt'] ?? $currentProject['title']) ?>"
width="1200"
height="675"
>
</div>
</div>
</section>
@@ -96,23 +114,26 @@ require __DIR__ . '/includes/header.php';
<div class="container">
<div class="project-detail__grid">
<div class="project-detail__main">
<p class="project-detail__disclaimer reveal">Editable placeholder – not an actual student achievement.</p>
<div class="project-detail__disclaimer reveal" role="note">
<span class="project-detail__disclaimer-icon" aria-hidden="true"><?= icon('sparkles') ?></span>
<p>Editable placeholder – not an actual student achievement.</p>
</div>
<?php if (!empty($currentProject['overview'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<section class="project-detail__block card reveal">
<div class="project-detail__block-head">
<span class="eyebrow">Project summary</span>
<h2 class="section__title">Overview</h2>
<h2 class="project-detail__block-title">Overview</h2>
</div>
<p class="project-detail__text"><?= e($currentProject['overview']) ?></p>
</div>
</section>
<?php endif; ?>
<?php if (!empty($currentProject['built']) && is_array($currentProject['built'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<section class="project-detail__block card reveal">
<div class="project-detail__block-head">
<span class="eyebrow">Student work</span>
<h2 class="section__title">What the students built</h2>
<h2 class="project-detail__block-title">What the students built</h2>
</div>
<ul class="project-detail__list">
<?php foreach ($currentProject['built'] as $item): ?>
@@ -122,38 +143,31 @@ require __DIR__ . '/includes/header.php';
</li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($skillIcons) && is_array($skillIcons)): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<?php if (!empty($projectSkillItems)): ?>
<section class="project-detail__block reveal">
<div class="project-detail__block-head">
<span class="eyebrow">Learning outcomes</span>
<h2 class="section__title">Skills learned</h2>
<h2 class="project-detail__block-title">Skills learned</h2>
</div>
<ul class="project-detail__skills">
<?php foreach ($skillIcons as $skill): ?>
<?php
$skillLabel = is_array($skill) ? ($skill['label'] ?? '') : (string) $skill;
$skillIcon = is_array($skill) ? ($skill['icon'] ?? 'sparkles') : 'sparkles';
if ($skillLabel === '') {
continue;
}
?>
<?php foreach ($projectSkillItems as $skill): ?>
<li class="project-detail__skill card">
<span class="project-detail__skill-icon"><?= icon($skillIcon) ?></span>
<span class="project-detail__skill-label"><?= e($skillLabel) ?></span>
<span class="project-detail__skill-icon"><?= icon($skill['icon']) ?></span>
<span class="project-detail__skill-label"><?= e($skill['label']) ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($currentProject['brief']) || !empty($currentProject['process']) || !empty($currentProject['reflection'])): ?>
<div class="project-detail__block reveal">
<div class="section__head">
<section class="project-detail__block reveal">
<div class="project-detail__block-head">
<span class="eyebrow">More than the final output</span>
<h2 class="section__title">Brief / Process / Reflection</h2>
<h2 class="project-detail__block-title">Brief / Process / Reflection</h2>
</div>
<div class="project-detail__thinking-grid">
<?php if (!empty($currentProject['brief'])): ?>
@@ -178,13 +192,16 @@ require __DIR__ . '/includes/header.php';
</article>
<?php endif; ?>
</div>
</div>
</section>
<?php endif; ?>
</div>
<aside class="project-detail__sidebar reveal">
<div class="project-detail__meta card">
<h2 class="project-detail__meta-title">Project details</h2>
<div class="project-detail__block-head">
<span class="eyebrow">At a glance</span>
<h2 class="project-detail__meta-title">Project details</h2>
</div>
<dl class="project-detail__meta-list">
<?php if ($projectCourse !== ''): ?>
<div class="project-detail__meta-item">
@@ -235,7 +252,7 @@ require __DIR__ . '/includes/header.php';
</dl>
</div>
<a class="btn btn--light project-detail__back-link" href="student-work.php#gallery">Back to all projects</a>
<a class="btn btn--primary project-detail__back-link" href="student-work.php#gallery">Back to all projects</a>
</aside>
</div>
</div>
@@ -278,6 +295,15 @@ require __DIR__ . '/includes/header.php';
}));
}
$skillsLine = implode(' · ', $skillsList);
$metaParts = [];
if ($student !== '') {
$metaParts[] = $student;
}
if ($batch !== '') {
$metaParts[] = $batch;
}
$metaParts[] = 'Editable placeholders – not an actual student achievement';
$metaLine = implode(' · ', $metaParts);
?>
<article class="student-card card reveal">
<div class="student-card__media">
@@ -299,7 +325,7 @@ require __DIR__ . '/includes/header.php';
<?php if (!empty($project['description'])): ?>
<p class="student-card__desc"><?= e($project['description']) ?></p>
<?php endif; ?>
<p class="student-card__meta"><?= e($student) ?> · <?= e($batch) ?> · Editable placeholders – not an actual student achievement</p>
<p class="student-card__meta"><?= e($metaLine) ?></p>
<?php if ($skillsLine !== ''): ?>
<p class="student-card__skills"><?= e($skillsLine) ?></p>
<?php endif; ?>