效果

纹理遮罩文字

使用纹理 PNG 遮罩为文字添加材质效果

text texture mask effect

砖块
BRICK
岩石
ROCK
地面 103
GROUND
木材
WOOD
金属
METAL
熔岩
LAVA

安装

npx hyperframes add texture-mask-text

详情

属性
类型组件

智能体使用方法

在请求智能体应用纹理时,使用以下措辞:

Use the Texture Mask Text catalog component.

1. From the project root, run:
npx hyperframes add texture-mask-text
2. That command creates this installed snippet:
compositions/components/texture-mask-text/texture-mask-text.html
3. Open that file and paste the real <style> block
near the bottom into the composition once. That CSS defines
hf-texture-text and every hf-texture-* class.
4. Apply this class to the target text:
class="hf-texture-text hf-texture-brick"
5. For another material, copy one hf-texture-* class
from the Texture Examples cards.
6. This is the proper way to apply drop shadow
o textured text: wrap the text and put
filter on the wrapper, not on the text.
Use this markup:
<div style="filter: drop-shadow(1px 2px 1px rgba(0,0,0,0.48))">
<div class="hf-texture-text hf-texture-brick">TEXT</div>
</div>

安装后,代码片段位于你运行 npx hyperframes add texture-mask-text 的项目中的 compositions/components/texture-mask-text/texture-mask-text.html。需要粘贴的部分是该文件底部附近的真正 <style> 元素;纹理 PNG 文件安装到 assets/texture-mask-text/masks/ 目录中,CSS 中通过项目根目录的 URL 引用它们。

hf-texture-brick 替换为下方任意纹理卡片上显示的类名。基础类 hf-texture-text 始终是必需的。

动画纹理

通过在文字元素上移动遮罩位置来为纹理添加动画。将 drop-shadow 保留在包裹器上,使阴影跟随纹理轮廓。

动画遮罩位置
hf-texture-text hf-texture-lava
MOTION
<div class="texture-shadow">
<div class="hf-texture-text hf-texture-lava animated-texture">MOTION</div>
</div>
.animated-texture {
--mask-size: 180% 180%;
--mask-position: 0% 50%;
}
const tl = gsap.timeline({ paused: true });
l.to(".animated-texture", {
"--mask-position": "100% 50%",
duration: 1.2,
ease: "sine.inOut",
yoyo: true,
repeat: 1,
}, 0);
window.__timelines["my-composition"] = tl;

纹理示例

砌体

砖块
hf-texture-brick
BRICK
使用 hf-texture-text hf-texture-brick
砖块 104
hf-texture-bricks-104
BRICK
使用 hf-texture-text hf-texture-bricks-104
砖块 102
hf-texture-bricks-102
BRICK
使用 hf-texture-text hf-texture-bricks-102
砖块 101
hf-texture-bricks-101
BRICK
使用 hf-texture-text hf-texture-bricks-101
砖块 075 A
hf-texture-bricks-075-a
BRICK
使用 hf-texture-text hf-texture-bricks-075-a
混凝土
hf-texture-concrete
CONCRETE
使用 hf-texture-text hf-texture-concrete
混凝土 034
hf-texture-concrete-034
CONCRETE
使用 hf-texture-text hf-texture-concrete-034
混凝土 047 A
hf-texture-concrete-047-a
CONCRETE
使用 hf-texture-text hf-texture-concrete-047-a
混凝土 046
hf-texture-concrete-046
CONCRETE
使用 hf-texture-text hf-texture-concrete-046
混凝土 042 A
hf-texture-concrete-042-a
CONCRETE
使用 hf-texture-text hf-texture-concrete-042-a
灰泥 001
hf-texture-plaster-001
PLASTER
使用 hf-texture-text hf-texture-plaster-001
彩绘灰泥 017
hf-texture-painted-plaster-017
PLASTER
使用 hf-texture-text hf-texture-painted-plaster-017

石材

岩石
hf-texture-rock
ROCK
使用 hf-texture-text hf-texture-rock
岩石 063
hf-texture-rock-063
ROCK
使用 hf-texture-text hf-texture-rock-063
岩石 058
hf-texture-rock-058
ROCK
使用 hf-texture-text hf-texture-rock-058
玛瑙
hf-texture-onyx
ONYX
使用 hf-texture-text hf-texture-onyx
大理石 012
hf-texture-marble-012
MARBLE
使用 hf-texture-text hf-texture-marble-012
大理石 016
hf-texture-marble-016
MARBLE
使用 hf-texture-text hf-texture-marble-016
石灰华 009
hf-texture-travertine-009
STONE
使用 hf-texture-text hf-texture-travertine-009
铺路石 150
hf-texture-paving-stones-150
STONE
使用 hf-texture-text hf-texture-paving-stones-150
铺路石 138
hf-texture-paving-stones-138
STONE
使用 hf-texture-text hf-texture-paving-stones-138
瓷砖 138
hf-texture-tiles-138
TILE
使用 hf-texture-text hf-texture-tiles-138

地面 / 道路

