npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xb-threejs-sheif-single

v1.0.2

Published

一个基于Three.js的轻量级3D模型查看器,支持GLTF格式,提供简单的模型加载、动画播放和场景控制功能。

Readme

xb-threejs-sheif-single

一个基于Three.js的轻量级3D模型展示组件,支持GLTF/GLB格式模型的加载、展示和动画播放。

特性

  • 🚀 基于Three.js开发,提供流畅的3D模型展示体验
  • 💡 支持GLTF/GLB格式模型的加载和展示
  • 🎮 内置轨道控制器,支持模型视角的自由调整
  • 🎭 支持模型动画的自动播放
  • 📱 响应式设计,自动适应容器尺寸变化
  • 🎨 支持透明背景,易于与其他UI元素集成

安装

npm install xb-threejs-sheif-single

使用方法

import { init, modelPathstate, allDestroyed } from 'xb-threejs-sheif-single';

// 配置参数
const props = {
  cameraPosition: { x: 0, y: 0, z: 5 },  // 相机位置
  modelPath: 'path/to/your/model.glb',     // 模型路径
  scale: 1,                                // 模型缩放
  position: { x: 0, y: 0, z: 0 }          // 模型位置
};

// 初始化
const container = document.getElementById('container');
init(props, container);

// 切换模型
modelPathstate(newPath, oldPath, props);

// 销毁实例
allDestroyed();

API

init(props: propsClass, container: HTMLElement)

初始化3D场景和模型。

参数:

  • props: 配置对象
    • cameraPosition: 相机位置 {x, y, z}
    • modelPath: 模型文件路径
    • scale: 模型缩放比例
    • position: 模型位置 {x, y, z}
  • container: 容器DOM元素

modelPathstate(newPath: string, oldPath: string, props: propsClass)

切换显示的3D模型。

参数:

  • newPath: 新模型路径
  • oldPath: 旧模型路径
  • props: 配置对象

allDestroyed()

销毁3D场景和清理资源。

技术栈

  • Three.js: ^0.174.0
  • TypeScript: ^5.8.2

特别说明

  • 组件会自动处理窗口大小变化,无需手动调整
  • 支持模型动画的自动播放功能
  • 内置环境光和平行光源,确保模型正确显示
  • 支持透明背景,方便与其他UI元素叠加

许可证

ISC License