Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计提醒

spline-3d-integration样条 3D 积分

Agent Skill

spline-3d-integration 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

220

周安装

9

GitHub Stars

1

下载量

71
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:spline-3d-integration(样条 3D 积分)
来源仓库:https://github.com/codecrafter98/spline-3d-integration
仓库路径:skills/spline-3d-integration
安装命令:
npx skills add https://github.com/codecrafter98/spline-3d-integration --skill spline-3d-integration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codecrafter98/spline-3d-integration --skill spline-3d-integration

简介

spline-3d-integration 提供将 Spline.design 的交互式 3D 场景嵌入网页的完整指南。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中需要添加 3D 可视化内容时使用。
  • 支持三种嵌入方式:iframe、Web Component 和原生 JavaScript 加载,各有适用场景。
  • 安装前建议确认项目的技术栈和部署环境,注意 Spline 场景需要网络访问权限。
  • 提供交互事件处理、性能优化和响应式布局的配置说明。

SKILL.md

Spline 3D Integration

Master guide for embedding interactive 3D scenes from Spline.design into web projects.


What Is Spline?

Spline is a browser-based 3D design tool — think of it as Figma, but for 3D. Designers create interactive 3D scenes (objects, materials, animations, physics, events) in the Spline editor, then export them for the web.

  • Free tier available (with watermark)
  • Scenes are hosted by Spline and loaded at runtime
  • Supports mouse, scroll, keyboard, and touch interactions
  • Built on WebGL — works in all modern browsers

Integration Methods

There are 3 ways to embed a Spline scene. Choose based on your stack:

MethodBest ForPackage
React ComponentReact / Next.js apps@splinetool/react-spline
Vanilla JS RuntimePlain HTML/JS, Webflow, any framework@splinetool/runtime
iframe EmbedQuick embeds, no-code sites, CMSNone (just a URL)

Decision Guide

Is this a React or Next.js project?
  → YES: Use @splinetool/react-spline (see REACT_INTEGRATION.md)
  → NO:
      Do you need programmatic control (events, variables, animations)?
        → YES: Use @splinetool/runtime (see VANILLA_INTEGRATION.md)
        → NO: Use iframe embed (simplest option)

Quick Start

Getting the Scene URL

  1. Open your scene in the Spline editor
  2. Click Export (top-right)
  3. Select Code
  4. Choose React or Vanilla JS
  5. Copy the scene URL — it looks like: https://prod.spline.design/aBcDeFgHiJkLmNoP/scene.splinecode
Important: The URL contains a unique scene ID. Each time you re-export, Spline generates a new URL. Use the latest one.

React (10 lines)

npm install @splinetool/react-spline @splinetool/runtime
import Spline from '@splinetool/react-spline';

export default function MyScene() {
  return (
    <div style={{ width: '100%', height: '100vh' }}>
      <Spline scene="https://prod.spline.design/YOUR_SCENE_ID/scene.splinecode" />
    </div>
  );
}

Vanilla JS (10 lines)

<canvas id="canvas3d" style="width: 100%; height: 100vh;"></canvas>
<script type="module">
  import { Application } from 'https://esm.sh/@splinetool/runtime';

  const canvas = document.getElementById('canvas3d');
  const spline = new Application(canvas);
  spline.load('https://prod.spline.design/YOUR_SCENE_ID/scene.splinecode')
    .then(() => console.log('Scene loaded!'));
</script>

iframe (1 line)

<iframe src="https://my.spline.design/YOUR_SCENE_ID/" width="100%" height="600" frameborder="0"></iframe>

Runtime API — Key Methods

Once a scene is loaded, you can interact with it programmatically. These methods work in both React (via onLoad callback) and vanilla JS (via the Application instance).

Getting a Reference

React:

function handleLoad(splineApp) {
  // splineApp is your runtime reference
  const cube = splineApp.findObjectByName('Cube');
}

<Spline scene="..." onLoad={handleLoad} />

Vanilla JS:

spline.load('...').then(() => {
  const cube = spline.findObjectByName('Cube');
});

Object Queries

MethodWhat It Does
findObjectByName('name')Find an object by its name in the Spline editor
findObjectById('uuid')Find an object by its unique ID
getAllObjects()Get an array of all objects in the scene

Triggering Events

You can trigger events that are already defined in the Spline editor:

// Trigger a mouseDown event on an object by name
splineApp.emitEvent('mouseDown', 'Cube');

// Trigger by object ID
splineApp.emitEventReverse('mouseDown', 'object-uuid');

Supported event types: mouseDown, mouseUp, mouseHover, keyDown, keyUp, start, lookAt, follow

Listening to Events

splineApp.addEventListener('mouseDown', (e) => {
  console.log('Clicked:', e.target.name);
  console.log('Position:', e.target.position);
});

splineApp.addEventListener('mouseHover', (e) => {
  document.body.style.cursor = 'pointer';
});

Variables

Spline scenes can have variables (defined in the editor). You can read and write them from code:

// Read
const score = splineApp.getVariable('score');

// Write — this updates the scene in real-time
splineApp.setVariable('score', 42);
splineApp.setVariable('isActive', true);
splineApp.setVariable('userName', 'Visitor');
Use case: Drive 3D animations from your app data. For example, set a progress variable that controls a loading bar animation inside the Spline scene.

Object Properties (Direct Manipulation)

Once you have an object reference, you can modify it directly:

const cube = splineApp.findObjectByName('Cube');

// Position
cube.position.x = 2;
cube.position.y = 0;
cube.position.z = -1;

// Rotation (radians)
cube.rotation.y = Math.PI / 4;

// Scale
cube.scale.x = 1.5;
cube.scale.y = 1.5;
cube.scale.z = 1.5;

