Skip to content

Commit f6b3821

Browse files
fix(catalog): run block scripts inline in the docs player, and pages for six shader blocks (#5139)
1 parent 7cf042d commit f6b3821

18 files changed

Lines changed: 798 additions & 9 deletions
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: "Flowing Gradient"
3+
description: "Bands of orange and violet flow across the frame in a smooth gradient. A WebGPU shader from the Shaders library (shaders.com, MIT)."
4+
mode: "frame"
5+
---
6+
7+
import { CatalogDetail, CatalogSlot } from "/snippets/catalog-detail.jsx";
8+
import { InstallCommand } from "/snippets/install-command.jsx";
9+
10+
<CatalogDetail
11+
previewSrc="/public/catalog/blocks/flowing-gradient.json"
12+
compositionId="flowing-gradient"
13+
compositionSrc="compositions/flowing-gradient.html"
14+
title="Flowing Gradient"
15+
description="Bands of orange and violet flow across the frame in a smooth gradient. A WebGPU shader from the Shaders library (shaders.com, MIT)."
16+
variables={[]}
17+
meta={{"duration":2,"width":1920,"height":1080,"category":"Blocks","badge":"Stable","codeLines":31}}
18+
attribution={{"path":"registry/blocks/flowing-gradient","tags":["webgpu","webgpu-shader","background","gradient","color","flow"]}}
19+
video="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/flowing-gradient.mp4"
20+
webgpu
21+
hasCode
22+
rawUrl="https://raw.githubusercontent.com/heygen-com/hyperframes/main/registry/blocks/flowing-gradient/flowing-gradient.html"
23+
>
24+
25+
<CatalogSlot slot="code">
26+
27+
```html flowing-gradient.html
28+
<!doctype html>
29+
<html>
30+
<head>
31+
<meta charset="utf-8" />
32+
<style>
33+
[data-composition-id="flowing-gradient"] canvas[data-shader] {
34+
position: absolute;
35+
inset: 0;
36+
width: 1920px;
37+
height: 1080px;
38+
display: block;
39+
background: #000;
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<div
45+
data-composition-id="flowing-gradient"
46+
data-start="0"
47+
data-duration="2"
48+
data-width="1920"
49+
data-height="1080"
50+
data-requires-webgpu
51+
data-no-timeline
52+
style="position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #000"
53+
>
54+
<canvas data-shader="FlowingGradient" width="1920" height="1080"></canvas>
55+
</div>
56+
<script src="lib/shaders.iife.js"></script>
57+
</body>
58+
</html>
59+
```
60+
61+
</CatalogSlot>
62+
63+
<CatalogSlot slot="install">
64+
65+
<InstallCommand command="npx hyperframes add flowing-gradient" item="flowing-gradient" />
66+
67+
That writes `compositions/flowing-gradient.html`, plus 2 supporting files under `compositions/lib/`.
68+
69+
</CatalogSlot>
70+
71+
<CatalogSlot slot="docs">
72+
73+
## Add it to your video
74+
75+
It runs for 2 seconds at 1920×1080. Paste this into your composition:
76+
77+
```html index.html
78+
<div
79+
data-composition-id="flowing-gradient"
80+
data-composition-src="compositions/flowing-gradient.html"
81+
data-start="0"
82+
data-duration="2"
83+
data-track-index="1"
84+
data-width="1920"
85+
data-height="1080"
86+
></div>
87+
```
88+
89+
Move it in time with `data-start`. Put it on a different timeline row with
90+
`data-track-index`. See [data attributes](/concepts/data-attributes) for the rest.
91+
92+
{/* hf:generated-footer */}
93+
94+
Tagged `webgpu` `webgpu-shader` `background` `gradient` `color` `flow`.
95+
96+
## Related topics
97+
98+
- [Browse the complete Catalog](/catalog)
99+
- [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
100+
- [Build a richer composition](/go-further)
101+
102+
</CatalogSlot>
103+
104+
</CatalogDetail>

‎docs/catalog/blocks/godrays.mdx‎

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: "Godrays"
3+
description: "Rays of light fan out from a corner and drift across a deep blue field. A WebGPU shader from the Shaders library (shaders.com, MIT)."
4+
mode: "frame"
5+
---
6+
7+
import { CatalogDetail, CatalogSlot } from "/snippets/catalog-detail.jsx";
8+
import { InstallCommand } from "/snippets/install-command.jsx";
9+
10+
<CatalogDetail
11+
previewSrc="/public/catalog/blocks/godrays.json"
12+
compositionId="godrays"
13+
compositionSrc="compositions/godrays.html"
14+
title="Godrays"
15+
description="Rays of light fan out from a corner and drift across a deep blue field. A WebGPU shader from the Shaders library (shaders.com, MIT)."
16+
variables={[]}
17+
meta={{"duration":2,"width":1920,"height":1080,"category":"Blocks","badge":"Stable","codeLines":31}}
18+
attribution={{"path":"registry/blocks/godrays","tags":["webgpu","webgpu-shader","background","light","rays"]}}
19+
video="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/godrays.mp4"
20+
webgpu
21+
hasCode
22+
rawUrl="https://raw.githubusercontent.com/heygen-com/hyperframes/main/registry/blocks/godrays/godrays.html"
23+
>
24+
25+
<CatalogSlot slot="code">
26+
27+
```html godrays.html
28+
<!doctype html>
29+
<html>
30+
<head>
31+
<meta charset="utf-8" />
32+
<style>
33+
[data-composition-id="godrays"] canvas[data-shader] {
34+
position: absolute;
35+
inset: 0;
36+
width: 1920px;
37+
height: 1080px;
38+
display: block;
39+
background: #000;
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<div
45+
data-composition-id="godrays"
46+
data-start="0"
47+
data-duration="2"
48+
data-width="1920"
49+
data-height="1080"
50+
data-requires-webgpu
51+
data-no-timeline
52+
style="position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #000"
53+
>
54+
<canvas data-shader="Godrays" width="1920" height="1080"></canvas>
55+
</div>
56+
<script src="lib/shaders.iife.js"></script>
57+
</body>
58+
</html>
59+
```
60+
61+
</CatalogSlot>
62+
63+
<CatalogSlot slot="install">
64+
65+
<InstallCommand command="npx hyperframes add godrays" item="godrays" />
66+
67+
That writes `compositions/godrays.html`, plus 2 supporting files under `compositions/lib/`.
68+
69+
</CatalogSlot>
70+
71+
<CatalogSlot slot="docs">
72+
73+
## Add it to your video
74+
75+
It runs for 2 seconds at 1920×1080. Paste this into your composition:
76+
77+
```html index.html
78+
<div
79+
data-composition-id="godrays"
80+
data-composition-src="compositions/godrays.html"
81+
data-start="0"
82+
data-duration="2"
83+
data-track-index="1"
84+
data-width="1920"
85+
data-height="1080"
86+
></div>
87+
```
88+
89+
Move it in time with `data-start`. Put it on a different timeline row with
90+
`data-track-index`. See [data attributes](/concepts/data-attributes) for the rest.
91+
92+
{/* hf:generated-footer */}
93+
94+
Tagged `webgpu` `webgpu-shader` `background` `light` `rays`.
95+
96+
## Related topics
97+
98+
- [Browse the complete Catalog](/catalog)
99+
- [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
100+
- [Build a richer composition](/go-further)
101+
102+
</CatalogSlot>
103+
104+
</CatalogDetail>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: "Liquid Metal"
3+
description: "A chrome sphere ripples and flows like molten metal on black. A WebGPU shader from the Shaders library (shaders.com, MIT)."
4+
mode: "frame"
5+
---
6+
7+
import { CatalogDetail, CatalogSlot } from "/snippets/catalog-detail.jsx";
8+
import { InstallCommand } from "/snippets/install-command.jsx";
9+
10+
<CatalogDetail
11+
previewSrc="/public/catalog/blocks/liquid-metal.json"
12+
compositionId="liquid-metal"
13+
compositionSrc="compositions/liquid-metal.html"
14+
title="Liquid Metal"
15+
description="A chrome sphere ripples and flows like molten metal on black. A WebGPU shader from the Shaders library (shaders.com, MIT)."
16+
variables={[]}
17+
meta={{"duration":2,"width":1920,"height":1080,"category":"Blocks","badge":"Stable","codeLines":31}}
18+
attribution={{"path":"registry/blocks/liquid-metal","tags":["webgpu","webgpu-shader","object","metal","chrome","liquid","sphere"]}}
19+
video="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/liquid-metal.mp4"
20+
webgpu
21+
hasCode
22+
rawUrl="https://raw.githubusercontent.com/heygen-com/hyperframes/main/registry/blocks/liquid-metal/liquid-metal.html"
23+
>
24+
25+
<CatalogSlot slot="code">
26+
27+
```html liquid-metal.html
28+
<!doctype html>
29+
<html>
30+
<head>
31+
<meta charset="utf-8" />
32+
<style>
33+
[data-composition-id="liquid-metal"] canvas[data-shader] {
34+
position: absolute;
35+
inset: 0;
36+
width: 1920px;
37+
height: 1080px;
38+
display: block;
39+
background: #000;
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<div
45+
data-composition-id="liquid-metal"
46+
data-start="0"
47+
data-duration="2"
48+
data-width="1920"
49+
data-height="1080"
50+
data-requires-webgpu
51+
data-no-timeline
52+
style="position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #000"
53+
>
54+
<canvas data-shader="LiquidMetal" width="1920" height="1080"></canvas>
55+
</div>
56+
<script src="lib/shaders.iife.js"></script>
57+
</body>
58+
</html>
59+
```
60+
61+
</CatalogSlot>
62+
63+
<CatalogSlot slot="install">
64+
65+
<InstallCommand command="npx hyperframes add liquid-metal" item="liquid-metal" />
66+
67+
That writes `compositions/liquid-metal.html`, plus 2 supporting files under `compositions/lib/`.
68+
69+
</CatalogSlot>
70+
71+
<CatalogSlot slot="docs">
72+
73+
## Add it to your video
74+
75+
It runs for 2 seconds at 1920×1080. Paste this into your composition:
76+
77+
```html index.html
78+
<div
79+
data-composition-id="liquid-metal"
80+
data-composition-src="compositions/liquid-metal.html"
81+
data-start="0"
82+
data-duration="2"
83+
data-track-index="1"
84+
data-width="1920"
85+
data-height="1080"
86+
></div>
87+
```
88+
89+
Move it in time with `data-start`. Put it on a different timeline row with
90+
`data-track-index`. See [data attributes](/concepts/data-attributes) for the rest.
91+
92+
{/* hf:generated-footer */}
93+
94+
Tagged `webgpu` `webgpu-shader` `object` `metal` `chrome` `liquid` `sphere`.
95+
96+
## Related topics
97+
98+
- [Browse the complete Catalog](/catalog)
99+
- [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
100+
- [Build a richer composition](/go-further)
101+
102+
</CatalogSlot>
103+
104+
</CatalogDetail>

0 commit comments

Comments
 (0)