恒美微站 Logo 恒美微站
  • 首页
  • 关于我们
  • 建站服务
  • 主题模板
  • 案例展示
  • 资讯中心
  • 联系我们

spline-3d-integration - VANILLA_INTEGRATION

  • 首页
  • 资讯中心
  • /
  • spline-3d-integration - VANILLA_INTEGRATION

相关资讯

生成对抗网络(GAN)原始论文深度解析:从博弈原理到复现调参实战 2026/10/18 4:01:19
Sakurairo:5 分钟搭好的 AI 辅助 WordPress 主题 2026/10/18 4:01:19
内存池设计与实现:绕开系统调用与GC的性能优化实践 2026/10/18 4:01:19

最新资讯

SAP 公共已发布 API,撑起 ABAP Cloud 升级稳定性的接口契约
学习C#开源报表组件Seal Report(38:Seal Report Designer界面布局-34)
学习C#开源报表组件Seal Report(39:Seal Report Designer界面布局-35)
轻量人脸表情识别系统:课堂行为检测的工程化实践
TensorRT INT8量化实战:行人检测与密度分析系统部署全攻略
从I/O分配到自动寻址:PLC堆垛机立体仓库设计与调试全解析

今日推荐

基于GMM的语音识别系统原理与MATLAB实现详解
数字图像处理入门:反白、灰度化、调色板修改与导出txt实践
机器人大脑技术盘点:具身智能的感知、决策与数据闭环

本周热门

基于GMM的语音识别系统原理与MATLAB实现详解
数字图像处理入门:反白、灰度化、调色板修改与导出txt实践
机器人大脑技术盘点:具身智能的感知、决策与数据闭环

本月精选

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频
Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证
2026 大模型集体涨价:用 Python 做企业 Token 成本测算与选型避坑(附配置)

spline-3d-integration - VANILLA_INTEGRATION

发布时间:2026/10/18 4:06:19
spline-3d-integration - VANILLA_INTEGRATION Vanilla JS / HTML 集成根据你需要的控制程度有两种方法。方法 A — Web 组件大多数情况下推荐无需 npm。只需添加到 HTML 即可。支持懒加载、透明背景和鼠标交互。!-- In head — loads the web component --scripttypemodulesrchttps://unpkg.com/splinetool/viewer/build/spline-viewer.js/script!-- Basic embed --spline-viewerurlhttps://prod.spline.design/REPLACE_ME/scene.splinecode/spline-viewer!-- With mouse-following interactivity (e.g. cursor-tracking robots) --spline-viewerurlhttps://prod.spline.design/REPLACE_ME/scene.splinecodeevents-targetglobal/spline-viewer!-- Transparent background --spline-viewerurlhttps://prod.spline.design/REPLACE_ME/scene.splinecodebackgroundtransparent/spline-viewer方法 B — 运行时 API当需要编程控制时当你需要从自己的 JS 中操作对象、触发动画或响应事件时使用。安装npminstallsplinetool/runtime或通过 CDN无需安装scripttypemoduleimport{Application}fromhttps://unpkg.com/splinetool/runtimelatest/build/runtime.module.js;// ... rest of your code/script基本用法import{Application}fromsplinetool/runtime;constcanvasdocument.getElementById(canvas3d);constsplinenewApplication(canvas);spline.load(https://prod.spline.design/REPLACE_ME/scene.splinecode).then((){console.log(Scene loaded);});带对象交互spline.load(sceneUrl).then((){constobjspline.findObjectByName(Cube);// or by ID: spline.findObjectById(uuid-here)obj.position.x50;obj.rotation.yMath.PI/4;// NOTE: radians, NOT degreesobj.scale.x2;});带事件监听器spline.load(sceneUrl).then((){spline.addEventListener(mouseDown,(e){console.log(Clicked:,e.target.name);});});以编程方式触发动画spline.load(sceneUrl).then((){constobjspline.findObjectByName(MyObject);obj.emitEvent(mouseHover);// forwardobj.emitEventReverse(mouseHover);// reverse});全页背景设置最常见的用例——Spline 场景位于所有内容之后。!DOCTYPEhtmlhtmlheadscripttypemodulesrchttps://unpkg.com/splinetool/viewer/build/spline-viewer.js/scriptstyle*{margin:0;padding:0;box-sizing:border-box;}body{/* DO NOT add overflow: hidden here — it will break page scroll */position:relative;}.spline-bg{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;/* pointer-events: none — use this if scene is decorative only *//* pointer-events: all — use this if you want mouse interaction */pointer-events:all;}.content{position:relative;z-index:1;/* Make sure content elements dont get blocked by the 3D scene */}/* Fallback shown while Spline loads or if it fails */.spline-fallback{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;background:#0a0a0a;/* match your sites base color */display:none;/* hidden by default, shown via JS if needed */}/style/headbody!-- Fallback (shown if Spline fails to load) --divclassspline-fallbackidspline-fallback/div!-- Spline background --divclassspline-bgspline-viewerurlhttps://prod.spline.design/REPLACE_ME/scene.splinecodeevents-targetglobalstylewidth:100%;height:100%;/spline-viewer/div!-- Your website content --divclasscontenth1Your Content Here/h1/divscript// Show fallback if Spline hasnt loaded after 8 secondssetTimeout((){constviewerdocument.querySelector(spline-viewer);if(!viewer||!viewer.shadowRoot){document.getElementById(spline-fallback).style.displayblock;}},8000);// Skip Spline entirely on low-end mobile to save battery performanceif(window.innerWidth768||navigator.hardwareConcurrency2){document.querySelector(.spline-bg).style.displaynone;document.getElementById(spline-fallback).style.displayblock;}/script/body/html可用事件类型事件用例mouseDown点击/点按对象mouseUp点击后释放mouseHover光标进入对象区域mousePress按住点击keyDown按键按下keyUp按键释放start场景已加载并开始scroll页面滚动预加载减少感知加载时间添加到head中以便在脚本运行前开始获取场景文件linkrelpreloadhrefhttps://prod.spline.design/REPLACE_ME/scene.splinecodeasfetchcrossorigin完整优化策略请参阅 PERFORMANCE.md。调试请参阅 COMMON_PROBLEMS.md。

关于恒美微站

恒美微站专注于为个体商户、工作室提供极简自助建站服务,让每个人都能轻松拥有专业网站。

快速链接

  • 关于我们
  • 建站服务
  • 主题模板
  • 案例展示
  • 资讯中心

服务项目

  • 可视化建站
  • 拖拽编辑
  • 主题定制
  • SEO 优化
  • 网站托管

联系方式

  • 📍 地址:北京市朝阳区建国路 88 号
  • 📞 电话:400-888-8888
  • ✉️ 邮箱:info@hmyw.cn
  • 🕐 时间:周一至周日 9:00-18:00

© 2024 恒美微站 hmyw.cn 版权所有 | 京 ICP 备 12345678 号