1st commit

This commit is contained in:
Leon van Kammen 2023-11-01 11:21:41 +01:00
parent 9a33364975
commit 18fc36e83d
4 changed files with 65 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
webxros.com

9
README.md Normal file
View file

@ -0,0 +1,9 @@
# WebXROS
<table id="pixel_canvas"><tr><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td></tr><tr><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(255, 255, 255);"></td><td style="background-color: rgb(255, 255, 255);"></td><td style="background-color: rgb(255, 255, 255);"></td><td style="background-color: rgb(255, 255, 255);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td></tr><tr><td style="background-color: rgb(0, 0, 0);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(255, 255, 255);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(204, 128, 255);"></td><td style="background-color: rgb(0, 0, 0);"></td></tr><tr><td style="background-color: rgb(0, 0, 0);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(255, 255, 255);"></td><td style="background-color: rgb(255, 255, 255);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td></tr><tr><td style="background-color: rgb(0, 0, 0);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(204, 128, 255);"></td><td style="background-color: rgb(0, 0, 0);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td></tr><tr><td style="background-color: rgb(0, 0, 0);"></td><td></td><td></td><td style="background-color: rgb(255, 255, 255);"></td><td style="background-color: rgb(255, 255, 255);"></td><td></td><td style="background-color: rgb(0, 0, 0);"></td></tr><tr><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td><td style="background-color: rgb(0, 0, 0);"></td></tr></table>
# Install
Surf to the public [webinstance](https://) or download the [standalone binary](https://) in the releases section
> <b>developers:</b> run `./make dev` (spins up a [redbean.com](https://redbean.dev) https-server)

35
make Executable file
View file

@ -0,0 +1,35 @@
#!/bin/sh
REDBEAN_VERSION=https://redbean.dev/redbean-2.2.com
APP=webxros
export PATH=$PATH:.
silent(){ "$@" 1>/dev/null 2>/dev/null; }
install(){
echo "[v] checking dependencies "
test -f ${APP}.com || {
wget "$REDBEAN_VERSION" -O ${APP}.com
chmod +x ${APP}.com
}
standalone
}
standalone(){
test -f ${APP}.com || install
cd src
set -x
zip -r ../${APP}.com *
ls -lah ../${APP}.com
}
dev(){
cd /tmp
test -f redbean.com || wget "$REDBEAN_VERSION" -O redbean.com && chmod 755 redbean.com
test -f cert.pem || openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
cd -
cd "$dir"
/tmp/redbean.com -c 0 -C /tmp/cert.pem -K /tmp/key.pem -D src
}
test -z $1 && install
test -z $1 || "$@"

20
src/index.html Normal file
View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebXRos</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/aframe-blink-controls/dist/aframe-blink-controls.min.js"></script>
</head>
<body>
<a-scene light="defaultLightsEnabled: false">
<a-entity id="player" wasd-controls look-controls>
<a-entity id="left-hand" laser-controls="hand: left" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: #floor"></a-entity>
<a-entity id="right-hand" laser-controls="hand: right" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: #floor"></a-entity>
<a-entity camera="fov:90"position="0 1.6 0" id="camera"></a-entity>
</a-entity>
<a-plane id="floor" position="0 0 0" rotation="-90 0 0" width="100" height="100" material="wireframe:true"></a-plane>
</a-scene>
</body>
</html>