added aframe

This commit is contained in:
Leon van Kammen 2025-11-10 21:17:21 +01:00
parent 520b8cd2c5
commit 73f184f8a3
3 changed files with 86 additions and 42 deletions

51
aframe.html Normal file
View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{
background: #555;
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
}
img#btn_play:hover {
opacity: 1.0;
}
img#btn_play {
position: fixed;
top: 50%;
left: 50%;
width:30%;
max-width:400px;
transform: translate(-50%,-50%);
cursor: pointer;
opacity: 0.6;
transition: 0.3s;
z-index: 999;
}
</style>
</head>
<body>
<img id="btn_play" src="lib/assets/play.svg"/>
<a-scene>
<a-entity id="scene" animation-mixer_disabled gltf-model></a-entity>
<a-entity id="player" movement-controls touch-controls="axis:y" wasd-controls="fly:true" look-controls="magicWindowTrackingEnabled:true">
<a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity>
<a-entity id="left-hand" hand-tracking-grab-controls="hand:left;modelColor:#cccccc" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor"></a-entity>
<a-entity id="right-hand" hand-tracking-grab-controls="hand:right;modelColor:#cccccc" laser-controls="hand: right" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor"></a-entity>
</a-entity>
</a-scene>
<script type="module" src="lib/xrforge/index.js"></script>
</body>
</html>

View file

@ -3,8 +3,10 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "echo -e \"hint: pass bun args via: BARG='--minify' npm run build'\n\n\" && rm dist/xrforge/*.js || true && BARG=$BARG npm run build-xrforge", "build": "echo -e \"hint: pass bun args via: BARG='--minify' npm run build'\n\n\" && rm dist/xrforge/*.js || true && BARG=$BARG npm run build-xrforge; BARG=$BARG npm run build-aframe",
"build-xrforge": "mkdir -p dist/xrforge && bun build ${BARG} --outdir=dist/xrforge xrforge.html && monolith dist/xrforge/xrforge.html --output dist/xrforge.html && sed -i 's|data:module|data:text/javascript;|g' dist/xrforge.html # https://github.com/Y2Z/monolith/issues/474 " "build-xrforge": "test -d node_modules/janusweb/build || { cd node_modules/janusweb && ln -s ../. node_modules && utils/init.sh 2>&1 | grep -Ev '^npm ' && npm run build; }; bun build ${BARG} --outdir=dist/xrforge -e janusweb.css -e janusweb.js -e manifest.json xrforge.html && cp -r node_modules/janusweb/build/1.5.56/{media,*.js,*.json,*.css} dist/xrforge/. && monolith dist/xrforge/xrforge.html --output dist/xrforge.html",
"build-aframe": "mkdir -p dist/aframe && bun build ${BARG} --outdir=dist/aframe aframe.html && monolith dist/aframe/aframe.html --output dist/aframe.html && sed -i 's|data:module|data:text/javascript;|g' dist/aframe.html # https://github.com/Y2Z/monolith/issues/474 ",
"postinstall":""
}, },
"author": "Leon van Kammen", "author": "Leon van Kammen",
"license": "", "license": "",
@ -13,6 +15,7 @@
"@needle-tools/three-animation-pointer": "^1.0.7", "@needle-tools/three-animation-pointer": "^1.0.7",
"@zip.js/zip.js": "^2.8.8", "@zip.js/zip.js": "^2.8.8",
"aframe": "^1.7.1", "aframe": "^1.7.1",
"janusweb": "^1.5.56",
"remotestoragejs": "^2.0.0-beta.8", "remotestoragejs": "^2.0.0-beta.8",
"trystero": "^0.22.0", "trystero": "^0.22.0",
"webdav": "^5.8.0", "webdav": "^5.8.0",

View file

@ -1,51 +1,41 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<style type="text/css"> <title>JanusWeb</title>
<link rel="stylesheet" type="text/css" href="janusweb.css" media="all" />
<link rel="manifest" href="manifest.json">
body{
background: #555;
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
}
img#btn_play:hover { <meta charset="utf-8">
opacity: 1.0; <meta name="viewport" content="initial-scale=1.0, user-scalable=no, maximum-scale=1.0, width=device-width" />
} <meta name="apple-mobile-web-app-capable" content="yes">
img#btn_play { <meta name="theme-color" content="#2f363b">
position: fixed;
top: 50%;
left: 50%;
width:30%;
max-width:400px;
transform: translate(-50%,-50%);
cursor: pointer;
opacity: 0.6;
transition: 0.3s;
z-index: 999;
}
</style>
</head>
<body>
<img id="btn_play" src="lib/assets/play.svg"/>
<a-scene> <meta http-equiv="origin-trial" data-feature="WebVR" data-expires="2017-06-12" content="Avy/Fo2QM5trR+WVHnaVz0t3LVltGxx3yvpSYSCC2oklwuDEYUEK6YdnxYv4p687MJGB61q//htZUvSIZPg93goAAABOeyJvcmlnaW4iOiJodHRwczovL3dlYi5qYW51c3ZyLmNvbTo0NDMiLCJmZWF0dXJlIjoiV2ViVlIiLCJleHBpcnkiOjE0OTczMTIwMDB9">
<a-entity id="scene" animation-mixer_disabled gltf-model></a-entity>
<a-entity id="player" movement-controls touch-controls="axis:y" wasd-controls="fly:true" look-controls="magicWindowTrackingEnabled:true"> <meta name="twitter:card" content="summary_large_image" />
<a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity> <meta name="twitter:site" content="@bai0" />
<a-entity id="left-hand" hand-tracking-grab-controls="hand:left;modelColor:#cccccc" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor"></a-entity> <meta name="twitter:title" content="JanusWeb" />
<a-entity id="right-hand" hand-tracking-grab-controls="hand:right;modelColor:#cccccc" laser-controls="hand: right" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor"></a-entity> <meta name="twitter:description" content="The World Within The Web" />
</a-entity> <meta name="twitter:image" content="https://janusxr.org/backgrounds/wallpapers/generic.png" />
<meta name="twitter:image:alt" content="JanusWeb" />
<meta property="og:app_id" content="1197654320349894" />
<meta property="og:url" content="https://web.janusxr.org/" />
<meta property="og:type" content="website" />
<meta property="og:title" content="JanusWeb" />
<meta property="og:description" content="The World Within The Web" />
<meta property="og:image" content="https://janusxr.com/backgrounds/wallpapers/generic.png" />
</a-scene>
<script type="module" src="lib/xrforge/index.js"></script> <script src="janusweb.js"></script>
</head>
</body> <body>
<janus-viewer src="https://www.janusxr.org/"></janus-viewer>
</body>
</html> </html>