{"_id":"@drdreo/dice-box-threejs","_rev":"7-f1d1b35229bfba3c5580389194bb19d6","name":"@drdreo/dice-box-threejs","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@drdreo/dice-box-threejs","version":"1.0.0","keywords":["3D","dice","roll","roller","javascript","tabletop"],"author":{"name":"Frank Ali"},"license":"MIT","_id":"@drdreo/dice-box-threejs@1.0.0","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"homepage":"https://github.com/drdreo/dice-box-threejs#readme","bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"dist":{"shasum":"0c75c974774d306223d2732216f6220240c65e09","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.0.0.tgz","fileCount":231,"integrity":"sha512-vDcg9Pn8UCeFE+za691OmyF9Frocid/QDswbzo6+i/j/ml1sCVtBZoysKTu9s0Wy66vIpbUdl7wHv69OF9BTbg==","signatures":[{"sig":"MEUCIGrDt5B9993bh3r7bwJtmlVk+h95nTJO/vrX5E+SrjOfAiEAx0nF904BsBooN9QJYe0lO33coGOhWWAZLhgc4ED7UPE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5531278},"main":"./dist/dice-box-threejs.umd.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","module":"./dist/dice-box-threejs.es.js","exports":{".":{"import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./public/sounds/*","./textures/*":"./public/textures/*"},"gitHead":"5f125a2591ae75d13174de16d1652d1ce5636479","private":false,"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"repository":{"url":"git+https://github.com/drdreo/dice-box-threejs.git","type":"git"},"_npmVersion":"10.9.2","description":"A 3D environment for rolling game dice using threejs and cannon-es","directories":{},"_nodeVersion":"22.14.0","dependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","devDependencies":{"vite":"^3.0.8","cannon-es-debugger":"^1.0.0"},"peerDependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dice-box-threejs_1.0.0_1743250876726_0.3917831955122608","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@drdreo/dice-box-threejs","version":"1.0.1","keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"author":{"name":"Frank Ali"},"license":"MIT","_id":"@drdreo/dice-box-threejs@1.0.1","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"homepage":"https://github.com/drdreo/dice-box-threejs#readme","bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"dist":{"shasum":"f479b402c574df929bee264d9eadba97291f7368","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.0.1.tgz","fileCount":119,"integrity":"sha512-06/AWOxIOZXkl/yWEKnejNUm/mQ5H5f2QG9dkwqD8nJPMs31AoW1tbR80zDaIdsUCqE/UzEWDaRJYTNY0Ql4Rw==","signatures":[{"sig":"MEUCIB9YRaMd+ZKIssyXFWc47hu0lfCQTJ9HoF0NUjpwOT05AiEAslyH2OICjBafHMzikVSFttbh1QiRnWH3r4wb9vKx+q8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3401707},"main":"./dist/dice-box-threejs.umd.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"./types/index.d.ts","module":"./dist/dice-box-threejs.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./dist/sounds/*","./textures/*":"./dist/textures/*"},"gitHead":"98e2f62719d5ca5d2e77cdd9d1a8ec43260e00c1","private":false,"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"repository":{"url":"git+https://github.com/drdreo/dice-box-threejs.git","type":"git"},"_npmVersion":"10.9.2","description":"A 3D environment for rolling game dice using threejs and cannon-es","directories":{},"_nodeVersion":"22.14.0","dependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","devDependencies":{"vite":"^3.0.8","typescript":"^5.4.2","@types/three":"^0.143.0","cannon-es-debugger":"^1.0.0"},"peerDependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dice-box-threejs_1.0.1_1743254231418_0.8379426581836278","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@drdreo/dice-box-threejs","version":"1.0.2","keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"author":{"name":"DrDreo"},"license":"MIT","_id":"@drdreo/dice-box-threejs@1.0.2","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"homepage":"https://github.com/drdreo/dice-box-threejs#readme","bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"dist":{"shasum":"03cb27c09bc6643de39d253d9d2d00dfe0be7279","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.0.2.tgz","fileCount":119,"integrity":"sha512-8HvlNKiMW4+GNWiJ6F9UWDDrxQyk1RZks+/RZzo+W3T5cjNJwmm3x3XhM91c5pHFOcfsYJWbvkRhqN32gd2rSw==","signatures":[{"sig":"MEUCID1Fb2lLMiRQwwqm/kU5afDLUdnpH8CKB1X6A9nrrkq3AiEAlBl17QN4jCItsCt4d6yqMvMe7UXqjGKQV/6W7eWy2EE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3401871},"main":"./dist/dice-box-threejs.umd.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"./types/index.d.ts","module":"./dist/dice-box-threejs.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./dist/sounds/*","./textures/*":"./dist/textures/*"},"gitHead":"96e87df79b9d88ee3720132cc337b44a44320b2b","private":false,"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"repository":{"url":"git+https://github.com/drdreo/dice-box-threejs.git","type":"git"},"_npmVersion":"10.9.2","description":"A 3D environment for rolling game dice using threejs and cannon-es","directories":{},"_nodeVersion":"22.14.0","dependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","devDependencies":{"vite":"^3.0.8","typescript":"^5.4.2","@types/three":"^0.143.0","cannon-es-debugger":"^1.0.0"},"peerDependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dice-box-threejs_1.0.2_1743254671129_0.6897569639346055","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@drdreo/dice-box-threejs","version":"1.0.3","keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"author":{"name":"DrDreo"},"license":"MIT","_id":"@drdreo/dice-box-threejs@1.0.3","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"homepage":"https://github.com/drdreo/dice-box-threejs#readme","bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"dist":{"shasum":"df774be6b95bb936518617126ad0922b991d3b8f","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.0.3.tgz","fileCount":119,"integrity":"sha512-p85mo971NERISH7ohA9Y8jFc4MF0Nqcnci/AfmGxjNB6j4FRznv+TqsTvW8WHbfssBzgglyMf1wj7wYOPCMSCQ==","signatures":[{"sig":"MEUCIQDTKCGiNdf6OIX79ZiWZ83JcJI2aOCO4ANWJqiWvx1JXAIgYRhKkipF1BcxNBnmILJsRiTP7EY1mYpIJ+kSJzGsmss=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3405926},"main":"./dist/dice-box-threejs.umd.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"./types/index.d.ts","module":"./dist/dice-box-threejs.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./dist/sounds/*","./textures/*":"./dist/textures/*"},"gitHead":"d48faeefc221ce4b4740c2f4bf2c67a83b97d3e4","private":false,"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"repository":{"url":"git+https://github.com/drdreo/dice-box-threejs.git","type":"git"},"_npmVersion":"10.9.2","description":"A 3D environment for rolling game dice using threejs and cannon-es","directories":{},"_nodeVersion":"22.14.0","dependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","devDependencies":{"vite":"^3.0.8","prettier":"3.5.3","typescript":"^5.4.2","@types/three":"^0.143.0","cannon-es-debugger":"^1.0.0"},"peerDependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dice-box-threejs_1.0.3_1743875650095_0.8741370808596196","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@drdreo/dice-box-threejs","version":"1.0.4","keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"author":{"name":"DrDreo"},"license":"MIT","_id":"@drdreo/dice-box-threejs@1.0.4","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"homepage":"https://github.com/drdreo/dice-box-threejs#readme","bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"dist":{"shasum":"d9106f1a929d7606e3549ded036b81a4868f5d95","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.0.4.tgz","fileCount":119,"integrity":"sha512-naidymAY4ES+wUmx06nlU5FGjXOwSj19dBlCfKCo9h5fyshP2fONcOR5GqNOzwGqC3eMZZdz0wm6AflOHztoBQ==","signatures":[{"sig":"MEQCIC0bNZmjRbPKMJvtSvyUgOLM/E6AX5BVshV62WKGD+teAiAJqykqAG518sXgbS2zdbIPuv2WbIsu+ZpnFirbcmL0Xw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3406017},"main":"./dist/dice-box-threejs.umd.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"./types/index.d.ts","module":"./dist/dice-box-threejs.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./dist/sounds/*","./textures/*":"./dist/textures/*"},"gitHead":"ebbaffc62712e433e012ecd6d63cb47bb93c9395","private":false,"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"repository":{"url":"git+https://github.com/drdreo/dice-box-threejs.git","type":"git"},"_npmVersion":"10.9.2","description":"A 3D environment for rolling game dice using threejs and cannon-es","directories":{},"_nodeVersion":"22.14.0","dependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","devDependencies":{"vite":"^3.0.8","prettier":"3.5.3","typescript":"^5.4.2","@types/three":"^0.143.0","cannon-es-debugger":"^1.0.0"},"peerDependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dice-box-threejs_1.0.4_1743875970574_0.9591949677912013","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@drdreo/dice-box-threejs","version":"1.0.5","keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"author":{"name":"DrDreo"},"license":"MIT","_id":"@drdreo/dice-box-threejs@1.0.5","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"homepage":"https://github.com/drdreo/dice-box-threejs#readme","bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"dist":{"shasum":"72bec1e192f81d62e74c419e0715007ccba7c9fb","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.0.5.tgz","fileCount":119,"integrity":"sha512-93s00hvMYTiGx4MBaNSHQbCmvmuN+NryJZs7RxvvCNFGuybcJaefIJJNA5NVMzgNGDLnZIw4OVVDw6jqFm+P/w==","signatures":[{"sig":"MEUCIFpMzuDSYA/8cXftV9WzthZ/7xQRWKYRluVdBhraKsuTAiEAh+1NYm/NW02Vi/U8//9njW+xC6GYWBLDEDY+/VkFGNo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3406037},"main":"./dist/dice-box-threejs.umd.js","pnpm":{"onlyBuiltDependencies":["esbuild"]},"type":"module","types":"./types/index.d.ts","module":"./dist/dice-box-threejs.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./dist/sounds/*","./textures/*":"./dist/textures/*"},"gitHead":"b02efba3c160c54499ef175be57fe85ef75e62a4","private":false,"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"repository":{"url":"git+https://github.com/drdreo/dice-box-threejs.git","type":"git"},"_npmVersion":"10.9.2","description":"A 3D environment for rolling game dice using threejs and cannon-es","directories":{},"_nodeVersion":"22.14.0","dependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","devDependencies":{"vite":"^3.0.8","prettier":"3.5.3","typescript":"^5.4.2","@types/three":"^0.143.0","cannon-es-debugger":"^1.0.0"},"peerDependencies":{"three":"^0.143.0","cannon-es":"^0.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dice-box-threejs_1.0.5_1743876469321_0.13734086115677124","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@drdreo/dice-box-threejs","author":{"name":"DrDreo"},"description":"A 3D environment for rolling game dice using threejs and cannon-es","private":false,"keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"version":"1.1.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/drdreo/dice-box-threejs.git"},"bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"type":"module","types":"./types/index.d.ts","main":"./dist/dice-box-threejs.umd.js","module":"./dist/dice-box-threejs.es.js","exports":{".":{"types":"./types/index.d.ts","import":"./dist/dice-box-threejs.es.js","require":"./dist/dice-box-threejs.umd.js"},"./sounds/*":"./dist/sounds/*","./textures/*":"./dist/textures/*"},"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"devDependencies":{"@types/three":"^0.176.0","cannon-es-debugger":"^1.0.0","prettier":"3.5.3","typescript":"^5.8.3","vite":"^3.2.11"},"peerDependencies":{"cannon-es":"^0.20.0","three":"^0.176.0"},"packageManager":"pnpm@10.6.2+sha256.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b","pnpm":{"onlyBuiltDependencies":["esbuild"]},"_id":"@drdreo/dice-box-threejs@1.1.0","gitHead":"84e497ae03e70b97c7fb96fa728872d908cf120b","homepage":"https://github.com/drdreo/dice-box-threejs#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-BKQlSKLnNVlqvUQ9GUPah7QXoRiu+NkU75OG6Y4IuyLd1dd00pxjcz20mBbIXA9WITXIc1Y/zHuQ661hugXCdQ==","shasum":"766f671cde8ced85c8b55d4eeb5963513ba79962","tarball":"https://registry.npmjs.org/@drdreo/dice-box-threejs/-/dice-box-threejs-1.1.0.tgz","fileCount":119,"unpackedSize":3549689,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDn14bc496FrUEK2wHjoK+xORaq5OvRBvA7gu4ZtboK0gIgaK5zQpmdeiHjXXlWSfFDHlzRQeASlxZRFAWVGo3sBwc="}]},"_npmUser":{"name":"drdreo","email":"code@drdreo.com"},"directories":{},"maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dice-box-threejs_1.1.0_1746354156029_0.6606273699542236"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-29T12:21:16.661Z","modified":"2025-05-04T10:22:36.406Z","1.0.0":"2025-03-29T12:21:17.055Z","1.0.1":"2025-03-29T13:17:11.614Z","1.0.2":"2025-03-29T13:24:31.383Z","1.0.3":"2025-04-05T17:54:10.415Z","1.0.4":"2025-04-05T17:59:30.778Z","1.0.5":"2025-04-05T18:07:49.641Z","1.1.0":"2025-05-04T10:22:36.240Z"},"bugs":{"url":"https://github.com/drdreo/dice-box-threejs/issues"},"author":{"name":"DrDreo"},"license":"MIT","homepage":"https://github.com/drdreo/dice-box-threejs#readme","keywords":["3D","dice","roll","roller","javascript","tabletop","typescript"],"repository":{"type":"git","url":"git+https://github.com/drdreo/dice-box-threejs.git"},"description":"A 3D environment for rolling game dice using threejs and cannon-es","maintainers":[{"name":"drdreo","email":"code@drdreo.com"}],"readme":"# dice-box-threejs\r\n\r\n3D Dice implemented with ThreeJS and Cannon ES\r\n\r\nBased on [Major's 3D Dice](https://majorvictory.github.io/3DDiceRoller/)\r\n\r\nThe goal of this project is to decouple the UI of Major's 3D Dice and strip down the dice box to just the essentials. Just a module that accepts simple dice notation input and outputs a JSON object when the dice finish rolling.\r\n\r\nWhy another dice roller when you have [@3d-dice/dice-box](https://github.com/3d-dice/dice-box)?\r\nTeall dice had already solved predeterministic rolling, which is a feature some developers really need. Major's 3D dice are based on Teall Dice.\r\n\r\n## Demo\r\n\r\nhttps://codesandbox.io/s/dice-box-threejs-j79h35?file=/src/index.js\r\n\r\n## Install using NPM\r\n\r\n```\r\nnpm install @3d-dice/dice-box-threejs\r\n```\r\n\r\n## Config Options\r\n\r\n```\r\nconst defaultConfig = {\r\n\tframerate: (1/60),\r\n\tsounds: false,\r\n\tvolume: 100,\r\n\tcolor_spotlight: 0xefdfd5,\r\n\tshadows: true,\r\n\ttheme_surface:  \"green-felt\",\r\n\tsound_dieMaterial: 'plastic',\r\n\ttheme_customColorset: null,\r\n\ttheme_colorset: \"white\", // see available colorsets in https://github.com/3d-dice/dice-box-threejs/blob/main/src/const/colorsets.js\r\n\ttheme_texture: \"\", // see available textures in https://github.com/3d-dice/dice-box-threejs/blob/main/src/const/texturelist.js\r\n\ttheme_material: \"glass\", // \"none\" | \"metal\" | \"wood\" | \"glass\" | \"plastic\"\r\n\tgravity_multiplier: 400,\r\n\tlight_intensity: 0.7,\r\n\tbaseScale: 100,\r\n\tstrength: 1, // toss strength of dice\r\n\tonRollComplete: () => {},\r\n\tenableDiceSelection: false, // Enable hover and click detection on dice\r\n\tonDiceHover: () => {}, // Callback when hovering over a die\r\n\tonDiceClick: () => {} // Callback when clicking a die\r\n}\r\n```\r\n\r\n## Getting Results\r\n\r\n### There are three ways to get results\r\n\r\n1. You can define an `onRollComplete` callback function when creating the Dice Box\r\n\r\n```\r\nconst Box = new DiceBox(\"#scene-container\",{\r\n  onRollComplete: (results) => {\r\n    console.log(`I've got results :>> `, results);\r\n  }\r\n});\r\n```\r\n\r\n2. You can listen for the custom event that is triggered when results are ready\r\n\r\n```\r\ndocument.addEventListener(\"rollComplete\",(e => {\r\n  console.log(`I've got custom event results :>> `, e.detail);\r\n}))\r\n```\r\n\r\n3. You can await the results from the `roll` method. Just be sure the function this call is in is `async`\r\n\r\n```\r\nsetTimeout(async () => {\r\n  const result = await Box.roll(\"6d6\")\r\n  console.log('result :>> ', result);\r\n}, 1000);\r\n```\r\n\r\n## Dice Selection\r\n\r\nYou can enable hover and click detection on dice by setting `enableDiceSelection: true` in the config. This will:\r\n\r\n- Emit events when hovering over and clicking dice\r\n- Allow you to implement your own hover effects and click behaviors\r\n\r\n### Using Callbacks\r\n\r\n```\r\nconst Box = new DiceBox(\"#scene-container\", {\r\n  enableDiceSelection: true,\r\n  onDiceHover: (diceInfo) => {\r\n    console.log('Hovering over dice:', diceInfo);\r\n  },\r\n  onDiceClick: (diceInfo) => {\r\n    console.log('Clicked dice:', diceInfo);\r\n  }\r\n});\r\n```\r\n\r\n### Using Events\r\n\r\n```\r\ndocument.addEventListener(\"diceHover\", (e => {\r\n  console.log('Hovering over dice:', e.detail);\r\n}));\r\n\r\ndocument.addEventListener(\"diceClick\", (e => {\r\n  console.log('Clicked dice:', e.detail);\r\n}));\r\n```\r\n\r\n### Implementing Custom Hover Effects\r\n\r\nYou can implement your own hover effects in several ways:\r\n\r\n1. Using HTML overlays:\r\n\r\n```css\r\n/*Add this CSS to your stylesheet*/\r\n.dice-hover-overlay {\r\n    position: absolute;\r\n    pointer-events: none;\r\n    transform: translate(-50%, -50%); /* Center the overlay on the dice */\r\n    transition: all 0.2s ease;\r\n    border: 2px solid yellow;\r\n    border-radius: 50%;\r\n}\r\n\r\n/*Add this to your container element*/\r\n#scene-container {\r\n    position: relative; /* Required for absolute positioning of overlay */\r\n    overflow: hidden;\r\n}\r\n```\r\n\r\n```js\r\n// JavaScript for handling hover events\r\ndocument.addEventListener(\"diceHover\", (e => {\r\n    const diceInfo = e.detail;\r\n    if (diceInfo) {\r\n        // Create or update an HTML overlay for the hovered die\r\n        let overlay = document.querySelector('.dice-hover-overlay');\r\n        if (!overlay) {\r\n            overlay = document.createElement('div');\r\n            overlay.className = 'dice-hover-overlay';\r\n            document.querySelector('#scene-container').appendChild(overlay);\r\n        }\r\n\r\n        // Position the overlay using the screen coordinates\r\n        overlay.style.left = `${diceInfo.screenPosition.x}px`;\r\n        overlay.style.top = `${diceInfo.screenPosition.y}px`;\r\n\r\n        // Scale the overlay based on the dice size\r\n        const size = diceInfo.scale * 100; // Adjust multiplier as needed\r\n        overlay.style.width = `${size}px`;\r\n        overlay.style.height = `${size}px`;\r\n    } else {\r\n        // Remove hover effect when not hovering\r\n        const overlay = document.querySelector('.dice-hover-overlay');\r\n        if (overlay) overlay.remove();\r\n    }\r\n}));\r\n```\r\n\r\n2. Using Three.js effects:\r\n\r\n```javascript\r\ndocument.addEventListener(\"diceHover\", (e) => {\r\n    const diceInfo = e.detail;\r\n    if (diceInfo) {\r\n        // Apply Three.js effects using the 3D position\r\n        // Example: Create a ring around the dice\r\n        const ringGeometry = new THREE.RingGeometry(diceInfo.scale, diceInfo.scale * 1.2, 32);\r\n        const ringMaterial = new THREE.MeshBasicMaterial({\r\n            color: 0xffff00,\r\n            transparent: true,\r\n            opacity: 0.5,\r\n            side: THREE.DoubleSide\r\n        });\r\n        const ring = new THREE.Mesh(ringGeometry, ringMaterial);\r\n        ring.position.set(diceInfo.position.x, diceInfo.position.y, diceInfo.position.z);\r\n        scene.add(ring);\r\n\r\n        // Store reference to remove later\r\n        ring.userData.isHoverRing = true;\r\n    } else {\r\n        // Remove effects\r\n        scene.children.forEach((child) => {\r\n            if (child.userData.isHoverRing) {\r\n                scene.remove(child);\r\n            }\r\n        });\r\n    }\r\n});\r\n```\r\n\r\nThe dice info object contains:\r\n\r\n- `type`: The type of die (e.g., \"d6\")\r\n- `sides`: Number of sides\r\n- `id`: Index of the die in the current roll\r\n- `value`: Current value showing\r\n- `reason`: How the value was determined (\"rolled\", \"forced\", \"reroll\", \"remove\")\r\n- `position`: 3D position of the die in world space {x, y, z}\r\n- `screenPosition`: 2D position of the die projected onto the screen {x, y} (relative to container)\r\n- `scale`: Scale of the die (useful for sizing indicators)\r\n\r\nNote: When using HTML overlays, make sure your container element has `position: relative` set, and the overlay uses `transform: translate(-50%, -50%)` to center it on the dice. The `screenPosition` coordinates are relative to the container element.\r\n\r\n## Predetermined Outcomes\r\n\r\nAs mentioned previously, this project was forked for it's predeterministic rolling capability. The notation to roll your predetermined outcomes looks like this:\r\n\r\n```\r\nBox.roll(\"6d6@4,4,4,4,4,4\") // rolls six dice that will land on 4's\r\n```\r\n\r\n## Notes\r\n\r\nIn order to use textures or sounds, you will need to manually copy the assets out of the `./public` folder and into your static assets folder where you're building your app.\r\n\r\n### Development\r\n\r\n#### Publish\r\n\r\n1. Update the version in `package.json`\r\n3. Run `npm publish` to publish the package to npm\r\n","readmeFilename":"README.md"}