summaryrefslogtreecommitdiff
path: root/client/splash/cloud/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/splash/cloud/index.js')
-rw-r--r--client/splash/cloud/index.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/client/splash/cloud/index.js b/client/splash/cloud/index.js
new file mode 100644
index 00000000..7bbc56c9
--- /dev/null
+++ b/client/splash/cloud/index.js
@@ -0,0 +1,34 @@
+import TextSprite from 'three.textsprite'
+
+import datasetList from './datasetList'
+import { choice } from '../../util'
+
+import { scene } from '../renderer'
+
+export const fontFamily = 'Helvetica, Arial, sans-serif'
+
+export function init() {
+ let sprites = Array.from({ length: Math.min(datasetList.length, 80) }, (t, i) => {
+ const sprite = new TextSprite({
+ textSize: 0.03 + Math.random() * 0.04,
+ redrawInterval: 1,
+ material: {
+ color: choice([ 0xffffff, 0xffffff, 0xffffff, 0xdddde6, 0x888896 ]),
+ },
+ texture: {
+ text: datasetList[i],
+ fontFamily,
+ },
+ })
+ sprite.position
+ .setX(Math.random())
+ .setY(Math.random())
+ .setZ(Math.random())
+ .subScalar(1 / 2)
+ .setLength(1 + Math.random())
+ .multiplyScalar(1)
+ scene.add(sprite)
+ return sprite
+ })
+ return sprites
+}