206 lines
9.8 KiB
HTML
206 lines
9.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Super Saber</title>
|
|
<meta name="description" content="Beat Saber on the VR Web with searchable and playable community songs from Beat Saver.">
|
|
<link rel="shortcut icon" href="assets/img/favicon.png" type="image/x-icon">
|
|
{% if IS_PRODUCTION %}
|
|
<script src="vendor/aframe-master.min.js"></script>
|
|
{% else %}
|
|
<script src="vendor/aframe-master.js"></script>
|
|
{% endif %}
|
|
<script src="build/build.js"></script>
|
|
</head>
|
|
<body>
|
|
<audio id="introSong" src="assets/sounds/introSong.ogg" loop></audio>
|
|
|
|
<a-scene
|
|
mixin="gameoverAnimation fogAnimation"
|
|
bind__beat-loader="challengeId: challenge.id; difficulty: menuSelectedChallenge.difficulty; isPlaying: isPlaying; menuSelectedChallengeId: menuSelectedChallenge.id"
|
|
bind__gameover="isGameOver: isGameOver"
|
|
bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id; isSearching: isSearching"
|
|
bind__overlay="enabled: !isPlaying"
|
|
bind__song="challengeId: challenge.id; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver; isVictory: isVictory"
|
|
bind__song-preview-system="challengeId: challenge.id; isSearching: isSearching; isSongLoading: isSongLoading; selectedChallengeId: menuSelectedChallenge.id"
|
|
animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"
|
|
animation__gameoverfog="property: components.fog.el.object3D.fog.color; type: color; to: #330000; startEvents: gameover; dur: 500; easing: easeInQuad"
|
|
console-shortcuts
|
|
debug-controller
|
|
debug-state
|
|
effect-bloom="strength: 1"
|
|
gpu-preloader
|
|
loading-screen="backgroundColor: #000;"
|
|
overlay="objects: #rightHand, #leftHand, [mixin~='cursorMesh'], .overlay"
|
|
pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 5; container: #beatContainer"
|
|
pool__beat-arrow-red="mixin: arrowRedBeat; size: 10; container: #beatContainer"
|
|
pool__beat-dot-blue="mixin: dotBlueBeat; size: 10; container: #beatContainer"
|
|
pool__beat-dot-red="mixin: dotRedBeat; size: 10; container: #beatContainer"
|
|
pool__beat-mine="mixin: mine; size: 10; container: #beatContainer"
|
|
pool__wall="mixin: wall; size: 10; container: #beatContainer"
|
|
proxy-event__cleargame1="event: gamemenuexit; as: cleargame; to: a-scene"
|
|
proxy-event__cleargame2="event: gamemenurestart; as: cleargame; to: a-scene"
|
|
search
|
|
stage-colors="color: blue"
|
|
fog="color: #a00; density: 0.035; type: exponential"
|
|
vr-mode-ui="enterVRButton: #vrButton">
|
|
|
|
<a-assets timeout="10000">
|
|
{% include './assets.html' %}
|
|
</a-assets>
|
|
|
|
<a-entity id="arrowObjTemplate" obj-model="obj: #arrowObj" visible="false"></a-entity>
|
|
<a-entity id="beatObjTemplate" obj-model="obj: #beatObj" visible="false"></a-entity>
|
|
<a-entity id="dotObjTemplate" obj-model="obj: #dotObj" visible="false"></a-entity>
|
|
<a-entity id="mineObjTemplate" obj-model="obj: #mineObj" visible="false"></a-entity>
|
|
<a-entity id="cursorLaser" obj-model="obj: #laserObj" visible="false"></a-entity>
|
|
|
|
<a-entity id="container">
|
|
<a-entity
|
|
id="beatContainer"
|
|
beat-hit-sound
|
|
bind__pause="isPaused: !isPlaying"
|
|
sound__beathit="poolSize: 12; src: assets/sounds/beatHit.ogg"></a-entity>
|
|
{% include './templates/stage.html' %}
|
|
{% include './templates/loading.html' %}
|
|
{% include './templates/score.html' %}
|
|
{% include './templates/menu.html' %}
|
|
{% include './templates/gameMenu.html' %}
|
|
{% include './templates/victory.html' %}
|
|
</a-entity>
|
|
|
|
<!-- Wrong + miss beat visual indicators. -->
|
|
<a-entity id="badContainer" bind__visible="isPlaying">
|
|
<a-entity id="wrongLeft" mixin='beatWrong'></a-entity>
|
|
<a-entity id="wrongRight" mixin='beatWrong'></a-entity>
|
|
<a-entity id="missLeft" mixin='beatMiss'></a-entity>
|
|
<a-entity id="missRight" mixin='beatMiss'></a-entity>
|
|
</a-entity>
|
|
|
|
<a-entity
|
|
id="saberParticles"
|
|
particleplayer="src: #saberParticlesJSON; pscale: 0.5; loop: false; on: explode; img: #sparkImg; count: 20%; animateScale: true; initialScale: 4 1 1; finalScale: 0.2 0.2 1"></a-entity>
|
|
<a-entity
|
|
id="mineParticles"
|
|
particleplayer="src: #mineParticlesJSON; pscale: 0.5; scale: 1.4; loop: false; on: explode; img: #sparkImg; count: 20%; animateScale: true; initialScale: 3 1 1; finalScale: 0.2 0.2 1"></a-entity>
|
|
|
|
<!-- Player. -->
|
|
<a-mixin
|
|
id="raycaster"
|
|
raycaster="objects: [raycastable]; far: 3; showLine: false"
|
|
line="opacity: 0.75"></a-mixin>
|
|
<a-mixin
|
|
id="cursorMesh"
|
|
material="shader: flat; transparent: true; src: #cursorMeshImg; depthTest: false"
|
|
sub-object="from: #cursorLaser; name: glow"></a-mixin>
|
|
<a-entity id="cameraRig">
|
|
<a-entity id="camera" position="0 1.6 0.5" camera look-controls wasd-controls>
|
|
<a-entity
|
|
id="cameraCollider"
|
|
bind__aabb-collider="enabled: isPlaying"
|
|
aabb-collider="objects: [data-collidable-head]; interval: 50; collideNonVisible: false"
|
|
geometry="primitive: box; width: 0.10; height: 0.10; depth: 0.10"
|
|
proxy-event__wallhitstart="event: hitstart; to: a-scene; as: wallhitstart"
|
|
proxy-event__wallhitend="event: hitend; to: a-scene; as: wallhitend"
|
|
visible="false"></a-entity>
|
|
</a-entity>
|
|
|
|
{% macro saber (hand, otherHand, bladeColor, beamColor) %}
|
|
<a-entity id="{{ hand }}Hand"
|
|
class="saber"
|
|
mixin="raycaster"
|
|
bind__aabb-collider="enabled: isPlaying"
|
|
bind__hand-swapper="enabled: {{ otherHand }}RaycasterActive"
|
|
bind__menu-controls="page: search.page; selectedChallengeId: menuSelectedChallenge.id"
|
|
bind__pauser="enabled: isPlaying"
|
|
bind__raycaster="enabled: {{ hand }}RaycasterActive"
|
|
bind__saber-controls="bladeEnabled: isPlaying; isPaused: isPaused"
|
|
bind__trail="enabled: isPlaying"
|
|
bind-toggle__data-collidable-saber="isPlaying"
|
|
aabb-collider="objects: [data-collidable-saber]; interval: 50; collideNonVisible: false"
|
|
haptics="events: mouseenter; dur: 35; force: 0.075"
|
|
haptics__beat="eventsFrom: #beatContainer; events: beathit{{ hand }}; dur: 80; force: 0.2"
|
|
haptics__draw="events: drawblade; dur: 750; force: 0.025"
|
|
saber-controls="hand: {{ hand }}"
|
|
haptics-saber
|
|
haptics-wall
|
|
thumb-controls
|
|
thumb-controls-debug="enabled: false; hand: {{ hand }}; controllerType: vive-controls"
|
|
trail="color: {{ bladeColor }}; hand: {{ hand }}">
|
|
<a-entity
|
|
id="{{ hand }}Laser"
|
|
bind__visible="menuActive && activeHand === '{{ hand }}'"
|
|
cursor-laser
|
|
geometry="primitive: cylinder; height: 1; radius: 0.005"
|
|
material="color: {{ beamColor }}; shader: flat"
|
|
rotation="-90 0 0"></a-entity>
|
|
|
|
<a-entity class="saberContainer" rotation="90 0 0">
|
|
<a-entity
|
|
class="bladeContainer"
|
|
bind__visible="isPlaying"
|
|
animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"
|
|
scale="0.001 0.001 0.001">
|
|
<a-entity
|
|
class="blade"
|
|
geometry="primitive: box; height: 0.9; depth: 0.02; width: 0.02"
|
|
material="shader: flat; color: {{ bladeColor }}"
|
|
position="0 -0.55 0"></a-entity>
|
|
</a-entity>
|
|
<a-entity
|
|
class="saberHandle"
|
|
geometry="primitive: box; height: 0.2; depth: 0.025; width: 0.025"
|
|
material="shader: flat; color: #151515">
|
|
<a-entity
|
|
class="highlightTop"
|
|
geometry="primitive: box; height: 0.18; depth: 0.005; width: 0.005"
|
|
material="shader: flat; color: {{ bladeColor }}"
|
|
position="0 0 0.0125"></a-entity>
|
|
<a-entity
|
|
class="highlightBottom"
|
|
geometry="primitive: box; height: 0.18; depth: 0.005; width: 0.005"
|
|
material="shader: flat; color: {{ bladeColor }}"
|
|
position="0 0 -0.0125"></a-entity>
|
|
</a-entity>
|
|
</a-entity>
|
|
|
|
<a-entity
|
|
class="fakeGlow"
|
|
fake-glow="color: {{ beamColor }}"
|
|
position="0 0.01 0"
|
|
rotation="90 0 0"
|
|
bind__visible="!isPlaying">
|
|
</a-entity>
|
|
</a-entity>
|
|
|
|
<a-entity
|
|
id="{{ hand }}CursorMesh"
|
|
mixin="cursorMesh"
|
|
bind__cursor-mesh="active: {{ hand }}RaycasterActive"
|
|
cursor-mesh="active: {{ hand }}RaycasterActive; cursorEl: #{{ hand }}Hand"
|
|
material="color: {{ beamColor }}"
|
|
scale="1.3 1.3 1.3"></a-entity>
|
|
{% endmacro %}
|
|
|
|
{{ saber('left', 'right', '#FFA8A8', 'pink') }}
|
|
{{ saber('right', 'left', '#78AAFF', 'cyan') }}
|
|
</a-entity>
|
|
|
|
<a-entity
|
|
id="stepback"
|
|
class="overlay"
|
|
geometry="primitive: plane; width: 0.5; height: 0.25;"
|
|
position="0 1.6 -1.55"
|
|
material="shader: flat; src: #stepbackImg; transparent: true; opacity: 0"></a-entity>
|
|
|
|
{% if not IS_PRODUCTION %}
|
|
<a-entity id="mouseCursor" mixin="raycaster" cursor="rayOrigin: mouse"
|
|
bind__raycaster="enabled: !inVR"></a-entity>
|
|
<a-entity id="mouseCursorMesh" mixin="cursorMesh" cursor-mesh="cursorEl: #mouseCursor"
|
|
bind__cursor-mesh="active: menuActive"></a-entity>
|
|
{% endif %}
|
|
</a-scene>
|
|
|
|
<a id="vrButton" href="#" title="Enter VR / Fullscreen"></a>
|
|
</body>
|
|
</html>
|