Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
ng-gx-split-text
Advanced tools
This is a utility for Angular, allowing you to split the text into words and chars, for subsequent animation
NG-GX-SPLIT-TEXT - This is an Angular utility to split text into words, lines or chars for subsequent animations.
You can familiarize yourself with the demo version here - DEMO
Angular | ng-gx-split-text |
---|---|
>=8.0.0 <9.0.0 | v0.0.1 |
ng-gx-split-text
:npm install ng-gx-split-text
import { NgGxSplitTextModule } from 'ng-gx-split-text';
@NgModule({
declarations: [
AppComponent,
],
imports: [
NgGxSplitTextModule,
],
bootstrap: [AppComponent]
})
export class AppModule {}
<p #text ngGxSplitText>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus amet consequuntur culpa
delectus, doloribus exercitationem ipsam, laudantium molestiae non numquam odit omnis optio praesentium quae ratione
similique sit soluta voluptatem?</p>
@ViewChild('text', { static: true, read: NgGxSplitTextDirective }) text: NgGxSplitTextDirective;
export class AppComponent implements AfterViewInit {
@ViewChild('text', {static: true, read: NgGxSplitTextDirective}) text: NgGxSplitTextDirective;
tlText = new TimelineMax();
constructor() {}
ngAfterViewInit(): void {
this.textAnimation();
}
textAnimation() {
this.tlText
.to(this.text.words, 0.5, {
opacity: 0,
})
.staggerFromTo(this.text.words, 0.5, {
opacity: 0,
x: () => {
return _.random(-100, 100);
},
y: () => {
return _.random(-100, 100);
},
rotation: () => {
return _.random(-25, 25);
},
immediateRender: false,
}, {
opacity: 1,
x: 0,
y: 0,
rotation: 0,
}, 0.03);
}
}
#DEMO
Name | Description |
---|---|
NgGxSplitText | Split your text (all options is default) |
[NgGxSplitText] | Split your text (custom options ) |
Name | Type | Default | Description |
---|---|---|---|
defer | boolean | false | Defer initiation (for manual initiation use initSplit() ) |
<p #text ngGxSplitText>Lorem ipsum dolor...</p> // Default options
<p #text [ngGxSplitText]="{defer: true, ...}">Lorem ipsum dolor...</p> // Custom options
Name | Type | Description |
---|---|---|
isInit | boolean | Is Split Text applied |
nativeElement | HTMLElement | Container HTMLElement |
words | HTMLElement[] | Words HTMLElement array |
chars | HTMLElement[] | Chars HTMLElement array |
line-words | HTMLElement[][] | Line array with words HTMLElement array |
line-chars | HTMLElement[][] | Line array with chars HTMLElement array |
this.text.isInit // console.log(true);
this.text.srcText // console.log(Lorem ipsum dolor...);
Name | Description |
---|---|
initSplit() | Initialize Split Text (For using in case defer: true ) |
resetSplit() | Reset to source text |
ngAfterViewInit(): void {
// if Split Text already initialized (defer: false)
this.text.initSplit(); // Return WARNING! Text already initialized
// if Split Text not initialized (defer: true)
this.text.initSplit(); // It's OK!
}
FAQs
This is a utility for Angular, allowing you to split the text into words and chars, for subsequent animation
The npm package ng-gx-split-text receives a total of 1 weekly downloads. As such, ng-gx-split-text popularity was classified as not popular.
We found that ng-gx-split-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.