Skip to content
Snippets Groups Projects
Commit 42003c10 authored by Liliana Sanfilippo's avatar Liliana Sanfilippo
Browse files

main as console log

parent 183b8389
No related branches found
No related tags found
No related merge requests found
Pipeline #401503 failed
import gsap from "gsap"; import gsap from "gsap";
import { createRequire } from 'module'; import { createRequire } from 'module';
const ScrollTrigger = createRequire('gsap/dist/ScrollTrigger'); const ScrollTrigger = createRequire('/home/lili/Dokumente/iGem/Wiki/bielefeld-cebitec/pubpub/extra_modules/gsap/ScrollTrigger.js');
import { useGSAP } from '@gsap/react'; import { useGSAP } from '@gsap/react';
import { useRef } from 'react'; import { useRef } from 'react';
const MotionPathPlugin = createRequire("gsap/dist/MotionPathPlugin"); const MotionPathPlugin = createRequire("/home/lili/Dokumente/iGem/Wiki/bielefeld-cebitec/pubpub/extra_modules/gsap/dist/MotionPathPlugin.js");
function TestSVG() { function TestSVG() {
console.log("Started TestSVG")
const vectorRef = useRef(null); const vectorRef = useRef(null);
const payloadRef = useRef(null); const payloadRef = useRef(null);
const inhalatorRef = useRef(null); const inhalatorRef = useRef(null);
...@@ -21,8 +21,7 @@ function TestSVG() { ...@@ -21,8 +21,7 @@ function TestSVG() {
gsap.defaults({ease: "none"}); gsap.defaults({ease: "none"});
var _main; const main = gsap.timeline({
_main = gsap.timeline({
scrollTrigger: { scrollTrigger: {
trigger: "svg", trigger: "svg",
scrub: true, scrub: true,
...@@ -30,6 +29,7 @@ function TestSVG() { ...@@ -30,6 +29,7 @@ function TestSVG() {
end: "bottom center" end: "bottom center"
} }
}) })
.from(".theLine", {drawSVG: 0}, 0) .from(".theLine", {drawSVG: 0}, 0)
.to(payloadRef.current, {motionPath:{ .to(payloadRef.current, {motionPath:{
path:".theLine", path:".theLine",
...@@ -47,10 +47,11 @@ function TestSVG() { ...@@ -47,10 +47,11 @@ function TestSVG() {
align:".theLine3", align:".theLine3",
alignOrigin:[0.5, 0.5], alignOrigin:[0.5, 0.5],
}}, 0) }}, 0)
console.log(main)
}, },
); );
return ( return (
<div className="App"> <div className="App">
<div className="firstSpacingBlock"> <div className="firstSpacingBlock">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment