A tiny three.js website starter that mounts a minimal scene with a rotating cube into a DOM element.
Installation
npm install @codedev168/tiny-three-site threeUsage
<!doctype html><html><head><metacharset="utf-8" /><title>tiny-three-site demo</title><style>body,html,#app { width:100%; height:100%; margin:0; }
</style></head><body><divid="app"></div><scripttype="module">importcreateTinyThreeSitefrom'@codedev168/tiny-three-site';constcontainer=document.getElementById('app');if(container){createTinyThreeSite(container,{animate: true});}</script></body></html>API
- createTinyThreeSite(container: HTMLElement, opts?: TinyThreeOptions)
- returns an object with scene, camera, renderer, cube, stop(), resize(w,h)
License: MIT