@struq/skill 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -36
- package/package.json +4 -2
- package/skills/struq/SKILL.md +139 -307
- package/skills/struq/blocks/CATALOG.md +426 -0
- package/skills/struq/blocks/backgrounds/background-aurora.tsx +818 -0
- package/skills/struq/blocks/backgrounds/background-facets.tsx +1283 -0
- package/skills/struq/blocks/backgrounds/background-silk.tsx +906 -0
- package/skills/struq/blocks/catalog.json +1302 -0
- package/skills/struq/blocks/footers/footer-contact.tsx +789 -0
- package/skills/struq/blocks/footers/footer-reveal.tsx +313 -0
- package/skills/struq/blocks/headers/header-bar.tsx +652 -0
- package/skills/struq/blocks/headers/menu-curtain.tsx +790 -0
- package/skills/struq/blocks/heroes/hero-framed.tsx +627 -0
- package/skills/struq/blocks/heroes/hero-index.tsx +855 -0
- package/skills/struq/blocks/heroes/hero-poster.tsx +1086 -0
- package/skills/struq/blocks/heroes/hero-split.tsx +685 -0
- package/skills/struq/blocks/heroes/hero-still.tsx +862 -0
- package/skills/struq/{recipes/components/struq → blocks/kit}/Cursor.tsx +1 -1
- package/skills/struq/{recipes/components/struq → blocks/kit}/HeroCanvas.tsx +4 -4
- package/skills/struq/{recipes/components/struq → blocks/kit}/HorizontalGallery.tsx +2 -2
- package/skills/struq/{recipes/components/struq → blocks/kit}/MagneticButton.tsx +1 -1
- package/skills/struq/{recipes/components/struq → blocks/kit}/MediaFrame.tsx +2 -2
- package/skills/struq/{recipes/components/struq → blocks/kit}/PinnedZoom.tsx +14 -4
- package/skills/struq/{recipes/components/struq → blocks/kit}/Reveal.tsx +1 -1
- package/skills/struq/{recipes/components/struq → blocks/kit}/SmoothScroll.tsx +1 -1
- package/skills/struq/{recipes/components/struq → blocks/kit}/SplitHeadline.tsx +1 -1
- package/skills/struq/blocks/kit/blocks.css +2102 -0
- package/skills/struq/blocks/kit/images.ts +17 -0
- package/skills/struq/blocks/kit/photo-read.ts +102 -0
- package/skills/struq/blocks/page-transitions/page-transition-gate.tsx +706 -0
- package/skills/struq/blocks/page-transitions/page-transition-slices.tsx +469 -0
- package/skills/struq/blocks/page-transitions/page-transition-stack.tsx +583 -0
- package/skills/struq/blocks/preloaders/preloader-gate.tsx +358 -0
- package/skills/struq/blocks/preloaders/preloader-slices-uncovered.ts +50 -0
- package/skills/struq/blocks/preloaders/preloader-slices.tsx +289 -0
- package/skills/struq/blocks/preloaders/preloader-stack.tsx +367 -0
- package/skills/struq/blocks/preloaders/preloader-wordmark.tsx +568 -0
- package/skills/struq/blocks/sections/about-studio.tsx +436 -0
- package/skills/struq/blocks/sections/approach.tsx +661 -0
- package/skills/struq/blocks/sections/contact-form.tsx +664 -0
- package/skills/struq/blocks/sections/cta-closing.tsx +763 -0
- package/skills/struq/blocks/sections/fanned-cards.tsx +547 -0
- package/skills/struq/blocks/sections/film-strip.tsx +385 -0
- package/skills/struq/blocks/sections/grid-assembly.tsx +616 -0
- package/skills/struq/blocks/sections/hover-list.tsx +467 -0
- package/skills/struq/blocks/sections/image-trail.tsx +432 -0
- package/skills/struq/blocks/sections/manifesto.tsx +691 -0
- package/skills/struq/blocks/sections/panel-accordion.tsx +380 -0
- package/skills/struq/blocks/sections/reveals.tsx +416 -0
- package/skills/struq/blocks/sections/split-pair.tsx +670 -0
- package/skills/struq/blocks/sections/sticky-chapters.tsx +256 -0
- package/skills/struq/blocks/sections/velocity-type.tsx +269 -0
- package/skills/struq/{cinematic/showpieces/toonstuk-fill-rows.tsx → blocks/showpieces/fill-rows.tsx} +1 -1
- package/skills/struq/{cinematic/showpieces/toonstuk-hero-opener.tsx → blocks/showpieces/hero-opener.tsx} +5 -5
- package/skills/struq/{cinematic/showpieces/toonstuk-image-to-fullbleed.tsx → blocks/showpieces/image-to-fullbleed.tsx} +16 -5
- package/skills/struq/blocks/showpieces/manifesto-scrub.tsx +48 -0
- package/skills/struq/{cinematic/showpieces/toonstuk-panel-wipe.tsx → blocks/showpieces/panel-wipe.tsx} +2 -2
- package/skills/struq/{cinematic/showpieces/toonstuk-pixel-resolve.tsx → blocks/showpieces/pixel-resolve.tsx} +1 -1
- package/skills/struq/{cinematic/showpieces/toonstuk-project-stack.tsx → blocks/showpieces/project-stack.tsx} +2 -2
- package/skills/struq/blocks/showpieces/scrub-connector.tsx +307 -0
- package/skills/struq/{cinematic/showpieces/toonstuk-wordmark-finale.tsx → blocks/showpieces/wordmark-finale.tsx} +1 -1
- package/skills/struq/blocks/transitions/zoom-through.tsx +613 -0
- package/skills/struq/canon/canon.json +627 -0
- package/skills/struq/cinematic/README.md +7 -18
- package/skills/struq/cinematic/examples/code/nextjs/app/components/LenisRoot.tsx +1 -1
- package/skills/struq/cinematic/examples/code/shared/styles.css +1 -1
- package/skills/struq/cinematic/examples/code/vite/src/LenisRoot.tsx +1 -1
- package/skills/struq/cinematic/references/01-core-mental-model.md +1 -1
- package/skills/struq/cinematic/references/02-vocabulary.md +1 -1
- package/skills/struq/cinematic/references/07-stack-integration.md +2 -2
- package/skills/struq/recipes/app/fonts.ts +12 -22
- package/skills/struq/recipes/app/globals.css +34 -177
- package/skills/struq/recipes/app/layout.tsx +13 -11
- package/skills/struq/references/craft.md +77 -0
- package/skills/struq/references/iconography.md +28 -230
- package/skills/struq/references/stack-targets.md +23 -74
- package/skills/struq/references/tells.md +52 -0
- package/skills/struq/references/triage.md +6 -7
- package/skills/struq/scripts/blocks.mjs +156 -0
- package/skills/struq/scripts/canon.mjs +106 -281
- package/skills/struq/scripts/check.mjs +92 -126
- package/skills/struq/scripts/images.mjs +2 -2
- package/skills/struq/scripts/log.mjs +6 -23
- package/skills/struq/scripts/tokens.mjs +222 -0
- package/skills/struq/cinematic/showpieces/README.md +0 -18
- package/skills/struq/cinematic/showpieces/toonstuk-manifesto-scrub.tsx +0 -81
- package/skills/struq/cinematic/showpieces/toonstuk-scrub-connector.tsx +0 -78
- package/skills/struq/references/anti-patterns.md +0 -330
- package/skills/struq/references/baseline-prompt.md +0 -122
- package/skills/struq/references/brand.md +0 -143
- package/skills/struq/references/brief-router.md +0 -218
- package/skills/struq/references/composition.md +0 -190
- package/skills/struq/references/depth-parallax.md +0 -235
- package/skills/struq/references/direction.md +0 -188
- package/skills/struq/references/feel-layer.md +0 -107
- package/skills/struq/references/gsap-api.md +0 -293
- package/skills/struq/references/hero-scenes.md +0 -107
- package/skills/struq/references/imagery.md +0 -125
- package/skills/struq/references/loaders.md +0 -287
- package/skills/struq/references/micro-interactions.md +0 -270
- package/skills/struq/references/mobile-composition.md +0 -70
- package/skills/struq/references/nav-header.md +0 -296
- package/skills/struq/references/niche-packets.md +0 -338
- package/skills/struq/references/page-architecture.md +0 -134
- package/skills/struq/references/page-entrances.md +0 -198
- package/skills/struq/references/performance.md +0 -235
- package/skills/struq/references/pinning-scrub.md +0 -340
- package/skills/struq/references/pitfalls.md +0 -290
- package/skills/struq/references/route-transitions.md +0 -281
- package/skills/struq/references/scaling.md +0 -151
- package/skills/struq/references/scroll-reveals.md +0 -279
- package/skills/struq/references/sections.md +0 -141
- package/skills/struq/references/seo.md +0 -219
- package/skills/struq/references/setup.md +0 -397
- package/skills/struq/references/showcase.md +0 -87
- package/skills/struq/references/struq-imagery.md +0 -107
- package/skills/struq/references/svg-motion.md +0 -390
- package/skills/struq/references/transitions.md +0 -160
- package/skills/struq/references/typography.md +0 -720
- package/skills/struq/references/vibe-presets.md +0 -287
- package/skills/struq/references/webgl-r3f.md +0 -274
- package/skills/struq/references/webgl-scenes.md +0 -593
- package/skills/struq/scripts/font-names.mjs +0 -40
- package/skills/struq/scripts/recipes.mjs +0 -135
- /package/skills/struq/{recipes/lib → blocks/kit}/gsap.ts +0 -0
- /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/contours.ts +0 -0
- /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/dots.ts +0 -0
- /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/ripple.ts +0 -0
- /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/types.ts +0 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
//
|
|
12
12
|
// Leave it out for a genre where a custom cursor fights the job (a booking flow, a dense shop).
|
|
13
13
|
import { useRef } from "react";
|
|
14
|
-
import { gsap, useGSAP } from "
|
|
14
|
+
import { gsap, useGSAP } from "./gsap";
|
|
15
15
|
|
|
16
16
|
export function Cursor() {
|
|
17
17
|
const root = useRef<HTMLDivElement>(null);
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
// <div className="relative z-10"><h1 data-quiet>...</h1><p data-quiet>...</p></div>
|
|
24
24
|
// </section>
|
|
25
25
|
//
|
|
26
|
-
// A scene
|
|
27
|
-
// components/struq/scenes/<name>.ts exporting createScene (see scenes/types.ts) and add it to SCENES.
|
|
26
|
+
// A scene of your own: write it as
|
|
27
|
+
// components/struq/kit/scenes/<name>.ts exporting createScene (see scenes/types.ts) and add it to SCENES.
|
|
28
28
|
import Image from "next/image";
|
|
29
29
|
import { useEffect, useRef } from "react";
|
|
30
|
-
import { gsap } from "
|
|
31
|
-
import type { StruqImage } from "
|
|
30
|
+
import { gsap } from "./gsap";
|
|
31
|
+
import type { StruqImage } from "./images";
|
|
32
32
|
import type { CreateScene, Palette } from "./scenes/types";
|
|
33
33
|
|
|
34
34
|
const SCENES: Record<string, () => Promise<{ createScene: CreateScene }>> = {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// />
|
|
12
12
|
import Image from "next/image";
|
|
13
13
|
import { useRef } from "react";
|
|
14
|
-
import { gsap, useGSAP } from "
|
|
15
|
-
import type { StruqImage } from "
|
|
14
|
+
import { gsap, useGSAP } from "./gsap";
|
|
15
|
+
import type { StruqImage } from "./images";
|
|
16
16
|
|
|
17
17
|
type Item = { image: StruqImage; title: string; text?: string };
|
|
18
18
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// <MediaFrame image={images.card[2]} ratio="3/2" sizes="(min-width: 768px) 40vw, 100vw" />
|
|
12
12
|
import Image from "next/image";
|
|
13
13
|
import { useRef } from "react";
|
|
14
|
-
import { gsap, useGSAP } from "
|
|
15
|
-
import type { StruqImage } from "
|
|
14
|
+
import { gsap, useGSAP } from "./gsap";
|
|
15
|
+
import type { StruqImage } from "./images";
|
|
16
16
|
|
|
17
17
|
type Props = {
|
|
18
18
|
image: StruqImage;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// />
|
|
12
12
|
import Image from "next/image";
|
|
13
13
|
import { useRef } from "react";
|
|
14
|
-
import { gsap, useGSAP } from "
|
|
15
|
-
import type { StruqImage } from "
|
|
14
|
+
import { gsap, useGSAP } from "./gsap";
|
|
15
|
+
import type { StruqImage } from "./images";
|
|
16
16
|
|
|
17
17
|
type Props = {
|
|
18
18
|
image: StruqImage;
|
|
@@ -31,16 +31,26 @@ export function PinnedZoom({ image, statement, closing, className = "" }: Props)
|
|
|
31
31
|
const q = gsap.utils.selector(el);
|
|
32
32
|
const mm = gsap.matchMedia();
|
|
33
33
|
mm.add("(prefers-reduced-motion: no-preference)", () => {
|
|
34
|
-
|
|
34
|
+
// Two numbers drive the clip, never a tweened string: the browser shortens a symmetric inset to two
|
|
35
|
+
// values, GSAP pairs them with four end values, and two edges jump open in one frame.
|
|
36
|
+
const frame = q("[data-zoom-frame]")[0] as HTMLElement;
|
|
37
|
+
const clip = { y: 22, x: 30 };
|
|
38
|
+
const paint = () => {
|
|
39
|
+
frame.style.clipPath = `inset(${clip.y}% ${clip.x}% ${clip.y}% ${clip.x}%)`;
|
|
40
|
+
};
|
|
41
|
+
paint();
|
|
35
42
|
gsap.set(q("[data-zoom-closing]"), { autoAlpha: 0, yPercent: 40 });
|
|
36
43
|
const tl = gsap.timeline({
|
|
37
44
|
defaults: { ease: "none" },
|
|
38
45
|
scrollTrigger: { trigger: el, start: "top top", end: "+=160%", pin: true, scrub: 1 },
|
|
39
46
|
});
|
|
40
|
-
tl.to(
|
|
47
|
+
tl.to(clip, { y: 0, x: 0, duration: 1, onUpdate: paint }, 0)
|
|
41
48
|
.fromTo(q("[data-zoom-photo]"), { scale: 1.35 }, { scale: 1, duration: 1 }, 0)
|
|
42
49
|
.to(q("[data-zoom-statement]"), { yPercent: -60, autoAlpha: 0, duration: 0.45 }, 0)
|
|
43
50
|
.to(q("[data-zoom-closing]"), { yPercent: 0, autoAlpha: 1, duration: 0.35 }, 0.62);
|
|
51
|
+
return () => {
|
|
52
|
+
frame.style.clipPath = "";
|
|
53
|
+
};
|
|
44
54
|
});
|
|
45
55
|
// Still version: the photo is full bleed from the start, so the statement turns light.
|
|
46
56
|
mm.add("(prefers-reduced-motion: reduce)", () => {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// Before hydration the children are hidden only when JavaScript runs (the `js` class from the
|
|
12
12
|
// layout), and a CSS failsafe shows them after 3s if hydration never comes (globals.css).
|
|
13
13
|
import { useRef } from "react";
|
|
14
|
-
import { gsap, useGSAP } from "
|
|
14
|
+
import { gsap, useGSAP } from "./gsap";
|
|
15
15
|
|
|
16
16
|
type Props = {
|
|
17
17
|
children: React.ReactNode;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
//
|
|
10
10
|
// Pass plain text (or text with <em>): SplitText needs text nodes, not components.
|
|
11
11
|
import { useRef } from "react";
|
|
12
|
-
import { gsap, SplitText, useGSAP } from "
|
|
12
|
+
import { gsap, SplitText, useGSAP } from "./gsap";
|
|
13
13
|
|
|
14
14
|
type Props = {
|
|
15
15
|
children: React.ReactNode;
|