Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/webxr-javascript-workshop/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"README.md": true,
"public": true,
"download-toolbar.js": true
}
},
"terminal.integrated.cwd": "${workspaceFolder}/project"
}
},
"codespaces": {
Expand Down
2 changes: 1 addition & 1 deletion sources/webxr-javascript-workshop/.astro/data-store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sources/webxr-javascript-workshop/.astro/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1775761538082
"lastUpdateCheck": 1784923264156
}
}
6 changes: 6 additions & 0 deletions sources/webxr-javascript-workshop/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"astro-build.astro-vscode",
"ms-vscode.live-server"
]
}
21 changes: 21 additions & 0 deletions sources/webxr-javascript-workshop/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Tutorial Editor",
"type": "shell",
"command": "npm install && npm run dev",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
33 changes: 33 additions & 0 deletions sources/webxr-javascript-workshop/project/export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Ensure execution stops if a step fails
set -e

echo "========================================="
echo " 📦 Exporting Your Workshop Project "
echo "========================================="

# 1. Initialize a clean, local repository
echo "Initializing a brand new git tree..."
git init -b main

# 2. Stage and commit all target workshop files
echo "Staging files..."
git add .
git commit -m "Initial commit: Completed Vonage Voice API Workshop"

# 3. Use GitHub CLI for an elegant, interactive push
echo ""
echo "Let's upload this to your personal GitHub profile."
echo "Follow the prompts below to authenticate and name your new repository."
echo "--------------------------------------------------"

# 'gh repo create' natively prompts the user if they want to create a repo from the current folder,
# names it, sets visibility, creates it on GitHub, and adds/pushes the remote automatically!
gh repo create --source=. --remote=origin --push

echo ""
echo "========================================="
echo " 🎉 SUCCESS! Your project is safely on GitHub."
echo "========================================="

7 changes: 4 additions & 3 deletions sources/webxr-javascript-workshop/project/pages/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>XR Blocks with Call Answering</title>
Expand Down Expand Up @@ -27,7 +27,8 @@
"lit": "https://cdn.jsdelivr.net/gh/lit/dist@3/core/lit-core.min.js",
"lit/": "https://esm.run/lit@3/",
"xrblocks": "https://cdn.jsdelivr.net/gh/google/xrblocks@build/xrblocks.js",
"xrblocks/addons/": "https://cdn.jsdelivr.net/gh/google/xrblocks@build/addons/"
"xrblocks/addons/": "https://cdn.jsdelivr.net/gh/google/xrblocks@build/addons/",
"lipsync": "https://cdn.jsdelivr.net/gh/google/xrblocks@build/addons/lipsync/index.js"
}
}
</script>
Expand All @@ -40,4 +41,4 @@
></div>
<script type="module" src="./main.js"></script>
</body>
</html>
</html>
61 changes: 40 additions & 21 deletions sources/webxr-javascript-workshop/project/static/VonageAudioCall.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
import * as THREE from 'three';
import * as xb from 'xrblocks';
import { LipsyncMouth } from 'lipsync';
import { Keyboard } from 'xrblocks/addons/virtualkeyboard/Keyboard.js';

export class VonageAudioCall extends xb.Script {
// ⌄⌄⌄ Set Quick Replies ⌄⌄⌄

export class VonageAudioCall extends xb.Script {
// ⌄⌄⌄ Create constructor ⌄⌄⌄

// ⌄⌄⌄ Create call panel ⌄⌄⌄

// ⌄⌄⌄ Update call controls ⌄⌄⌄

// ⌄⌄⌄ Remove call panel ⌄⌄⌄

// ⌄⌄⌄ Answer call method ⌄⌄⌄

// ⌄⌄⌄ Reject call method ⌄⌄⌄

// ⌄⌄⌄ Hang Up call method ⌄⌄⌄

// ⌄⌄⌄ Set Up Vonage Listeners ⌄⌄⌄

// ⌄⌄⌄ Connect to server to get token ⌄⌄⌄

// ⌄⌄⌄ Initialize ⌄⌄⌄

}
// ⌄⌄⌄ Create 3D Avatar ⌄⌄⌄
// ⌄⌄⌄ Remove 3D Avatar ⌄⌄⌄
// ⌄⌄⌄ Create Call panel ⌄⌄⌄
// ⌄⌄⌄ Update Call controls ⌄⌄⌄
// ⌄⌄⌄ Remove Call panel ⌄⌄⌄
// ⌄⌄⌄ Show Virtual Keyboard ⌄⌄⌄
// ⌄⌄⌄ Hide Virtual Keyboard ⌄⌄⌄
// ⌄⌄⌄ Toggle Virtual Keyboard ⌄⌄⌄
// ⌄⌄⌄ Send Quick Reply ⌄⌄⌄
// ⌄⌄⌄ Send Custom Text ⌄⌄⌄
// ⌄⌄⌄ Create Reply panel ⌄⌄⌄
// ⌄⌄⌄ Remove Reply panel ⌄⌄⌄
// ⌄⌄⌄ Answer call method ⌄⌄⌄
// ⌄⌄⌄ Reject call method ⌄⌄⌄
// ⌄⌄⌄ Hang Up call method ⌄⌄⌄
// ⌄⌄⌄ Set Up Vonage Listeners ⌄⌄⌄
// ⌄⌄⌄ Connect to server to get token ⌄⌄⌄
// ⌄⌄⌄ Initialize ⌄⌄⌄

// the update() method runs per frame. This allows the 3D Avatar to face the user as they move around
update() {
const head = this.puppetHead;
const cam = xb.core?.camera;
if (!head || !cam) return;

cam.getWorldPosition(this._camWorld);
head.getWorldPosition(this._headWorld);

// Mirror the camera through the head centre so local -Z faces the user
const targetX = 2 * this._headWorld.x - this._camWorld.x;
const targetZ = 2 * this._headWorld.z - this._camWorld.z;
// Clamp Y so the avatar only yaws — it won't pitch if you're taller/shorter
head.lookAt(targetX, this._headWorld.y, targetZ);
}
}
Loading