TweenLabs LogoTweenLabs
TweenLabs/Components/Source Code

Skill Fit Code

Endpoint: /10-screen-skill-fit

Premium candidate profile showcase animation with vertical ScrollTrigger pinning and technology staggers.

📦 GSAP: ^3.15.0
📦 @gsap/react: ^2.1.2
⚙️ ScrollTrigger: ✅ Required
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
"use client";

import { useGSAP } from "@gsap/react";
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import Image from "next/image";
import { useRef } from "react";

gsap.registerPlugin(useGSAP, ScrollTrigger);

// ─── Data ─────────────────────────────────────────────────────────────────────
const candidates = [
  {
    id: 0,
    name: "Studio Shodwe",
    role: "New Collection · SS25",
    img: "/Untitled design (2).png",
    color: "#0c9367",
    left: {
      tag: "New Collection",
      headline: "The Gray\nShirt Edit.",
      stats: [
        { label: "Material", value: "Premium Cotton Twill" },
        { label: "Silhouette", value: "Relaxed Oversized" },
        { label: "Season", value: "Spring / Summer 2025" },
      ],
    },
    right: {
      companies: ["Studio Shodwe", "SS25"],
      quote:
        "Minimal layers, maximum presence. The gray shirt is never just a shirt.",
      skills: [
        "Outerwear",
        "Layering",
        "Neutral Tones",
        "Unisex Fit",
        "Soft Drape",
      ],
    },
  },
  {
    id: 1,
    name: "Arjun K.",
    role: "Editorial Portrait · Menswear",
    img: "/Untitled design.png",
    color: "#f1b333",
    left: {
      tag: "Editorial",
      headline: "Effortless\nConfidence.",
      stats: [
        { label: "Look", value: "White Open Shirt" },
        { label: "Accessories", value: "Bead Bracelet · Ring" },
        { label: "Mood", value: "Raw · Candid · Bold" },
      ],
    },
    right: {
      companies: ["Menswear", "Portrait"],
      quote:
        "The white shirt — unbuttoned, unfiltered. Style that doesn't try.",
      skills: [
        "Editorial",
        "Portraiture",
        "Street Style",
        "Minimalism",
        "Raw Aesthetic",
      ],
    },
  },
  {
    id: 2,
    name: "Studio Shodwe",
    role: "New Arrival · FW25",
    img: "/Untitled design (1).png",
    color: "#3b82f6",
    left: {
      tag: "New Arrival",
      headline: "The Navy\nSilhouette.",
      stats: [
        { label: "Colour", value: "Deep Navy" },
        { label: "Drape", value: "Fluid Midi Length" },
        { label: "Season", value: "Fall / Winter 2025" },
      ],
    },
    right: {
      companies: ["Studio Shodwe", "FW25"],
      quote: "One colour. One silhouette. Everything you need for the season.",
      skills: [
        "Womenswear",
        "Minimal Drape",
        "Navy Palette",
        "Gold Detail",
        "Statement Cut",
      ],
    },
  },
  {
    id: 3,
    name: "@reallygreatsite",
    role: "Beauty & Wellness Creator",
    img: "/Untitled design (4).png",
    color: "#c53b3a",
    left: {
      tag: "Beauty Creator",
      headline: "Soul Over\nBeauty.",
      stats: [
        { label: "Niche", value: "Makeup · Skincare · Wellness" },
        { label: "Aesthetic", value: "Dark Glam · Editorial" },
        { label: "Signature", value: "You're not just a makeover" },
      ],
    },
    right: {
      companies: ["Instagram", "Brand Collabs"],
      quote: "You're not just getting a makeover — you're leveling up.",
      skills: [
        "Editorial Makeup",
        "Skincare",
        "Content Creation",
        "Brand Deals",
        "Reels",
      ],
    },
  },
];

