Skip to content

Commit b3ec094

Browse files
committed
Clean up examples
1 parent 695fffe commit b3ec094

File tree

13 files changed

+2282
-35
lines changed

13 files changed

+2282
-35
lines changed

audio-context/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<title>Hyperbeam AudioContext example</title>
55
</head>
6+
67
<body>
78
<div>
89
<div style="font-family: sans-serif">
@@ -23,12 +24,13 @@
2324
<script type="module">
2425
import Hyperbeam from "https://unpkg.com/@hyperbeam/web@latest/dist/index.js";
2526

27+
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
28+
let source;
29+
const gainNode = audioCtx.createGain();
30+
const noiseNode = brownNoise(audioCtx);
31+
const reverbNode = reverb(audioCtx, 4, 4);
32+
2633
async function main() {
27-
const audioCtx = new (window.AudioContext ||
28-
window.webkitAudioContext)();
29-
const gainNode = audioCtx.createGain();
30-
const noiseNode = brownNoise(audioCtx);
31-
const reverbNode = reverb(audioCtx, 2, 4);
3234
const resp = await fetch("/computer");
3335
const data = await resp.json();
3436
const hb = await Hyperbeam(cloudComputerDiv, data.embed_url, {

audio-context/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"keywords": [],
1010
"author": "",
11-
"license": "ISC",
11+
"license": "MIT",
1212
"dependencies": {
1313
"axios": "^1.1.3",
1414
"express": "^4.18.2"

chrome-extension/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"start": "node server.js",
9-
"build": "cd ./extension/ && zip -r ../extension.zip .",
9+
"build": "cross-zip ./extension ./extension.zip",
1010
"postinstall": "npm run build"
1111
},
1212
"keywords": [],
1313
"author": "",
1414
"license": "MIT",
1515
"dependencies": {
1616
"axios": "^1.1.2",
17+
"cross-zip-cli": "^1.0.0",
1718
"express": "^4.18.2",
1819
"form-data": "^4.0.0"
1920
}

multicursor/index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
width: 1280px;
99
height: 720px;
1010
}
11+
1112
.cursor {
1213
position: absolute;
1314
left: 0;
@@ -18,16 +19,19 @@
1819
z-index: 1;
1920
transition: opacity 1s ease;
2021
}
22+
2123
.icon {
2224
width: 32px;
2325
height: 32px;
2426
translate: -8px -8px;
2527
}
28+
2629
.hidden {
2730
display: none;
2831
}
2932
</style>
3033
</head>
34+
3135
<body>
3236
<div id="hb-computer-container"></div>
3337
<div class="cursor hidden">
@@ -53,14 +57,14 @@
5357
<script type="module">
5458
import Hyperbeam from "https://unpkg.com/@hyperbeam/web@latest/dist/index.js";
5559

60+
const cursorNode = document.querySelector(".cursor");
61+
const container = document.getElementById("hb-computer-container");
62+
const rect = container.getBoundingClientRect();
63+
const cursors = new Map();
64+
5665
async function main() {
5766
const resp = await fetch("/computer");
5867
const data = await resp.json();
59-
const cursorNode = document.querySelector(".cursor");
60-
const container = document.getElementById("hb-computer-container");
61-
const rect = container.getBoundingClientRect();
62-
const cursors = new Map();
63-
6468
const hb = await Hyperbeam(container, data.embed_url, {
6569
onCursor({ x, y, userId }) {
6670
if (!cursors.has(userId)) {

multicursor/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ app.get("/computer", async (req, res) => {
2323
const hbConfig = {
2424
hide_cursor: true,
2525
default_roles: roles,
26+
ublock: true,
2627
timeout: {
2728
offline: 10,
2829
},

0 commit comments

Comments
 (0)