Common Patterns

1. Hero Section with 3D Scene

The most popular pattern — a split layout with text on one side and a 3D scene on the other. See examples/react-spline-wrapper.tsx for the recommended lazy-loaded component.

<div className="hero">
  <div className="hero-text">
    <h1>Welcome</h1>
    <p>Some subtitle text</p>
  </div>
  <div className="hero-3d">
    <SplineScene scene="https://prod.spline.design/.../scene.splinecode" />
  </div>
</div>

Key tips:

  • Always lazy-load the Spline component (it's a heavy library)
  • Show a loading spinner/skeleton while the scene loads
  • Use flex or grid for the split layout
  • On mobile, stack vertically or consider hiding the 3D scene entirely

2. Interactive Product Viewer

Let users rotate, zoom, and interact with a 3D product:

function ProductViewer({ sceneUrl }) {
  const handleLoad = (app) => {
    // Listen for clicks on hotspots
    app.addEventListener('mouseDown', (e) => {
      if (e.target.name === 'Hotspot_1') {
        showProductDetail('screen');
      }
    });
  };

  return <Spline scene={sceneUrl} onLoad={handleLoad} />;
}

3. Scroll-Driven 3D

Connect scroll position to a Spline variable to create scroll-triggered 3D animations:

const splineApp = /* your loaded app */;

window.addEventListener('scroll', () => {
  const scrollPercent = window.scrollY / (document.body.scrollHeight - window.innerHeight);
  splineApp.setVariable('scrollProgress', scrollPercent);
});

Then in the Spline editor, use the scrollProgress variable to drive animations (0 to 1).

4. Data-Driven 3D Dashboard

Update 3D visualizations from live data:

async function updateDashboard() {
  const data = await fetch('/api/metrics').then(r => r.json());

  splineApp.setVariable('revenue', data.revenue);
  splineApp.setVariable('users', data.activeUsers);
  splineApp.setVariable('status', data.systemStatus);
}

// Update every 5 seconds
setInterval(updateDashboard, 5000);

Performance Best Practices

This is the #1 issue people hit with Spline. Follow these rules:

The Big 8

#RuleWhy
1Max 150k polygons per sceneMore polygons = more GPU work = slower rendering
2≤ 3 lights per sceneEach light multiplies rendering calculations
3Enable geometry compression on exportReduces file size by 50-80%
4Lazy-load scenes below the foldDon't load what the user can't see yet
5One complex scene per page maxMultiple scenes compete for GPU resources
6Delete hidden/unused objectsThey still get loaded and processed
7Use Matcap materials over complex lightingFakes realistic shading without GPU cost
8Consider image/video fallback for simple scenesIf the scene doesn't need interaction, export as image/video instead

Lazy Loading Pattern (React)

Always lazy-load the Spline component. The @splinetool/runtime package is ~500KB+.

import { Suspense, lazy } from 'react';

const Spline = lazy(() => import('@splinetool/react-spline'));

export function SplineScene({ scene, className }) {
  return (
    <Suspense
      fallback={
        <div className="spline-loader">
          <div className="spinner" />
        </div>
      }
    >
      <Spline scene={scene} className={className} />
    </Suspense>
  );
}

Spline Editor Optimization Checklist

Before exporting, run through this in the Spline editor:

  1. Open the Performance panel (View → Performance)
  2. Check polygon count — aim for under 150k
  3. Remove any hidden or off-screen objects
  4. Reduce segments on smooth objects (spheres, cylinders)
  5. Under Export settings:

- Set Geometry Quality to "Performance" - Enable Image Compression

  1. Test on mobile — if it's slow, simplify further

Gotchas & Troubleshooting

CORS Issues

Problem: Scene won't load, browser console shows CORS errors. Solution: Download the .splinecode file from Spline's export panel and self-host it. Serve it from your own domain or a CDN.

// Instead of Spline's URL
<Spline scene="https://prod.spline.design/abc123/scene.splinecode" />

// Self-hosted
<Spline scene="/assets/scene.splinecode" />

Version Mismatches

Problem: TypeError or blank screen after install. Solution: Make sure @splinetool/react-spline and @splinetool/runtime versions are compatible. Install them together:

npm install @splinetool/react-spline@latest @splinetool/runtime@latest

Scene Loads but Shows Blank White

Problem: Container has 0 height. Solution: The Spline component fills its parent. Make sure the parent has explicit dimensions:

.spline-container {
  width: 100%;
  height: 100vh; /* or any fixed/relative height */
  position: relative;
}

Mobile Performance

Problem: Scene is laggy or crashes on phones. Solutions:

  • Reduce polygon count significantly (under 50k for mobile)
  • Use fewer lights (1-2 max)
  • Consider showing a static image on mobile instead:
function ResponsiveScene({ scene, fallbackImage }) {
  const isMobile = window.innerWidth < 768;

  if (isMobile) {
    return <img src={fallbackImage} alt="3D scene" />;
  }

  return <SplineScene scene={scene} />;
}

Loading UX

Problem: Users see a blank space for 2-5 seconds while the scene loads. Solution: Always show a loader. Use the onLoad callback to hide it:

function SceneWithLoader({ scene }) {
  const [loaded, setLoaded] = useState(false);

  return (
    <div className="scene-container">
      {!loaded && <div className="spinner" />}
      <Spline
        scene={scene}
        onLoad={() => setLoaded(true)}
        style={{ opacity: loaded ? 1 : 0, transition: 'opacity 0.5s' }}
      />
    </div>
  );
}

Detailed Guides

Examples

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.7%
按下载量换算26

Claude

29.96%
按下载量换算21

Cursor

18.87%
按下载量换算13

Gemini CLI

7.81%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills