From 485194ef48cd758a10f671d8bc951d5fa76c3742 Mon Sep 17 00:00:00 2001 From: mawani <44065097+parkmawani@users.noreply.github.com> Date: Sun, 31 Mar 2024 16:28:10 +0900 Subject: [PATCH] Add files via upload --- scripts/background.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/background.js diff --git a/scripts/background.js b/scripts/background.js new file mode 100644 index 00000000..c7b2c1b0 --- /dev/null +++ b/scripts/background.js @@ -0,0 +1,10 @@ +import { Bokeh1Background } from 'https://cdn.jsdelivr.net/npm/threejs-components@0.0.2/build/backgrounds/bokeh1.cdn.min.js' + +const bokeh1Background = Bokeh1Background(document.getElementById('webgl-canvas')) +bokeh1Background.loadMap('https://cdn.jsdelivr.net/npm/threejs-components@0.0.2/build/assets/bokeh-particles2.png') +bokeh1Background.setColors([0x6d4862, 0xfd826c, 0x22ccc1]) + +document.body.addEventListener('click', () => { + // bokeh1Background.setBackgroundColor(0xffffff * Math.random()) + bokeh1Background.setColors([0xffffff * Math.random(), 0xffffff * Math.random(), 0xffffff * Math.random()]) +}) \ No newline at end of file