Skip to content

Commit f3ee238

Browse files
committed
add task index
Signed-off-by: bitliu <[email protected]>
1 parent ac17dff commit f3ee238

File tree

2 files changed

+71
-14
lines changed

2 files changed

+71
-14
lines changed

website/src/pages/roadmap/roadmap.module.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,45 @@
323323
width: 100%;
324324
}
325325

326+
.taskLink {
327+
color: #007bff;
328+
text-decoration: none;
329+
font-weight: 700;
330+
font-size: 0.9rem;
331+
padding: 0.2rem 0.5rem;
332+
border-radius: 4px;
333+
background: rgba(0, 123, 255, 0.1);
334+
border: 1px solid rgba(0, 123, 255, 0.2);
335+
transition: all 0.3s ease;
336+
display: inline-block;
337+
margin-right: 0.5rem;
338+
position: relative;
339+
overflow: hidden;
340+
}
341+
342+
.taskLink::before {
343+
content: '';
344+
position: absolute;
345+
top: 0;
346+
left: -100%;
347+
width: 100%;
348+
height: 100%;
349+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
350+
transition: left 0.3s ease;
351+
}
352+
353+
.taskLink:hover {
354+
color: #0056b3;
355+
background: rgba(0, 123, 255, 0.15);
356+
border-color: rgba(0, 123, 255, 0.4);
357+
text-decoration: none;
358+
transform: scale(1.05);
359+
}
360+
361+
.taskLink:hover::before {
362+
left: 100%;
363+
}
364+
326365
.itemDescription {
327366
margin-bottom: 1.25rem;
328367
color: var(--ifm-color-emphasis-700);

website/src/pages/roadmap/v0.1.js

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,43 @@ const priorityColors = {
99
};
1010

1111
const PriorityBadge = ({ priority }) => (
12-
<span
12+
<span
1313
className={styles.priorityBadge}
1414
style={{ backgroundColor: priorityColors[priority] }}
1515
>
1616
{priority}
1717
</span>
1818
);
1919

20-
const RoadmapItem = ({ title, priority, acceptance, children }) => (
21-
<div className={styles.roadmapItem}>
22-
<div className={styles.itemHeader}>
23-
<h4 className={styles.itemTitle}>{title}</h4>
24-
<PriorityBadge priority={priority} />
25-
</div>
26-
{children && <div className={styles.itemDescription}>{children}</div>}
27-
{acceptance && (
28-
<div className={styles.acceptance}>
29-
<strong>Acceptance:</strong> {acceptance}
20+
// Counter for generating unique task numbers
21+
let taskCounter = 0;
22+
23+
const RoadmapItem = ({ title, priority, acceptance, children, id }) => {
24+
taskCounter++;
25+
const taskId = id || `task-${taskCounter}`;
26+
const taskNumber = taskCounter;
27+
28+
return (
29+
<div className={styles.roadmapItem} id={taskId}>
30+
<div className={styles.itemHeader}>
31+
<h4 className={styles.itemTitle}>
32+
<a href={`#${taskId}`} className={styles.taskLink}>
33+
#{taskNumber}
34+
</a>
35+
{' '}
36+
{title}
37+
</h4>
38+
<PriorityBadge priority={priority} />
3039
</div>
31-
)}
32-
</div>
33-
);
40+
{children && <div className={styles.itemDescription}>{children}</div>}
41+
{acceptance && (
42+
<div className={styles.acceptance}>
43+
<strong>Acceptance:</strong> {acceptance}
44+
</div>
45+
)}
46+
</div>
47+
);
48+
};
3449

3550
const AreaSection = ({ title, children }) => (
3651
<div className={styles.areaSection}>
@@ -42,6 +57,9 @@ const AreaSection = ({ title, children }) => (
4257
);
4358

4459
export default function RoadmapV01() {
60+
// Reset task counter for consistent numbering on re-renders
61+
taskCounter = 0;
62+
4563
return (
4664
<Layout
4765
title="Roadmap v0.1"

0 commit comments

Comments
 (0)