Skip to content

Commit 8b8281b

Browse files
fix(angular-3d): address QA review issues in troika text components
- Remove unused OBJECT_ID injection (follows InstancedParticleText pattern) - Add public accessibility modifiers to all inputs and public methods - Fix memory leak: clear debounce timeout on destroy - Fix color type handling (accept both string and number) - Rename outlineWidthInput to glowOutlineWidth - Add documentation for reference distance constant
1 parent 06aa569 commit 8b8281b

7 files changed

Lines changed: 178 additions & 146 deletions

File tree

apps/angular-3d-demo/src/app/pages/gsap-showcase/sections/angular-3d-section.component.ts

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { CommonModule, NgOptimizedImage } from '@angular/common';
22
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
33
import {
44
ScrollAnimationDirective,
5+
ViewportAnimationDirective,
56
HijackedScrollTimelineComponent,
67
HijackedScrollItemDirective,
78
} from '@hive-academy/angular-gsap';
@@ -35,6 +36,7 @@ import type { TimelineStep } from '../../../shared/types/timeline-step.interface
3536
CodeSnippetComponent,
3637
DecorativePatternComponent,
3738
ScrollAnimationDirective,
39+
ViewportAnimationDirective,
3840
NgOptimizedImage,
3941
],
4042
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -235,22 +237,22 @@ import type { TimelineStep } from '../../../shared/types/timeline-step.interface
235237
<!-- Content -->
236238
<div class="container mx-auto px-8 relative z-10 mt-24">
237239
<div class="grid lg:grid-cols-2 gap-8 items-center">
238-
<!-- Content Side -->
240+
<!-- Content Side - Use viewportAnimation since scroll doesn't work inside pinned container -->
239241
<div
240242
[class.lg:order-1]="step.layout === 'left'"
241243
[class.lg:order-2]="step.layout === 'right'"
242-
scrollAnimation
243-
[scrollConfig]="{
244+
viewportAnimation
245+
[viewportConfig]="{
244246
animation: 'custom',
245-
start: 'top 80%',
246-
end: 'top 30%',
247-
scrub: 1,
248247
from: {
249248
opacity: 0,
250249
x: step.layout === 'left' ? -60 : 60,
251250
y: 20
252251
},
253-
to: { opacity: 1, x: 0, y: 0 }
252+
to: { opacity: 1, x: 0, y: 0 },
253+
duration: 0.8,
254+
ease: 'power2.out',
255+
threshold: 0.1
254256
}"
255257
>
256258
<!-- Step Number Badge -->
@@ -265,46 +267,46 @@ import type { TimelineStep } from '../../../shared/types/timeline-step.interface
265267
></div>
266268
</div>
267269
268-
<!-- Title with animation -->
270+
<!-- Title with viewport animation -->
269271
<h3
270272
class="text-4xl font-bold text-white mb-4 leading-tight"
271-
scrollAnimation
272-
[scrollConfig]="{
273+
viewportAnimation
274+
[viewportConfig]="{
273275
animation: 'slideUp',
274-
start: 'top 85%',
275276
duration: 0.6,
276-
delay: 0.1
277+
delay: 0.1,
278+
threshold: 0.1
277279
}"
278280
>
279281
{{ step.title }}
280282
</h3>
281283
282-
<!-- Description with animation -->
284+
<!-- Description with viewport animation -->
283285
<p
284286
class="text-lg text-gray-300 leading-relaxed mb-6"
285-
scrollAnimation
286-
[scrollConfig]="{
287+
viewportAnimation
288+
[viewportConfig]="{
287289
animation: 'fadeIn',
288-
start: 'top 80%',
289290
duration: 0.8,
290-
delay: 0.2
291+
delay: 0.2,
292+
threshold: 0.1
291293
}"
292294
>
293295
{{ step.description }}
294296
</p>
295297
296-
<!-- Notes with staggered animation -->
298+
<!-- Notes with staggered viewport animation -->
297299
@if (step.notes && step.notes.length > 0) {
298300
<div class="space-y-3">
299301
@for (note of step.notes; track $index) {
300302
<div
301303
class="flex items-start gap-3"
302-
scrollAnimation
303-
[scrollConfig]="{
304+
viewportAnimation
305+
[viewportConfig]="{
304306
animation: 'slideUp',
305-
start: 'top 85%',
306307
duration: 0.5,
307-
delay: 0.3 + $index * 0.1
308+
delay: 0.3 + $index * 0.1,
309+
threshold: 0.1
308310
}"
309311
>
310312
<svg
@@ -327,22 +329,23 @@ import type { TimelineStep } from '../../../shared/types/timeline-step.interface
327329
}
328330
</div>
329331
330-
<!-- Visual Side - OVERSIZED IMAGE with glow -->
332+
<!-- Visual Side - OVERSIZED IMAGE with glow, using viewportAnimation -->
331333
<div
332334
[class.lg:order-2]="step.layout === 'left'"
333335
[class.lg:order-1]="step.layout === 'right'"
334-
scrollAnimation
335-
[scrollConfig]="{
336+
viewportAnimation
337+
[viewportConfig]="{
336338
animation: 'custom',
337-
start: 'top 75%',
338-
end: 'top 25%',
339-
scrub: 1,
340339
from: {
341340
opacity: 0,
342341
x: step.layout === 'left' ? 80 : -80,
343342
scale: 0.9
344343
},
345-
to: { opacity: 1, x: 0, scale: 1 }
344+
to: { opacity: 1, x: 0, scale: 1 },
345+
duration: 0.8,
346+
delay: 0.2,
347+
ease: 'power2.out',
348+
threshold: 0.1
346349
}"
347350
>
348351
@if (step.language === 'image') {

0 commit comments

Comments
 (0)