summaryrefslogtreecommitdiff
path: root/public/js/components/player-info.js
diff options
context:
space:
mode:
authorskylar <me@casper>2026-11-01 05:43:24 -0800
committerskylar <me@casper>2026-11-01 05:43:24 -0800
commite69ad01e700e80fa959dfee08cd556ca0d777ffd (patch)
tree645fc9db2142e87a5ef302733a77ba2fec848d88 /public/js/components/player-info.js
Yesod: self-hosted WebXR rooms
Start a room in a world and hang out in VR from the headset's browser: A-Frame + Networked-A-Frame over EasyRTC, with a coturn relay that can hide everyone's IP address. Ships with the Campfire, Temple, Cabin, Balcony and Test room worlds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'public/js/components/player-info.js')
-rw-r--r--public/js/components/player-info.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/public/js/components/player-info.js b/public/js/components/player-info.js
new file mode 100644
index 0000000..6110756
--- /dev/null
+++ b/public/js/components/player-info.js
@@ -0,0 +1,16 @@
+/* global AFRAME */
+// Who someone is. Lives on each person's rig and is synced by Networked-A-Frame,
+// so remote copies fire 'player-info-changed' whenever the owner updates it.
+AFRAME.registerComponent('player-info', {
+ schema: {
+ name: { default: '' },
+ color: { type: 'color', default: '#ffb36b' },
+ avatar: { default: '' },
+ muted: { default: false },
+ seat: { type: 'int', default: -1 }, // index into the campsite's seats, or -1 standing
+ },
+
+ update() {
+ this.el.emit('player-info-changed', this.data, false);
+ },
+});