地面 103
hf-texture-ground-103
GROUND
使用 hf-texture-text hf-texture-ground-103
地面 037
hf-texture-ground-037
GROUND
使用 hf-texture-text hf-texture-ground-037
地面 054
hf-texture-ground-054
GROUND
使用 hf-texture-text hf-texture-ground-054
地面 104
hf-texture-ground-104
GROUND
使用 hf-texture-text hf-texture-ground-104
地面 068
hf-texture-ground-068
GROUND
使用 hf-texture-text hf-texture-ground-068
地面 080
hf-texture-ground-080
GROUND
使用 hf-texture-text hf-texture-ground-080
道路 012 A
hf-texture-road-012-a
ROAD
使用 hf-texture-text hf-texture-road-012-a
道路 008 A
hf-texture-road-008-a
ROAD
使用 hf-texture-text hf-texture-road-008-a
道路 007
hf-texture-road-007
ROAD
使用 hf-texture-text hf-texture-road-007
道路 013 A
hf-texture-road-013-a
ROAD
使用 hf-texture-text hf-texture-road-013-a
道路 012 B
hf-texture-road-012-b
ROAD
使用 hf-texture-text hf-texture-road-012-b
道路 009 C
hf-texture-road-009-c
ROAD
使用 hf-texture-text hf-texture-road-009-c
沥青 031
hf-texture-asphalt-031
ASPHALT
使用 hf-texture-text hf-texture-asphalt-031

木材

木材
hf-texture-wood
WOOD
使用 hf-texture-text hf-texture-wood
木材 094
hf-texture-wood-094
WOOD
使用 hf-texture-text hf-texture-wood-094
木材 092
hf-texture-wood-092
WOOD
使用 hf-texture-text hf-texture-wood-092
木材 051
hf-texture-wood-051
WOOD
使用 hf-texture-text hf-texture-wood-051
木材 066
hf-texture-wood-066
WOOD
使用 hf-texture-text hf-texture-wood-066
木材 049
hf-texture-wood-049
WOOD
使用 hf-texture-text hf-texture-wood-049
木材 058
hf-texture-wood-058
WOOD
使用 hf-texture-text hf-texture-wood-058
木地板 051
hf-texture-wood-floor-051
FLOOR
使用 hf-texture-text hf-texture-wood-floor-051
木地板 064
hf-texture-wood-floor-064
FLOOR
使用 hf-texture-text hf-texture-wood-floor-064
木地板 070
hf-texture-wood-floor-070
FLOOR
使用 hf-texture-text hf-texture-wood-floor-070
树皮 014
hf-texture-bark-014
BARK
使用 hf-texture-text hf-texture-bark-014

金属

金属
hf-texture-metal
METAL
使用 hf-texture-text hf-texture-metal
金属 049 A
hf-texture-metal-049-a
METAL
使用 hf-texture-text hf-texture-metal-049-a
金属 055 A
hf-texture-metal-055-a
METAL
使用 hf-texture-text hf-texture-metal-055-a
金属 046 B
hf-texture-metal-046-b
METAL
使用 hf-texture-text hf-texture-metal-046-b
金属 061 B
hf-texture-metal-061-b
METAL
使用 hf-texture-text hf-texture-metal-061-b
金属 048 A
hf-texture-metal-048-a
METAL
使用 hf-texture-text hf-texture-metal-048-a
金属 032
hf-texture-metal-032
METAL
使用 hf-texture-text hf-texture-metal-032
金属 041 A
hf-texture-metal-041-a
METAL
使用 hf-texture-text hf-texture-metal-041-a
金属 038
hf-texture-metal-038
METAL
使用 hf-texture-text hf-texture-metal-038
菱形钢板 009
hf-texture-diamond-plate-009
PLATE
使用 hf-texture-text hf-texture-diamond-plate-009

有机 / 柔软

熔岩
hf-texture-lava
LAVA
使用 hf-texture-text hf-texture-lava
草地 005
hf-texture-grass-005
GRASS
使用 hf-texture-text hf-texture-grass-005
草地 001
hf-texture-grass-001
GRASS
使用 hf-texture-text hf-texture-grass-001
草地 004
hf-texture-grass-004
GRASS
使用 hf-texture-text hf-texture-grass-004
地毯
hf-texture-carpet
WOVEN
使用 hf-texture-text hf-texture-carpet
织物 083
hf-texture-fabric-083
FABRIC
使用 hf-texture-text hf-texture-fabric-083
hf-texture-snow
SNOW
使用 hf-texture-text hf-texture-snow
雪 015
hf-texture-snow-015
SNOW
使用 hf-texture-text hf-texture-snow-015
皮革 037
hf-texture-leather-037
LEATHER
使用 hf-texture-text hf-texture-leather-037
织物 080
hf-texture-fabric-080
FABRIC
使用 hf-texture-text hf-texture-fabric-080

使用方法

运行 npx hyperframes add texture-mask-text 后,安装的代码片段位于你当前 HyperFrames 项目中的 compositions/components/texture-mask-text/texture-mask-text.html。打开该文件并将底部附近真正的 <style> 元素粘贴到你的 composition 中一次;它定义了 hf-texture-text 以及上方示例中使用的所有 hf-texture-* 类。将安装的纹理 PNG 文件保留在 assets/texture-mask-text/masks/ 目录中;CSS 通过项目根目录的 URL 引用它们。