const N = candidates.length;
const SCROLL_PER_SEGMENT = 400; // Tight segments — feels effortless
const TOTAL_SCROLL = N * SCROLL_PER_SEGMENT + 200;

// ─── Page ─────────────────────────────────────────────────────────────────────
export default function ScreenSkillFitPage() {
  const containerRef = useRef<HTMLDivElement>(null);
  const pinRef = useRef<HTMLDivElement>(null);

  useGSAP(
    () => {
      // ── All cards + panels start HIDDEN (below screen) ──────────────────
      candidates.forEach((_, i) => {
        gsap.set(`.sc-card-${i}`, {
          y: "115%",
          scale: 0.88,
          opacity: 0,
          rotation: i % 2 === 0 ? 3 : -3,
        });
        gsap.set(`.sc-left-${i}`, { x: -100, opacity: 0 });
        gsap.set(`.sc-right-${i}`, { x: 100, opacity: 0 });
      });

      const scroller = containerRef.current?.closest("#main-scroller") || undefined;

      // ── Master Timeline — scrubbed by scroll ─────────────────────────────
      // Triggers when pinRef reaches top of viewport (after scrolling past intro)
      const tl = gsap.timeline({
        scrollTrigger: {
          trigger: pinRef.current,
          scroller: scroller,
          pin: true,
          anticipatePin: 1,
          scrub: 0.5,
          start: "top top",
          end: `+=${TOTAL_SCROLL}`,
          invalidateOnRefresh: true,
        },
      });

      // Timeline units: each segment = 1 unit
      // Segment layout per card:
      //   [0.0 – 0.5]  card slides IN  + panels slide IN
      //   [0.5 – 0.9]  hold (card visible, nothing moves)
      //   [0.9 – 1.4]  card slides OUT + panels slide OUT  (overlaps with next card's in)

      const SEG = 1;
      const IN_DUR = SEG * 0.45;
      const HOLD_END = SEG * 0.9;
      const OUT_DUR = SEG * 0.5;

      candidates.forEach((_, i) => {
        const base = i * SEG;
        const rotIn = 0;
        const rotOut = i % 2 === 0 ? -5 : 5;

        // — CARD IN — (unchanged)
        tl.to(
          `.sc-card-${i}`,
          {
            y: 0,
            scale: 1,
            opacity: 1,
            rotation: rotIn,
            duration: IN_DUR,
            ease: "power3.out",
          },
          base,
        );

        // — PANELS IN — appear after card is already visible (not simultaneous)
        tl.to(
          `.sc-left-${i}`,
          { x: 0, opacity: 1, duration: IN_DUR * 0.9, ease: "power2.out" },
          base + 0.22, // ← was 0.06 — now panels enter after card is settled
        );
        tl.to(
          `.sc-right-${i}`,
          { x: 0, opacity: 1, duration: IN_DUR * 0.9, ease: "power2.out" },
          base + 0.24, // ← slight stagger right after left
        );

        if (i < N - 1) {
          // — CARD OUT — (unchanged)
          tl.to(
            `.sc-card-${i}`,
            {
              y: "-115%",
              scale: 0.9,
              opacity: 0,
              rotation: rotOut,
              duration: OUT_DUR,
              ease: "power3.inOut",
            },
            base + HOLD_END,
          );

          // — PANELS OUT — exit fast BEFORE card starts moving
          tl.to(
            `.sc-left-${i}`,
            { x: -80, opacity: 0, duration: 0.18, ease: "power3.in" },
            base + HOLD_END - 0.12, // ← exits just before card starts moving
          );
          tl.to(
            `.sc-right-${i}`,
            { x: 80, opacity: 0, duration: 0.18, ease: "power3.in" },
            base + HOLD_END - 0.1, // ← slight stagger
          );
        }
      });
    },
    { scope: containerRef },
  );

  return (
    <div ref={containerRef} className="bg-[#f5f0e8] text-[#1c1714]">
      {/* ══ SECTION 1: Intro ══════════════════════════════════════════════ */}
      <div className="h-screen w-full flex flex-col items-center justify-center relative gap-6">
        {/* Back button — same style as all other pages */}
        <div className="fixed left-6 top-6 z-50">
          <button
            onClick={() =>
              window.history.length > 1
                ? window.history.back()
                : (window.location.href = "/")
            }
            className="brutalist-btn bg-wtf-yellow text-black px-4 py-2 text-xs font-mono font-bold uppercase rounded-md cursor-pointer border-2 border-[#2a2a2a] shadow-[3px_3px_0px_#2a2a2a]"
          >
            ← Back
          </button>
        </div>

        {/* Eyebrow */}
        <span className="font-mono text-[9px] font-bold uppercase tracking-[0.4em] text-[#0c9367] select-none">
          Studio Shodwe · Editorial · Creator
        </span>

        {/* Main heading */}
        <h1 className="font-serif font-black text-[clamp(2.6rem,6vw,5.5rem)] text-[#1c1714] leading-[1.0] tracking-tight uppercase text-center select-none">
          Style.
          <br />
          <span className="text-[#0c9367]">Scroll to see.</span>
        </h1>

        {/* Sub copy */}
        <p className="font-mono text-[11px] text-stone-400 tracking-wide text-center max-w-[300px] leading-relaxed select-none">
          Fashion editorials · Portrait · Beauty creators.
          <br />
          Scroll to meet the cards.
        </p>

        {/* Scroll cue */}
        <div className="flex flex-col items-center gap-2 opacity-40 mt-4 select-none">
          <span className="font-mono text-[8px] uppercase tracking-[0.35em] text-stone-400">
            Scroll
          </span>
          <div className="w-px h-10 bg-stone-300 rounded-full overflow-hidden relative">
            <div
              className="absolute top-0 left-0 w-full h-1/2 bg-stone-600 rounded-full"
              style={{ animation: "scrollPulse 1.8s ease-in-out infinite" }}
            />
          </div>
        </div>
      </div>

      <style>{`
        @keyframes scrollPulse {
          0%   { transform: translateY(-100%); opacity: 0; }
          30%  { opacity: 1; }
          100% { transform: translateY(220%); opacity: 0; }
        }
      `}</style>

      {/* ══ SECTION 2: Pinned animation screen ══════════════════════════════ */}
      <div ref={pinRef} className="h-[calc(100vh-64px)] w-full relative">
        {/* Noise texture */}
        <div
          className="absolute inset-0 pointer-events-none z-0"
          style={{
            opacity: 0.035,
            backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%23000'/%3E%3C/svg%3E")`,
            backgroundSize: "4px 4px",
          }}
        />

        {/* Top status bar */}
        <div className="absolute top-0 left-0 right-0 z-50 h-12 flex items-center justify-between px-8 border-b border-black/[0.06]">
          <span className="font-mono text-[8px] font-bold uppercase tracking-widest text-stone-400">
            Studio Shodwe · Editorial
          </span>
          <span className="font-mono text-[8px] text-stone-400 uppercase tracking-widest">
            {N} Looks · Curated
          </span>
        </div>

        {/* ── Three-column layout ─────────────────────────────────────────── */}
        <div className="absolute inset-0 flex items-center justify-center px-8 md:px-14 gap-8 xl:gap-14">
          {/* LEFT PANELS */}
          <div className="flex-1 h-full relative hidden md:flex items-center">
            <div
              className="relative w-full"
              style={{ height: "min(480px, 60vh)" }}
            >
              {candidates.map((c, i) => (
                <div
                  key={c.id}
                  className={`sc-left-${i} absolute inset-0 flex flex-col justify-center gap-5`}
                >
                  {/* Accent tag */}
                  <span
                    className="self-start font-mono text-[9px] font-black uppercase tracking-[0.22em] px-3 py-1.5 rounded-full border"
                    style={{
                      color: c.color,
                      borderColor: `${c.color}50`,
                      backgroundColor: `${c.color}12`,
                    }}
                  >
                    {c.left.tag}
                  </span>

                  {/* Headline */}
                  <h2
                    className="font-serif font-black text-[clamp(1.9rem,2.8vw,3.2rem)] text-[#1c1714] leading-[1.06] tracking-tight uppercase"
                    style={{ whiteSpace: "pre-line" }}
                  >
                    {c.left.headline}
                  </h2>

                  {/* Stats */}
                  <div className="flex flex-col gap-3.5 mt-1">
                    {c.left.stats.map((s) => (
                      <div key={s.label}>
                        <span className="font-mono text-[8px] uppercase tracking-widest text-stone-400 font-bold block mb-0.5">
                          {s.label}
                        </span>
                        <span className="font-sans font-bold text-[13px] text-stone-700 block">
                          {s.value}
                        </span>
                        <div className="h-px bg-stone-300 w-full mt-2" />
                      </div>
                    ))}
                  </div>
                </div>
              ))}
            </div>
          </div>

          {/* CENTER — card stack */}
          <div
            className="shrink-0 relative"
            style={{ width: "clamp(220px, 22vw, 310px)", aspectRatio: "3/4.3" }}
          >
            {candidates.map((c, i) => (
              <div
                key={c.id}
                className={`sc-card-${i} absolute inset-0 rounded-[2rem] overflow-hidden border border-white/10 shadow-[0_32px_80px_rgba(0,0,0,0.75)]`}
                style={{ zIndex: N - i }}
              >
                {/* Photo */}
                <div className="absolute inset-0">
                  <Image
                    src={c.img}
                    alt={c.name}
                    fill
                    priority={i === 0}
                    unoptimized
                    className="object-cover object-top"
                  />
                  {/* Bottom gradient */}
                  <div
                    className="absolute inset-0"
                    style={{
                      background:
                        "linear-gradient(to top, #0d0d10 0%, rgba(13,13,16,0.6) 38%, transparent 62%)",
                    }}
                  />
                </div>

                {/* Card footer */}
                <div className="absolute bottom-0 left-0 right-0 p-5 z-10">
                  <div
                    className="h-[2px] w-8 rounded-full mb-3"
                    style={{ backgroundColor: c.color }}
                  />
                  <h3 className="font-serif font-black text-[1.15rem] text-white leading-none tracking-tight mb-1">
                    {c.name}
                  </h3>
                  <p
                    className="font-mono text-[9px] font-bold uppercase tracking-wider"
                    style={{ color: c.color }}
                  >
                    {c.role}
                  </p>
                </div>

                {/* Index */}
                <div className="absolute top-4 right-4 z-10 font-mono text-[8px] font-bold text-white/35">
                  [{String(i + 1).padStart(2, "0")} /{" "}
                  {String(N).padStart(2, "0")}]
                </div>
              </div>
            ))}

            {/* Progress dots */}
            <div className="absolute -bottom-8 left-1/2 -translate-x-1/2 flex gap-2">
              {candidates.map((c, i) => (
                <div
                  key={c.id}
                  className={`sc-dot-${i} h-[3px] rounded-full transition-all duration-500`}
                  style={{
                    width: i === 0 ? "18px" : "6px",
                    backgroundColor: i === 0 ? c.color : "#d4cfc8",
                  }}
                />
              ))}
            </div>
          </div>

          {/* RIGHT PANELS */}
          <div className="flex-1 h-full relative hidden md:flex items-center">
            <div
              className="relative w-full"
              style={{ height: "min(480px, 60vh)" }}
            >
              {candidates.map((c, i) => (
                <div
                  key={c.id}
                  className={`sc-right-${i} absolute inset-0 flex flex-col justify-center gap-5`}
                >
                  {/* Companies */}
                  <div>
                    <span className="font-mono text-[8px] uppercase tracking-widest text-stone-400 font-bold block mb-2">
                      Worked at
                    </span>
                    <div className="flex gap-2 flex-wrap">
                      {c.right.companies.map((co) => (
                        <span
                          key={co}
                          className="font-mono text-[9px] font-bold border border-stone-300 bg-stone-100 text-stone-700 px-3 py-1 rounded-full"
                        >
                          {co}
                        </span>
                      ))}
                    </div>
                  </div>

                  {/* Quote */}
                  <blockquote
                    className="font-serif font-bold text-[clamp(1.05rem,1.9vw,1.5rem)] text-[#1c1714] leading-snug tracking-tight pl-4"
                    style={{ borderLeft: `3px solid ${c.color}` }}
                  >
                    &ldquo;{c.right.quote}&rdquo;
                  </blockquote>

                  {/* Skills */}
                  <div>
                    <span className="font-mono text-[8px] uppercase tracking-widest text-stone-400 font-bold block mb-2">
                      Core Skills
                    </span>
                    <div className="flex flex-wrap gap-2">
                      {c.right.skills.map((sk) => (
                        <span
                          key={sk}
                          className="font-mono text-[8px] font-bold uppercase tracking-wide px-2.5 py-1 rounded-md border border-stone-200 text-stone-500 bg-white/60"
                        >
                          {sk}
                        </span>
                      ))}
                    </div>
                  </div>

                  {/* CTA */}
                  <button
                    className="self-start font-mono text-[9px] font-black uppercase tracking-wider px-5 py-2.5 rounded-full"
                    style={{
                      backgroundColor: c.color,
                      color: c.id === 1 ? "#111" : "#fff",
                    }}
                  >
                    View Profile →
                  </button>
                </div>
              ))}
            </div>
          </div>
        </div>

        {/* Bottom-center: thin scroll progress bar */}
        <div className="absolute bottom-0 left-0 right-0 h-[2px] bg-stone-200">
          <div
            className="h-full bg-stone-500"
            style={{ width: "0%", transition: "width 0.3s ease" }}
          />
        </div>
      </div>
    </div>
  );
}
master*0 ⓧ0 ⚠
Ln 523, Col 1Spaces: 2UTF-8TypeScript JSXPrettier

