add static course library with chapter-aware media browsing
This commit is contained in:
11 files changed
+1545
-7
No files matched your search
@@ -0,0 +1 @@
|
||||
"""Static assets for the generated local course library."""
|
||||
@@ -0,0 +1,325 @@
|
||||
const state = { catalog: null, course: null, query: "", filter: "all" };
|
||||
|
||||
const byId = (id) => document.getElementById(id);
|
||||
const clampPercent = (value) => Math.max(0, Math.min(100, Math.round(value || 0)));
|
||||
|
||||
function formatBytes(bytes) {
|
||||
if (!Number.isFinite(bytes) || bytes <= 0) return "—";
|
||||
const units = ["B", "KB", "MB", "GB", "TB"];
|
||||
let value = bytes;
|
||||
let index = 0;
|
||||
while (value >= 1024 && index < units.length - 1) {
|
||||
value /= 1024;
|
||||
index += 1;
|
||||
}
|
||||
const digits = value >= 10 || index === 0 ? 0 : 1;
|
||||
return `${value.toFixed(digits)} ${units[index]}`;
|
||||
}
|
||||
|
||||
function normalized(value) {
|
||||
return String(value || "").toLocaleLowerCase().trim();
|
||||
}
|
||||
|
||||
function setText(id, value) {
|
||||
const element = byId(id);
|
||||
if (element) element.textContent = value;
|
||||
}
|
||||
|
||||
function applyTheme(theme) {
|
||||
document.documentElement.dataset.theme = theme;
|
||||
localStorage.setItem("ravin-library-theme", theme);
|
||||
}
|
||||
|
||||
function setupTheme() {
|
||||
const stored = localStorage.getItem("ravin-library-theme");
|
||||
const preferred = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
applyTheme(stored || preferred);
|
||||
byId("themeToggle")?.addEventListener("click", () => {
|
||||
applyTheme(document.documentElement.dataset.theme === "dark" ? "light" : "dark");
|
||||
});
|
||||
}
|
||||
|
||||
async function loadCatalog() {
|
||||
const response = await fetch("courses.json", { cache: "no-store" });
|
||||
if (!response.ok) throw new Error(`Could not load courses.json (${response.status})`);
|
||||
return response.json();
|
||||
}
|
||||
|
||||
function showLoadError(error) {
|
||||
const target = byId("courseGrid") || byId("sectionList");
|
||||
if (!target) return;
|
||||
target.innerHTML = "";
|
||||
const box = document.createElement("div");
|
||||
box.className = "empty-state";
|
||||
const title = document.createElement("strong");
|
||||
title.textContent = "The course data could not be loaded";
|
||||
const detail = document.createElement("span");
|
||||
detail.textContent = "Open this library with ‘ravin-downloader serve-library’, then refresh the page.";
|
||||
box.append(title, detail);
|
||||
target.append(box);
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
function courseCard(course) {
|
||||
const percent = clampPercent((course.downloaded_count / Math.max(course.file_count, 1)) * 100);
|
||||
const card = document.createElement("article");
|
||||
card.className = "course-card";
|
||||
|
||||
const top = document.createElement("div");
|
||||
top.className = "course-card-top";
|
||||
const code = document.createElement("span");
|
||||
code.className = "course-code";
|
||||
code.textContent = course.shortname || `Course ${course.id}`;
|
||||
const badge = document.createElement("span");
|
||||
badge.className = "course-badge";
|
||||
badge.textContent = `${course.activity_count ?? course.file_count} activities`;
|
||||
top.append(code, badge);
|
||||
|
||||
const title = document.createElement("h3");
|
||||
title.dir = "auto";
|
||||
title.textContent = course.fullname;
|
||||
const meta = document.createElement("p");
|
||||
meta.className = "course-card-meta";
|
||||
meta.textContent = `${course.section_count} chapters · ${course.file_count} files · ${formatBytes(course.downloaded_bytes)} offline`;
|
||||
|
||||
const bottom = document.createElement("div");
|
||||
bottom.className = "course-card-bottom";
|
||||
const track = document.createElement("div");
|
||||
track.className = "progress-track";
|
||||
const fill = document.createElement("span");
|
||||
fill.style.setProperty("--progress", `${percent}%`);
|
||||
track.append(fill);
|
||||
const progress = document.createElement("div");
|
||||
progress.className = "progress-copy";
|
||||
progress.innerHTML = `<span>${course.downloaded_count} offline</span><strong>${percent}%</strong>`;
|
||||
const link = document.createElement("a");
|
||||
link.className = "course-link";
|
||||
link.href = `course.html?id=${encodeURIComponent(course.id)}`;
|
||||
link.innerHTML = `Open course <span aria-hidden="true">→</span>`;
|
||||
bottom.append(track, progress, link);
|
||||
card.append(top, title, meta, bottom);
|
||||
return card;
|
||||
}
|
||||
|
||||
function renderCourseGrid() {
|
||||
const grid = byId("courseGrid");
|
||||
const query = normalized(byId("courseSearch")?.value);
|
||||
const courses = state.catalog.courses.filter((course) => normalized(`${course.fullname} ${course.shortname}`).includes(query));
|
||||
grid.innerHTML = "";
|
||||
courses.forEach((course) => grid.append(courseCard(course)));
|
||||
byId("emptyCourses").hidden = courses.length !== 0;
|
||||
}
|
||||
|
||||
function renderIndex() {
|
||||
const stats = state.catalog.stats;
|
||||
const percent = clampPercent((stats.downloaded_files / Math.max(stats.files, 1)) * 100);
|
||||
setText("heroPercent", `${percent}%`);
|
||||
setText("courseCount", stats.courses.toLocaleString());
|
||||
setText("resourceCount", (stats.activities ?? stats.files).toLocaleString());
|
||||
setText("downloadedCount", stats.downloaded_files.toLocaleString());
|
||||
setText("librarySize", formatBytes(stats.downloaded_bytes));
|
||||
setText("generatedAt", `Updated ${new Date(state.catalog.generated_at).toLocaleString()}`);
|
||||
byId("courseSearch").addEventListener("input", renderCourseGrid);
|
||||
renderCourseGrid();
|
||||
}
|
||||
|
||||
function completionKey(item) {
|
||||
return `ravin-complete-${state.course.id}-${item.id}`;
|
||||
}
|
||||
|
||||
function isComplete(item) {
|
||||
return localStorage.getItem(completionKey(item)) === "1";
|
||||
}
|
||||
|
||||
function resourceMatches(item) {
|
||||
const haystack = normalized(`${item.title} ${item.filename} ${item.section}`);
|
||||
if (state.query && !haystack.includes(state.query)) return false;
|
||||
if (state.filter === "all") return true;
|
||||
if (state.filter === "downloaded" || state.filter === "missing") return item.status === state.filter;
|
||||
return item.kind === state.filter;
|
||||
}
|
||||
|
||||
function resourceRow(item, index) {
|
||||
const row = document.createElement("article");
|
||||
row.className = `resource-row${isComplete(item) ? " completed" : ""}`;
|
||||
const number = document.createElement("span");
|
||||
number.className = "resource-index";
|
||||
number.textContent = String(index + 1).padStart(2, "0");
|
||||
|
||||
const main = document.createElement("div");
|
||||
main.className = "resource-main";
|
||||
const title = document.createElement("span");
|
||||
title.className = "resource-title";
|
||||
title.dir = "auto";
|
||||
title.textContent = item.title;
|
||||
const filename = document.createElement("span");
|
||||
filename.className = "resource-file";
|
||||
filename.dir = "auto";
|
||||
filename.textContent = item.filename || item.badge || item.activity_type;
|
||||
main.append(title, filename);
|
||||
if (item.description) {
|
||||
const description = document.createElement("span");
|
||||
description.className = "resource-description";
|
||||
description.dir = "auto";
|
||||
description.textContent = item.description;
|
||||
main.append(description);
|
||||
}
|
||||
|
||||
const meta = document.createElement("div");
|
||||
meta.className = "resource-meta";
|
||||
const type = document.createElement("span");
|
||||
type.className = "type-pill";
|
||||
type.textContent = item.kind;
|
||||
const dot = document.createElement("span");
|
||||
dot.className = `status-dot${item.status === "missing" ? " missing" : item.status === "online" ? " online" : ""}`;
|
||||
const size = document.createElement("span");
|
||||
size.textContent = item.status === "partial"
|
||||
? `${formatBytes(item.local_bytes)} partial`
|
||||
: item.status === "online"
|
||||
? (item.lms_completed ? "LMS complete" : "Online")
|
||||
: formatBytes(item.size);
|
||||
meta.append(type, dot, size);
|
||||
|
||||
let action;
|
||||
if (item.status === "downloaded" && item.kind === "video") {
|
||||
action = document.createElement("button");
|
||||
action.type = "button";
|
||||
action.textContent = "Play";
|
||||
action.addEventListener("click", () => openVideo(item));
|
||||
} else if (item.status === "downloaded") {
|
||||
action = document.createElement("a");
|
||||
action.href = item.local_url;
|
||||
action.target = "_blank";
|
||||
action.rel = "noopener";
|
||||
action.textContent = item.kind === "document" ? "Open" : "View";
|
||||
} else if (item.status === "online" && item.source_url) {
|
||||
action = document.createElement("a");
|
||||
action.href = item.source_url;
|
||||
action.target = "_blank";
|
||||
action.rel = "noopener";
|
||||
action.textContent = "Open LMS";
|
||||
} else {
|
||||
action = document.createElement("span");
|
||||
action.textContent = item.status === "partial" ? "Partial" : "Missing";
|
||||
action.setAttribute("aria-disabled", "true");
|
||||
}
|
||||
action.className = "action-button";
|
||||
|
||||
const complete = document.createElement("input");
|
||||
complete.className = "complete-check";
|
||||
complete.type = "checkbox";
|
||||
complete.checked = isComplete(item);
|
||||
complete.setAttribute("aria-label", `Mark ${item.title} complete`);
|
||||
complete.addEventListener("change", () => {
|
||||
localStorage.setItem(completionKey(item), complete.checked ? "1" : "0");
|
||||
row.classList.toggle("completed", complete.checked);
|
||||
});
|
||||
row.append(number, main, meta, action, complete);
|
||||
return row;
|
||||
}
|
||||
|
||||
function renderResources() {
|
||||
const container = byId("sectionList");
|
||||
container.innerHTML = "";
|
||||
let visibleCount = 0;
|
||||
let runningIndex = 0;
|
||||
state.course.sections.forEach((section) => {
|
||||
const items = section.items.filter(resourceMatches);
|
||||
if (!items.length) return;
|
||||
visibleCount += items.length;
|
||||
const wrapper = document.createElement("section");
|
||||
wrapper.className = "resource-section";
|
||||
const heading = document.createElement("div");
|
||||
heading.className = "resource-section-header";
|
||||
const title = document.createElement("h2");
|
||||
title.dir = "auto";
|
||||
title.textContent = section.name;
|
||||
const count = document.createElement("span");
|
||||
count.textContent = `${items.length} resource${items.length === 1 ? "" : "s"}`;
|
||||
heading.append(title, count);
|
||||
if (section.summary) {
|
||||
const summary = document.createElement("p");
|
||||
summary.className = "section-summary";
|
||||
summary.dir = "auto";
|
||||
summary.textContent = section.summary;
|
||||
heading.append(summary);
|
||||
}
|
||||
const list = document.createElement("div");
|
||||
list.className = "resource-list";
|
||||
items.forEach((item) => {
|
||||
list.append(resourceRow(item, runningIndex));
|
||||
runningIndex += 1;
|
||||
});
|
||||
wrapper.append(heading, list);
|
||||
container.append(wrapper);
|
||||
});
|
||||
byId("emptyResources").hidden = visibleCount !== 0;
|
||||
}
|
||||
|
||||
function openVideo(item) {
|
||||
const dialog = byId("mediaDialog");
|
||||
const player = byId("mediaPlayer");
|
||||
setText("mediaTitle", item.title);
|
||||
player.src = item.local_url;
|
||||
dialog.showModal();
|
||||
player.play().catch(() => {});
|
||||
}
|
||||
|
||||
function closeVideo() {
|
||||
const dialog = byId("mediaDialog");
|
||||
const player = byId("mediaPlayer");
|
||||
player.pause();
|
||||
player.removeAttribute("src");
|
||||
player.load();
|
||||
dialog.close();
|
||||
}
|
||||
|
||||
function renderCourse() {
|
||||
const id = new URLSearchParams(window.location.search).get("id");
|
||||
state.course = state.catalog.courses.find((course) => String(course.id) === String(id));
|
||||
if (!state.course) {
|
||||
showLoadError(new Error(`Course ${id || "(missing)"} was not found`));
|
||||
return;
|
||||
}
|
||||
const course = state.course;
|
||||
document.title = `${course.fullname} · Learning Library`;
|
||||
const percent = clampPercent((course.downloaded_count / Math.max(course.file_count, 1)) * 100);
|
||||
setText("breadcrumbCourse", course.fullname);
|
||||
setText("courseCode", course.shortname || `Course ${course.id}`);
|
||||
setText("courseTitle", course.fullname);
|
||||
setText("courseSummary", `${course.activity_count ?? course.file_count} activities, ${course.file_count} downloadable files, and ${course.section_count} chapters.`);
|
||||
setText("coursePercent", `${percent}%`);
|
||||
setText("courseDownloaded", `${course.downloaded_count} of ${course.file_count}`);
|
||||
setText("generatedAt", `Updated ${new Date(state.catalog.generated_at).toLocaleString()}`);
|
||||
byId("courseProgress").style.setProperty("--progress", percent);
|
||||
byId("courseSource").href = course.source_url;
|
||||
byId("resourceSearch").addEventListener("input", (event) => {
|
||||
state.query = normalized(event.target.value);
|
||||
renderResources();
|
||||
});
|
||||
byId("resourceFilters").addEventListener("click", (event) => {
|
||||
const button = event.target.closest("button[data-filter]");
|
||||
if (!button) return;
|
||||
state.filter = button.dataset.filter;
|
||||
document.querySelectorAll("button[data-filter]").forEach((item) => item.classList.toggle("active", item === button));
|
||||
renderResources();
|
||||
});
|
||||
byId("closeMedia").addEventListener("click", closeVideo);
|
||||
byId("mediaDialog").addEventListener("click", (event) => {
|
||||
if (event.target === byId("mediaDialog")) closeVideo();
|
||||
});
|
||||
renderResources();
|
||||
}
|
||||
|
||||
async function start() {
|
||||
setupTheme();
|
||||
try {
|
||||
state.catalog = await loadCatalog();
|
||||
if (document.body.dataset.page === "course") renderCourse();
|
||||
else renderIndex();
|
||||
} catch (error) {
|
||||
showLoadError(error);
|
||||
}
|
||||
}
|
||||
|
||||
start();
|
||||
@@ -0,0 +1,75 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Browse the resources in a downloaded course.">
|
||||
<title>Course · Learning Library</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<script src="app.js" defer></script>
|
||||
</head>
|
||||
<body data-page="course">
|
||||
<header class="topbar">
|
||||
<a class="brand" href="index.html" aria-label="Back to Learning Library">
|
||||
<span class="brand-mark" aria-hidden="true">R</span>
|
||||
<span>Learning Library</span>
|
||||
</a>
|
||||
<button class="icon-button" id="themeToggle" type="button" aria-label="Toggle color theme">◐</button>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<nav class="breadcrumbs" aria-label="Breadcrumb">
|
||||
<a href="index.html">Library</a><span aria-hidden="true">/</span><span id="breadcrumbCourse">Course</span>
|
||||
</nav>
|
||||
|
||||
<section class="course-hero" aria-labelledby="courseTitle">
|
||||
<div class="course-heading">
|
||||
<p class="eyebrow" id="courseCode">Course</p>
|
||||
<h1 id="courseTitle">Loading course…</h1>
|
||||
<p class="hero-copy" id="courseSummary"></p>
|
||||
<a class="hero-source" id="courseSource" href="#" target="_blank" rel="noopener">Open in LMS ↗</a>
|
||||
</div>
|
||||
<div class="progress-panel">
|
||||
<div class="progress-ring" id="courseProgress" style="--progress: 0">
|
||||
<span id="coursePercent">0%</span>
|
||||
</div>
|
||||
<div><strong id="courseDownloaded">0 of 0</strong><span>files available offline</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="course-toolbar" aria-label="Resource controls">
|
||||
<label class="search-box resource-search">
|
||||
<span aria-hidden="true">⌕</span>
|
||||
<span class="sr-only">Search lessons and files</span>
|
||||
<input id="resourceSearch" type="search" placeholder="Search lessons and files" autocomplete="off">
|
||||
</label>
|
||||
<div class="filter-group" id="resourceFilters" aria-label="Filter resources">
|
||||
<button class="filter-chip active" type="button" data-filter="all">All</button>
|
||||
<button class="filter-chip" type="button" data-filter="video">Videos</button>
|
||||
<button class="filter-chip" type="button" data-filter="document">Documents</button>
|
||||
<button class="filter-chip" type="button" data-filter="downloaded">Offline</button>
|
||||
<button class="filter-chip" type="button" data-filter="missing">Missing</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="section-list" id="sectionList" aria-live="polite"></div>
|
||||
<div class="empty-state" id="emptyResources" hidden>
|
||||
<strong>No matching resources</strong>
|
||||
<span>Change the search or filter to see more.</span>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<dialog class="media-dialog" id="mediaDialog">
|
||||
<div class="dialog-heading">
|
||||
<div><p class="eyebrow">Now playing</p><h2 id="mediaTitle"></h2></div>
|
||||
<button class="icon-button" id="closeMedia" type="button" aria-label="Close player">×</button>
|
||||
</div>
|
||||
<video id="mediaPlayer" controls preload="metadata"></video>
|
||||
</dialog>
|
||||
|
||||
<footer>
|
||||
<a href="index.html">← All courses</a>
|
||||
<span id="generatedAt"></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,65 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="A private, local library for downloaded course materials.">
|
||||
<title>Learning Library</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<script src="app.js" defer></script>
|
||||
</head>
|
||||
<body data-page="index">
|
||||
<header class="topbar">
|
||||
<a class="brand" href="index.html" aria-label="Learning Library home">
|
||||
<span class="brand-mark" aria-hidden="true">R</span>
|
||||
<span>Learning Library</span>
|
||||
</a>
|
||||
<button class="icon-button" id="themeToggle" type="button" aria-label="Toggle color theme">◐</button>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="hero" aria-labelledby="pageTitle">
|
||||
<div>
|
||||
<p class="eyebrow">Your offline study space</p>
|
||||
<h1 id="pageTitle">Pick up where you left off.</h1>
|
||||
<p class="hero-copy">Every course, lesson, video, and document—organized around the work you want to finish.</p>
|
||||
</div>
|
||||
<div class="hero-orbit" aria-hidden="true">
|
||||
<span class="orbit-number" id="heroPercent">0%</span>
|
||||
<span class="orbit-label">available offline</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="stat-grid" aria-label="Library summary">
|
||||
<article class="stat-card"><span class="stat-label">Courses</span><strong id="courseCount">—</strong></article>
|
||||
<article class="stat-card"><span class="stat-label">Resources</span><strong id="resourceCount">—</strong></article>
|
||||
<article class="stat-card"><span class="stat-label">Downloaded</span><strong id="downloadedCount">—</strong></article>
|
||||
<article class="stat-card"><span class="stat-label">Library size</span><strong id="librarySize">—</strong></article>
|
||||
</section>
|
||||
|
||||
<section class="library-section" aria-labelledby="coursesHeading">
|
||||
<div class="section-heading">
|
||||
<div>
|
||||
<p class="eyebrow">Course collection</p>
|
||||
<h2 id="coursesHeading">Your courses</h2>
|
||||
</div>
|
||||
<label class="search-box">
|
||||
<span aria-hidden="true">⌕</span>
|
||||
<span class="sr-only">Search courses</span>
|
||||
<input id="courseSearch" type="search" placeholder="Search courses" autocomplete="off">
|
||||
</label>
|
||||
</div>
|
||||
<div class="course-grid" id="courseGrid" aria-live="polite"></div>
|
||||
<div class="empty-state" id="emptyCourses" hidden>
|
||||
<strong>No matching courses</strong>
|
||||
<span>Try a different search phrase.</span>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<span>Private library generated from your authorized LMS access.</span>
|
||||
<span id="generatedAt"></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,392 @@
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--ink: #172126;
|
||||
--muted: #617077;
|
||||
--paper: #f5f3ec;
|
||||
--surface: #fffdf8;
|
||||
--surface-strong: #ffffff;
|
||||
--line: #dcded8;
|
||||
--accent: #d8f26a;
|
||||
--accent-strong: #93ad20;
|
||||
--blue: #1c5166;
|
||||
--blue-soft: #dbeaf0;
|
||||
--danger: #b64d3c;
|
||||
--shadow: 0 18px 55px rgba(37, 48, 52, .09);
|
||||
--radius: 22px;
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
--ink: #f2f4ec;
|
||||
--muted: #aab6b8;
|
||||
--paper: #101719;
|
||||
--surface: #172124;
|
||||
--surface-strong: #1d292d;
|
||||
--line: #304044;
|
||||
--accent: #d8f26a;
|
||||
--accent-strong: #bfd94f;
|
||||
--blue: #8fc5d6;
|
||||
--blue-soft: #223a42;
|
||||
--danger: #f28f7d;
|
||||
--shadow: 0 18px 55px rgba(0, 0, 0, .24);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html { scroll-behavior: smooth; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
color: var(--ink);
|
||||
background:
|
||||
radial-gradient(circle at 87% 7%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 26rem),
|
||||
var(--paper);
|
||||
font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
button, input { font: inherit; }
|
||||
|
||||
button, a { -webkit-tap-highlight-color: transparent; }
|
||||
|
||||
a { color: inherit; }
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
max-width: 1240px;
|
||||
margin: 0 auto;
|
||||
padding: 24px 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
color: var(--ink);
|
||||
font-weight: 750;
|
||||
text-decoration: none;
|
||||
letter-spacing: -.02em;
|
||||
}
|
||||
|
||||
.brand-mark {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 12px;
|
||||
color: #142024;
|
||||
background: var(--accent);
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 14px;
|
||||
color: var(--ink);
|
||||
background: var(--surface);
|
||||
cursor: pointer;
|
||||
transition: transform .18s ease, border-color .18s ease;
|
||||
}
|
||||
|
||||
.icon-button:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
|
||||
.icon-button:focus-visible, .filter-chip:focus-visible, .action-button:focus-visible, input:focus-visible, .complete-check:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); outline-offset: 2px; }
|
||||
|
||||
main {
|
||||
width: min(1184px, calc(100% - 40px));
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.hero, .course-hero {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
gap: 48px;
|
||||
align-items: center;
|
||||
min-height: 330px;
|
||||
margin-top: 24px;
|
||||
padding: clamp(34px, 6vw, 72px);
|
||||
border-radius: 34px;
|
||||
color: #f7fbf8;
|
||||
background: #163b49;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.hero::after, .course-hero::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 260px;
|
||||
height: 260px;
|
||||
right: -65px;
|
||||
bottom: -120px;
|
||||
border: 42px solid rgba(216, 242, 106, .16);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.hero h1, .course-hero h1 {
|
||||
max-width: 760px;
|
||||
margin: 7px 0 16px;
|
||||
font-size: clamp(2.5rem, 6vw, 5.2rem);
|
||||
line-height: .98;
|
||||
letter-spacing: -.065em;
|
||||
}
|
||||
|
||||
.course-hero h1 { font-size: clamp(2.15rem, 5vw, 4.2rem); }
|
||||
|
||||
.eyebrow {
|
||||
margin: 0;
|
||||
color: var(--accent-strong);
|
||||
font-size: .75rem;
|
||||
font-weight: 850;
|
||||
letter-spacing: .16em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.hero .eyebrow, .course-hero .eyebrow { color: var(--accent); }
|
||||
|
||||
.hero-copy {
|
||||
max-width: 650px;
|
||||
margin: 0;
|
||||
color: rgba(247, 251, 248, .72);
|
||||
font-size: clamp(1rem, 2vw, 1.18rem);
|
||||
}
|
||||
|
||||
.hero-source {
|
||||
display: inline-flex;
|
||||
margin-top: 22px;
|
||||
color: var(--accent);
|
||||
font-size: .86rem;
|
||||
font-weight: 800;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.hero-orbit {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
align-content: center;
|
||||
width: 190px;
|
||||
aspect-ratio: 1;
|
||||
border: 1px solid rgba(255, 255, 255, .2);
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, .06);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.orbit-number { font-size: 3.2rem; font-weight: 800; letter-spacing: -.06em; }
|
||||
.orbit-label { max-width: 100px; color: rgba(255,255,255,.65); font-size: .75rem; text-align: center; }
|
||||
|
||||
.stat-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 14px;
|
||||
margin: 16px 0 76px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
min-height: 118px;
|
||||
padding: 24px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.stat-label { display: block; color: var(--muted); font-size: .82rem; }
|
||||
.stat-card strong { display: block; margin-top: 8px; font-size: 1.8rem; letter-spacing: -.04em; }
|
||||
|
||||
.library-section { margin-bottom: 70px; }
|
||||
|
||||
.section-heading {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
margin-bottom: 26px;
|
||||
}
|
||||
|
||||
.section-heading h2 { margin: 5px 0 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: min(330px, 100%);
|
||||
padding: 0 15px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 15px;
|
||||
color: var(--muted);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.search-box input {
|
||||
width: 100%;
|
||||
padding: 13px 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
color: var(--ink);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
|
||||
|
||||
.course-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 300px;
|
||||
padding: 26px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 26px;
|
||||
background: var(--surface);
|
||||
box-shadow: 0 6px 24px rgba(37,48,52,.04);
|
||||
transition: transform .2s ease, box-shadow .2s ease;
|
||||
}
|
||||
|
||||
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
|
||||
.course-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
|
||||
.course-code { color: var(--muted); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
|
||||
.course-badge { padding: 5px 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 750; }
|
||||
.course-card h3 { margin: 36px 0 10px; font-size: 1.4rem; line-height: 1.28; letter-spacing: -.025em; }
|
||||
.course-card-meta { margin: 0; color: var(--muted); font-size: .85rem; }
|
||||
.course-card-bottom { margin-top: auto; }
|
||||
|
||||
.progress-track { height: 7px; margin: 28px 0 12px; overflow: hidden; border-radius: 99px; background: var(--line); }
|
||||
.progress-track span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--accent-strong); }
|
||||
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }
|
||||
.course-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--ink); font-weight: 800; text-decoration: none; }
|
||||
.course-link span { transition: transform .18s ease; }
|
||||
.course-link:hover span { transform: translateX(4px); }
|
||||
|
||||
.breadcrumbs { display: flex; gap: 9px; margin: 24px 4px 14px; color: var(--muted); font-size: .85rem; }
|
||||
.breadcrumbs a { text-decoration: none; }
|
||||
|
||||
.course-hero { min-height: 300px; margin-top: 0; }
|
||||
.course-heading { position: relative; z-index: 1; }
|
||||
.progress-panel { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; min-width: 250px; }
|
||||
.progress-panel > div:last-child { display: grid; }
|
||||
.progress-panel span { color: rgba(255,255,255,.62); font-size: .78rem; }
|
||||
.progress-ring {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 100px;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(circle closest-side, #163b49 78%, transparent 80% 100%), conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(255,255,255,.14) 0);
|
||||
}
|
||||
.progress-ring span { color: #fff; font-size: 1.25rem; font-weight: 850; }
|
||||
|
||||
.course-toolbar {
|
||||
position: sticky;
|
||||
top: 12px;
|
||||
z-index: 5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
margin: 22px 0 34px;
|
||||
padding: 13px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 20px;
|
||||
background: color-mix(in srgb, var(--paper) 84%, transparent);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
.resource-search { flex: 1; max-width: 420px; }
|
||||
.filter-group { display: flex; gap: 7px; overflow-x: auto; }
|
||||
.filter-chip { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); cursor: pointer; white-space: nowrap; }
|
||||
.filter-chip.active { border-color: var(--ink); color: var(--paper); background: var(--ink); }
|
||||
|
||||
.section-list { display: grid; gap: 30px; margin-bottom: 70px; }
|
||||
.resource-section { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
|
||||
.resource-section-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
|
||||
.resource-section-header h2 { margin: 0; font-size: 1.12rem; }
|
||||
.resource-section-header span { color: var(--muted); font-size: .8rem; }
|
||||
.section-summary { grid-column: 1 / -1; max-width: 850px; margin: 0; color: var(--muted); font-size: .82rem; }
|
||||
.resource-list { display: grid; }
|
||||
|
||||
.resource-row {
|
||||
display: grid;
|
||||
grid-template-columns: 38px minmax(0, 1fr) auto auto auto;
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
min-height: 88px;
|
||||
padding: 14px 22px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.resource-row:last-child { border-bottom: 0; }
|
||||
.resource-row:hover { background: color-mix(in srgb, var(--blue-soft) 34%, transparent); }
|
||||
.resource-index { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
|
||||
.resource-main { min-width: 0; }
|
||||
.resource-title { display: block; overflow: hidden; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.resource-file { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.resource-description { display: -webkit-box; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: .76rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
|
||||
.resource-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .74rem; white-space: nowrap; }
|
||||
.type-pill { padding: 4px 8px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-weight: 750; }
|
||||
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); }
|
||||
.status-dot.missing { background: var(--danger); }
|
||||
.status-dot.online { background: var(--blue); }
|
||||
.action-button { min-width: 70px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface-strong); cursor: pointer; font-weight: 750; text-align: center; text-decoration: none; }
|
||||
.action-button[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; opacity: .6; }
|
||||
|
||||
.complete-check { width: 20px; height: 20px; accent-color: var(--accent-strong); cursor: pointer; }
|
||||
.resource-row.completed .resource-title { color: var(--muted); text-decoration: line-through; }
|
||||
|
||||
.empty-state { padding: 60px 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
|
||||
.empty-state strong, .empty-state span { display: block; }
|
||||
.empty-state strong { color: var(--ink); font-size: 1.1rem; }
|
||||
|
||||
.media-dialog { width: min(1000px, calc(100% - 30px)); padding: 20px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.4); }
|
||||
.media-dialog::backdrop { background: rgba(8, 15, 17, .76); backdrop-filter: blur(7px); }
|
||||
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
|
||||
.dialog-heading h2 { margin: 4px 0 0; font-size: 1.2rem; }
|
||||
.media-dialog video { display: block; width: 100%; max-height: 72vh; border-radius: 15px; background: #000; }
|
||||
|
||||
footer { width: min(1184px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 40px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
|
||||
footer a { text-decoration: none; font-weight: 700; }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.hero, .course-hero { grid-template-columns: 1fr; gap: 28px; }
|
||||
.hero-orbit { width: 145px; }
|
||||
.stat-grid, .course-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
.course-toolbar { position: static; flex-direction: column; }
|
||||
.resource-search { max-width: none; }
|
||||
.resource-row { grid-template-columns: 30px minmax(0, 1fr) auto auto; }
|
||||
.resource-meta { display: none; }
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.topbar { padding: 18px 20px; }
|
||||
main { width: min(100% - 24px, 1184px); }
|
||||
.hero, .course-hero { min-height: auto; padding: 34px 24px; border-radius: 24px; }
|
||||
.hero h1, .course-hero h1 { letter-spacing: -.045em; }
|
||||
.stat-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: 54px; }
|
||||
.stat-card { min-height: 100px; padding: 18px; }
|
||||
.section-heading { align-items: stretch; flex-direction: column; }
|
||||
.course-grid { grid-template-columns: 1fr; }
|
||||
.progress-panel { min-width: 0; }
|
||||
.course-toolbar { border-radius: 17px; }
|
||||
.resource-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 13px 14px; }
|
||||
.complete-check { display: none; }
|
||||
.action-button { min-width: 58px; }
|
||||
footer { width: calc(100% - 28px); flex-direction: column; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
|
||||
}
|
||||
Reference in new issue
Block a user