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
4d91e590
Commit
4d91e590
authored
6 months ago
by
Maximilian Leo Huber
Browse files
Options
Downloads
Patches
Plain Diff
reducing viewBox width + adding movable image
parent
2d84eadc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#415705
failed
6 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/HomeAnimation.tsx
+7
-9
7 additions, 9 deletions
src/components/HomeAnimation.tsx
with
7 additions
and
9 deletions
src/components/HomeAnimation.tsx
+
7
−
9
View file @
4d91e590
import
gsap
from
"
gsap
"
;
import
{
useGSAP
}
from
"
@gsap/react
"
;
import
{
ScrollTrigger
}
from
"
gsap/dist/ScrollTrigger
"
;
/*
import { useRef } from 'react';
*/
import
{
useRef
}
from
'
react
'
;
import
{
MotionPathPlugin
}
from
"
gsap/dist/MotionPathPlugin
"
;
/*
import vectorImg from "https://static.igem.wiki/teams/5247/placeholders/vector.webp"
*/
import
vectorImg
from
"
https://static.igem.wiki/teams/5247/placeholders/vector.webp
"
;
export
function
HomeAnim
()
{
gsap
.
registerPlugin
(
useGSAP
);
gsap
.
registerPlugin
(
MotionPathPlugin
);
gsap
.
registerPlugin
(
ScrollTrigger
);
/*
const
vectorRef
=
useRef
(
null
);
*/
useGSAP
(
()
=>
{
gsap
.
registerPlugin
(
ScrollTrigger
);
...
...
@@ -28,7 +28,6 @@ export function HomeAnim() {
end
:
"
bottom middle
"
}
})
/* Disabled for now
.
from
(
"
.homeAnimLine
"
,
{
drawSVG
:
0
},
0
)
.
to
(
vectorRef
.
current
,
{
motionPath
:{
path
:
"
.homeAnimLine
"
,
...
...
@@ -36,9 +35,7 @@ export function HomeAnim() {
alignOrigin
:[
0.5
,
0.5
],
}},
0
)
Add this in return after svg later
<img ref={vectorRef} src={vectorImg} alt="vectorImg"/>
*/
console
.
log
(
main
)
},
);
...
...
@@ -46,7 +43,7 @@ export function HomeAnim() {
return
(
<
div
className
=
"row col"
>
<
svg
id
=
"svg"
viewBox
=
"0 0 1
5
00 4000"
>
<
svg
id
=
"svg"
viewBox
=
"0 0 1
2
00 4000"
>
<
path
d
=
"
M
50
50
C
500
-
50
1000
100
1870
50
...
...
@@ -59,6 +56,7 @@ export function HomeAnim() {
C
81
1794
21
1977
168
2142
C
499
2246
1403
2325
1081
2142
"
/>
</
svg
>
<
img
ref
=
{
vectorRef
}
src
=
{
vectorImg
}
alt
=
"vectorImg"
/>
</
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