Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TU-Delft
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2024 Competition
TU-Delft
Commits
3ba401f8
Commit
3ba401f8
authored
5 months ago
by
Shraddha Raghuram
Browse files
Options
Downloads
Patches
Plain Diff
roadmap
parent
97477f87
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/homepage-roadmap.js
+11
-17
11 additions, 17 deletions
static/homepage-roadmap.js
with
11 additions
and
17 deletions
static/homepage-roadmap.js
+
11
−
17
View file @
3ba401f8
...
@@ -273,29 +273,23 @@ let branchPositions = [600, 1200, 1800, 2400]; // The vertical positions where
...
@@ -273,29 +273,23 @@ let branchPositions = [600, 1200, 1800, 2400]; // The vertical positions where
let
totalHeight
=
3000
;
// Total height for the vertical line
let
totalHeight
=
3000
;
// Total height for the vertical line
function
verticalLine
(
x
,
y1
,
y2
,
ctx
)
{
function
verticalLine
(
x
,
y1
,
y2
,
ctx
)
{
// Draw the vertical line from y1 to the current height y2
ctx
.
moveTo
(
x
,
y1
);
ctx
.
moveTo
(
x
,
y1
);
ctx
.
lineTo
(
x
,
y2
);
ctx
.
lineTo
(
x
,
y2
);
}
}
function
circularArc
(
x
,
y
,
ctx
,
typeID
)
{
function
circularArc
(
x
,
y
,
ctx
,
typeID
)
{
// Draw arcs for the branches
if
(
typeID
==
1
)
{
if
(
typeID
==
1
)
{
ctx
.
arc
(
x
,
y
,
30
,
Math
.
PI
,
Math
.
PI
/
2
,
true
);
// top-left curve
ctx
.
arc
(
x
,
y
,
30
,
Math
.
PI
,
Math
.
PI
/
2
,
true
);
// top-left curve
}
}
else
if
(
typeID
==
2
)
{
else
if
(
typeID
==
2
)
{
ctx
.
arc
(
x
,
y
,
30
,
Math
.
PI
*
1.5
,
0
,
false
);
// top-right curve
ctx
.
arc
(
x
,
y
,
30
,
Math
.
PI
*
1.5
,
0
,
false
);
// top-right curve
}
}
else
if
(
typeID
==
3
)
{
else
if
(
typeID
==
3
)
{
ctx
.
arc
(
x
,
y
,
30
,
0
,
Math
.
PI
/
2
,
false
);
// bottom-right curve
ctx
.
arc
(
x
,
y
,
30
,
0
,
Math
.
PI
/
2
,
false
);
// bottom-right curve
}
else
if
(
typeID
==
4
)
{
}
else
if
(
typeID
==
4
)
{
ctx
.
arc
(
x
,
y
,
30
,
Math
.
PI
*
1.5
,
Math
.
PI
,
true
);
// bottom-left curve
ctx
.
arc
(
x
,
y
,
30
,
Math
.
PI
*
1.5
,
Math
.
PI
,
true
);
// bottom-left curve
}
}
}
}
function
horizontalLine
(
x1
,
x2
,
y
,
ctx
)
{
function
horizontalLine
(
x1
,
x2
,
y
,
ctx
)
{
// Draw the horizontal lines (branches)
ctx
.
moveTo
(
x1
,
y
);
ctx
.
moveTo
(
x1
,
y
);
ctx
.
lineTo
(
x2
,
y
);
ctx
.
lineTo
(
x2
,
y
);
}
}
...
@@ -307,16 +301,13 @@ function drawBranch(ctx, index) {
...
@@ -307,16 +301,13 @@ function drawBranch(ctx, index) {
if
(
index
===
0
)
{
if
(
index
===
0
)
{
circularArc
(
centerX
-
30
,
600
,
ctx
,
3
);
circularArc
(
centerX
-
30
,
600
,
ctx
,
3
);
horizontalLine
(
centerX
-
30
,
centerX
-
400
,
630
,
ctx
);
horizontalLine
(
centerX
-
30
,
centerX
-
400
,
630
,
ctx
);
}
}
else
if
(
index
===
1
)
{
else
if
(
index
===
1
)
{
circularArc
(
centerX
+
30
,
1200
,
ctx
,
1
);
circularArc
(
centerX
+
30
,
1200
,
ctx
,
1
);
horizontalLine
(
centerX
+
30
,
centerX
+
400
,
1230
,
ctx
);
horizontalLine
(
centerX
+
30
,
centerX
+
400
,
1230
,
ctx
);
}
}
else
if
(
index
===
2
)
{
else
if
(
index
===
2
)
{
circularArc
(
centerX
-
30
,
1800
,
ctx
,
3
);
circularArc
(
centerX
-
30
,
1800
,
ctx
,
3
);
horizontalLine
(
centerX
-
30
,
centerX
-
400
,
1830
,
ctx
);
horizontalLine
(
centerX
-
30
,
centerX
-
400
,
1830
,
ctx
);
}
}
else
if
(
index
===
3
)
{
else
if
(
index
===
3
)
{
circularArc
(
centerX
+
30
,
2400
,
ctx
,
1
);
circularArc
(
centerX
+
30
,
2400
,
ctx
,
1
);
horizontalLine
(
centerX
+
30
,
centerX
+
400
,
2430
,
ctx
);
horizontalLine
(
centerX
+
30
,
centerX
+
400
,
2430
,
ctx
);
}
}
...
@@ -343,6 +334,9 @@ function draw() {
...
@@ -343,6 +334,9 @@ function draw() {
var
scrTop
=
document
.
documentElement
.
scrollTop
;
// Get the current scroll position
var
scrTop
=
document
.
documentElement
.
scrollTop
;
// Get the current scroll position
var
maxLineHeight
=
Math
.
min
(
scrTop
+
window
.
innerHeight
*
0.8
,
totalHeight
);
// Limit the growth of the vertical line
var
maxLineHeight
=
Math
.
min
(
scrTop
+
window
.
innerHeight
*
0.8
,
totalHeight
);
// Limit the growth of the vertical line
// Clear the canvas to redraw
ctx
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
// Draw the vertical line, growing with scrolling
// Draw the vertical line, growing with scrolling
var
centerX
=
canvas
.
width
/
2
;
var
centerX
=
canvas
.
width
/
2
;
verticalLine
(
centerX
,
200
,
maxLineHeight
,
ctx
);
// Vertical line grows with scroll
verticalLine
(
centerX
,
200
,
maxLineHeight
,
ctx
);
// Vertical line grows with scroll
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment