Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bielefeld-CeBiTec
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
Bielefeld-CeBiTec
Commits
a3b32362
Commit
a3b32362
authored
6 months ago
by
Maximilian Leo Huber
Browse files
Options
Downloads
Patches
Plain Diff
motion path test
parent
ae454c84
No related branches found
No related tags found
No related merge requests found
Pipeline
#415487
failed
6 months ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/data/test-path-home.svg
+6
-0
6 additions, 0 deletions
src/components/data/test-path-home.svg
src/contents/Home.tsx
+41
-1
41 additions, 1 deletion
src/contents/Home.tsx
with
47 additions
and
1 deletion
src/components/data/test-path-home.svg
0 → 100644
+
6
−
0
View file @
a3b32362
<svg
width=
"1080"
height=
"4000"
fill=
"none"
xmlns=
"test-namespace"
>
<path
d=
"M 50 50 C 500 -50 1000 100 1870 50 C 1820 220 2024 528 1870 590 C 1351 678 118 451 54 561 C 3 672 12 985 55 985 C 586 1090 1342 898 1881 1038 C 1994 1194 1986 1568 1890 1681 C 1751 1803 281 1481 168 1646 C 81 1794 21 1977 168 2142 C 499 2246 1403 2325 1081 2142
"
stroke=
"#850F78"
stroke-width=
"10"
/>
</svg>
This diff is collapsed.
Click to expand it.
src/contents/Home.tsx
+
41
−
1
View file @
a3b32362
import
{
useEffect
}
from
"
react
"
;
import
{
useLocation
}
from
"
react-router-dom
"
;
import
{
openFromOtherPage
}
from
"
../utils/openFromOtherpAge
"
;
import
vectorImg
from
"
https://static.igem.wiki/teams/5247/placeholders/vector.webp
"
import
{
ScrollTrigger
}
from
"
gsap/ScrollTrigger
"
;
import
{
useGSAP
}
from
'
@gsap/react
'
;
import
{
useRef
}
from
'
react
'
;
import
{
MotionPathPlugin
}
from
'
gsap/all
'
;
export
function
Home
()
{
const
location
=
useLocation
();
...
...
@@ -31,13 +36,48 @@ export function Home() {
}
},
[
location
.
search
]);
const
vectorRef
=
useRef
(
null
);
const
payloadRef
=
useRef
(
null
);
const
inhalatorRef
=
useRef
(
null
);
useGSAP
(
()
=>
{
gsap
.
registerPlugin
(
ScrollTrigger
);
gsap
.
registerPlugin
(
useGSAP
);
gsap
.
registerPlugin
(
MotionPathPlugin
);
gsap
.
defaults
({
ease
:
"
none
"
});
const
mainTimeline
=
gsap
.
timeline
({
scrollTrigger
:
{
trigger
:
"
svg
"
,
scrub
:
true
,
start
:
"
top center
"
,
end
:
"
bottom center
"
}
})
.
from
(
"
.theLine
"
,
{
drawSVG
:
0
},
0
)
.
to
(
payloadRef
.
current
,
{
motionPath
:{
path
:
"
.theLine
"
,
align
:
"
.theLine
"
,
alignOrigin
:[
0.5
,
0.5
],
}},
0
)
},
);
return
(
<>
<
div
className
=
"row"
>
<
div
className
=
"col"
>
<
svg
id
=
"svg"
xmlns
=
""
viewBox
=
"0 0 1980 4400"
>
<
path
class
=
"theLine"
d
=
"
M
50
50
S
540
200
540
1000
S
-
300
1200
540
2000
S
-
600
2200
540
3000
S
0
4000
540
4000
L
540
4500
"
file
=
"none"
stroke
=
"white"
stroke-width
=
"10px"
></
path
>
</
svg
>
<
img
ref
=
{
vectorRef
}
src
=
{
vectorImg
}
alt
=
"vectorImg"
/>
</
div
>
</
div
>
<
div
className
=
"row"
>
</
div
>
...
...
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