when I try to use gsap with pursue element it not recognize
that my ts
import { Component, OnInit } from '@angular/core';
import { gsap } from "gsap";
import { CSSRulePlugin } from "gsap/CSSRulePlugin";
import { ScrollTrigger } from "gsap/ScrollTrigger";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'gsapProject';
ngOnInit() {
gsap.registerPlugin(CSSRulePlugin, ScrollTrigger);
gsap.from('div h1', {
scrollTrigger: 'div h1',
y: 200,
duration: 5
});
const rule = CSSRulePlugin.getRule('.cc::before');
gsap.to(rule, 3, { cssRule: { color: "#0000FF", x: 50 }, x: 300 });
}
}
and this my HTML
<div>
<h1 class="cc">new project</h1>
</div>
Just try it with a new project for be clear and don't work .
This my message from the page
gsap-core.js:87 GSAP target undefined not found. https://greensock.com
feel like no way to do it.