⚙️ Setup & Integration Guide

How to install, import, and configure this animation in your project

💻

Option A: Install via CLI (Recommended)

You can install this component directly into your project via the TweenLabs CLI. It automatically creates the file and configures dependencies:

npx tweenlabs add screen-skill-fit

Option B: Manual Installation

Follow these steps to integrate the component into your project manually:

1

Install Packages

First, install GSAP and its official React hook helper library (@gsap/react).

npm install gsap @gsap/react
2

Add Required CSS Styles

Copy the styles from the Required CSS tab above, or open the styles.css file that was automatically downloaded with your component. Paste these classes into your global stylesheet (e.g. src/app/globals.css or similar).

3

Create Component File

Create a new file in your React or Next.js project (e.g. src/components/SkillFit.tsx) and paste the code from the Standalone React Component tab above. If no standalone tab is available, copy the full page file code and adjust the routing logic for your needs.

⚠️ ScrollTrigger Plugin Notice

This component uses scroll-triggered timing events. Make sure to register the plugin as shown inside the code:

GSAP Registration
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(useGSAP, ScrollTrigger);
4

Import & Render

Import and render the component in your page or view layout:

App Page
import SkillFit from "@/components/SkillFit";

export default function Page() {
  return (
    <main className="min-h-screen p-8 bg-[#f5f5f5] flex items-center justify-center">
      <SkillFit />
    </main>
  );
}
💡

Customization & Component Properties

🛠️ Customization & Component Properties (Props)

You can pass the following settings to configure the layout and animation details:

  • steps (Array): List of candidate checkpoints containing profile stats, score gauges, and descriptions.