Skip to content

Commit 40e1df6

Browse files
committed
add interactive demo
1 parent e80a52b commit 40e1df6

5 files changed

Lines changed: 439 additions & 32 deletions

File tree

platforms/web/src/Landing.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,44 @@ body {
423423
box-shadow: 0 4px 12px rgba(0, 120, 100, 0.2);
424424
}
425425

426+
/* Demo Section */
427+
.demo-section {
428+
padding: 4rem 2rem;
429+
background: linear-gradient(
430+
135deg,
431+
var(--learningmap-color-whitesmoke, #f5f5f5) 0%,
432+
white 100%
433+
);
434+
}
435+
436+
.demo-title {
437+
font-size: 2rem;
438+
font-weight: 700;
439+
text-align: center;
440+
margin-bottom: 1rem;
441+
color: #1f2937;
442+
}
443+
444+
.demo-subtitle {
445+
text-align: center;
446+
font-size: 1.1rem;
447+
color: var(--learningmap-color-quicksilver, #a4a4a4);
448+
margin-bottom: 2rem;
449+
max-width: 600px;
450+
margin-left: auto;
451+
margin-right: auto;
452+
}
453+
454+
.demo-map-container {
455+
max-width: 1200px;
456+
margin: 0 auto;
457+
background: white;
458+
border-radius: 12px;
459+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
460+
overflow: hidden;
461+
height: 800px;
462+
}
463+
426464
/* Responsive Design */
427465
@media (max-width: 768px) {
428466
.hero-title {
@@ -466,6 +504,22 @@ body {
466504
.role-section {
467505
grid-template-columns: 1fr;
468506
}
507+
508+
.demo-section {
509+
padding: 2rem 1rem;
510+
}
511+
512+
.demo-title {
513+
font-size: 1.5rem;
514+
}
515+
516+
.demo-subtitle {
517+
font-size: 1rem;
518+
}
519+
520+
.demo-map-container {
521+
height: 400px;
522+
}
469523
}
470524

471525
@media (max-width: 480px) {

platforms/web/src/Landing.tsx

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,16 @@ import { useNavigate } from "react-router-dom";
22
import "./Landing.css";
33
import { Header } from "./Header";
44
import { Footer } from "./Footer";
5+
import { LearningMap } from "@learningmap/learningmap";
6+
import "@learningmap/learningmap/index.css";
7+
import demoMapRaw from "./getting-started.learningmap?raw";
8+
import type { RoadmapData } from "@learningmap/learningmap";
59

610
function Landing() {
711
const navigate = useNavigate();
8-
9-
// Featured learning maps with example JSON IDs
10-
/*
11-
const featuredMaps = [
12-
{
13-
id: 'example-1',
14-
title: 'Getting Started with Programming',
15-
description: 'A comprehensive guide to learning programming fundamentals, from variables to functions.',
16-
thumbnail: '📚',
17-
editUrl: '/create',
18-
learnUrl: '/learn',
19-
},
20-
{
21-
id: 'example-2',
22-
title: 'Web Development Basics',
23-
description: 'Learn HTML, CSS, and JavaScript to build your first website step by step.',
24-
thumbnail: '🌐',
25-
editUrl: '/create',
26-
learnUrl: '/learn',
27-
},
28-
{
29-
id: 'example-3',
30-
title: 'Data Science Journey',
31-
description: 'Explore data analysis, visualization, and machine learning concepts progressively.',
32-
thumbnail: '📊',
33-
editUrl: '/create',
34-
learnUrl: '/learn',
35-
},
36-
];
37-
*/
12+
13+
// Parse the demo map from raw JSON
14+
const demoMap: RoadmapData = JSON.parse(demoMapRaw);
3815

3916
return (
4017
<div className="landing-container">
@@ -90,6 +67,18 @@ function Landing() {
9067
</div>
9168
</section>
9269

70+
{/* Demo LearningMap */}
71+
<section className="demo-section">
72+
<h2 className="demo-title">Try It Out: Interactive Demo</h2>
73+
<p className="demo-subtitle">
74+
Explore this interactive learning map to see how it works. Click on
75+
nodes to learn more!
76+
</p>
77+
<div className="demo-map-container">
78+
<LearningMap roadmapData={demoMap} />
79+
</div>
80+
</section>
81+
9382
{/* Teacher-Student Use Case */}
9483
<section className="use-case-section">
9584
<div className="use-case-content">

0 commit comments

Comments
 (0)