2018-09-18 20:08:58 -07:00
<!-- Macro is a templating function. It is rendered into the HTML below with searchResults(). -->
2018-09-18 18:41:45 -07:00
{% macro searchResults () %}
< a-entity id = "searchResultList"
2018-09-20 03:50:28 -07:00
bind-for="for: item; in: searchResultsPage; key: id; template: #searchResultTemplate; updateInPlace: true; pool: 6; delay: 25"
2018-09-18 18:41:45 -07:00
layout="type: box; columns: 1; marginRow: -0.2"
search-result-list
2018-09-19 05:54:05 -07:00
position="0 0.644 0">< / a-entity >
2018-09-18 18:41:45 -07:00
2018-10-05 04:17:33 -07:00
<!-- All search result text merged and spaced out. -->
< a-entity
id="searchSongNameTexts"
mixin="textFont"
bind__text="value: search.songNameTexts"
text="align: left; color: #FAFAFA; wrapCount: 28; lineHeight: 112"
position="0.181 0 0.001">
< / a-entity >
< a-entity
id="searchSongSubNameTexts"
mixin="textFont"
bind__text="value: search.songSubNameTexts"
text="align: left; color: #999; wrapCount: 42; lineHeight: 166"
position="0.181 -0.055 0.001">
< / a-entity >
< a-entity
id="searchSongNameTextSelected"
mixin="textFont"
bind__search-song-name-selected="index: menuSelectedChallenge.index; selectedChallengeId: menuSelectedChallenge.id"
bind__text="value: menuSelectedChallenge.shortSongName"
text="align: left; color: #333; wrapCount: 28"
position="0.181 0 0.004"
search-song-name-selected="anchor: 0.5; offset: -0.2">< / a-entity >
2018-09-18 18:41:45 -07:00
< a-mixin id = "searchPageButton"
2018-09-18 18:48:39 -07:00
animation__mouseenter="property: components.slice9.material.color; type: color; from: #050505; to: #333; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"
animation__mouseleave="property: components.slice9.material.color; type: color; from: #333; to: #050505; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
2018-09-18 18:41:45 -07:00
mixin="slice"
2018-10-04 00:59:26 -07:00
raycaster-target="width: 1; height: 0.32"
2018-09-18 18:41:45 -07:00
slice9="width: 0.5; height: 0.08; padding: 0.03"
text="align: center; wrapCount: 40; zOffset: 0.001">< / a-mixin >
2018-09-19 05:54:05 -07:00
2018-10-04 00:59:26 -07:00
< a-entity
id="searchPrevPage"
mixin="searchPageButton"
bind-toggle__raycastable="search.hasPrev & & menu.active"
raycaster-target="bindToggle: search.hasNext & & menu.active; position: 0 0.08 0"
position="-0.05 0.65 0.01"
proxy-event="event: click; to: a-scene; as: searchprevpage; captureBubbles: true"
bind__visible="search.hasPrev">
2018-09-19 23:29:55 +02:00
< a-entity geometry = "primitive: plane; width: 0.08; height: 0.08" material = "shader: flat; src: #downIconImg; transparent: true" rotation = "0 0 180" position = "0 0 -0.001" > < / a-entity >
< / a-entity >
2018-10-04 00:59:26 -07:00
< a-entity
id="searchNextPage"
mixin="searchPageButton"
raycaster-target="bindToggle: search.hasNext & & menu.active; position: 0 -0.08 0"
position="-0.05 -0.634 0.01"
proxy-event="event: click; to: a-scene; as: searchnextpage; captureBubbles: true"
bind__visible="search.hasNext">
2018-09-19 23:29:55 +02:00
< a-entity geometry = "primitive: plane; width: 0.08; height: 0.08" material = "shader: flat; src: #downIconImg; transparent: true" position = "0 0 -0.001" > < / a-entity >
< / a-entity >
2018-09-19 05:54:05 -07:00
{% endmacro %}
2018-09-18 18:41:45 -07:00
2018-09-19 05:54:05 -07:00
{% raw %}
< template id = "searchResultTemplate" >
< a-entity
class="searchResult"
bind-item__data-id="item.id"
bind-item__song-preview="challengeId: item.id; previewStartTime: item.previewStartTime">
< a-entity
class="searchResultBackground"
active-color
bind-item__active-color="active: menuSelectedChallenge.id === item.id"
bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id"
2018-10-01 16:12:55 -07:00
bind-item__animation__mouseentervisible="enabled: menuSelectedChallenge.id !== item.id"
2018-09-19 05:54:05 -07:00
bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id"
2018-10-01 16:12:55 -07:00
bind-item__animation__mouseleavevisible="enabled: menuSelectedChallenge.id !== item.id"
2018-09-19 05:54:05 -07:00
bind-toggle__raycastable="menu.active"
geometry="primitive: plane; width: 1.1; height: 0.2"
material="shader: flat; color: #067197; transparent: true; opacity: 0.0"
position="0 -0.13 -0.002"
play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"
2018-10-01 16:12:55 -07:00
animation__mouseenter="property: components.material.material.opacity; from: 0.0; to: 1.0; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150; delay: 1"
animation__mouseentervisible="property: visible; from: false; to: true; startEvents: mouseenter; pauseEvents: mouseleave; dur: 1"
animation__mouseleave="property: components.material.material.opacity; from: 1.0; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
animation__mouseleavevisible="property: visible; from: true; to: false; startEvents: mouseleave; pauseEvents: mouseenter; dur: 160"
visible="false">< / a-entity >
2018-09-19 05:54:05 -07:00
< a-entity class = "searchResultContent" position = "0.125 -0.05 0" >
< a-entity
class="searchResultImage"
bind-item__search-result-image="id: item.id"
geometry="primitive: plane; width: 0.2; height: 0.2"
2018-09-20 06:02:57 -07:00
material="shader: flat; color: #223"
2018-09-19 05:54:05 -07:00
position="-0.576 -0.08 0.001">< / a-entity >
2018-09-18 18:41:45 -07:00
< / a-entity >
2018-09-19 05:54:05 -07:00
< / a-entity >
< / template >
{% endraw %}
2018-07-18 20:48:45 +02:00
2018-09-18 18:50:36 -07:00
<!-- Menu container begins here. -->
2018-09-19 23:29:55 +02:00
< a-entity id = "menu" bind__visible = "menu.active" position = "0 1.6 -2" >
2018-10-04 01:54:25 -07:00
< a-entity id = "menuchallengeunselectground"
2018-07-26 02:32:15 +02:00
mixin="slice"
2018-09-18 18:41:45 -07:00
slice9="width: 2.5; height: 1.4"
2018-09-20 05:56:56 -07:00
position="0 0 -0.005"
raycastable>< / a-entity >
2018-07-20 21:16:50 +02:00
2018-09-18 18:41:45 -07:00
< a-entity id = "searchResultsContainer" position = "0 0 0.001"
2018-10-04 01:54:25 -07:00
class="menuAnimation"
animation__menuleft="property: object3D.position.x; to: -0.59; dur: 200; easing: easeOutCubic; startEvents: menuchallengeselect"
animation__menuright="property: object3D.position.x; to: 0; dur: 200; easing: easeOutCubic; startEvents: menuchallengeunselect">
2018-09-18 18:41:45 -07:00
2018-09-19 23:29:55 +02:00
< a-entity id = "divisorA"
2018-10-04 01:54:25 -07:00
class="menuAnimation"
2018-09-18 18:41:45 -07:00
position="0.566 0 -0.0025"
2018-09-19 23:29:55 +02:00
geometry="primitive:plane; height:1.17; width:0.005"
2018-10-04 01:54:25 -07:00
material="shader: flat; color: #fff; transparent: true; opacity: 0">< / a-entity >
2018-09-18 18:41:45 -07:00
{{ searchResults() }}
< / a-entity >
2018-10-04 01:54:25 -07:00
< a-entity id = "menuDifficultiesGroup" position = "0.195 0.18 0" >
2018-09-20 00:54:44 -07:00
< a-entity id = "divisorB"
2018-10-04 01:54:25 -07:00
class="menuAnimation"
2018-09-20 00:54:44 -07:00
position="0.218 -0.179 -0.003"
geometry="primitive: plane; height: 1.17; width: 0.005"
2018-10-04 01:54:25 -07:00
material="shader: flat; color: #fff; transparent: true; opacity: 0.0">< / a-entity >
2018-09-19 23:29:55 +02:00
2018-09-20 06:09:44 -07:00
<!-- Top - aligned. TODO: Smart - centering. -->
2018-10-01 16:26:43 -07:00
<!-- Uses bind - for and bind - item to render difficulties. -->
2018-09-19 23:29:55 +02:00
< a-entity id = "menuDifficulties"
2018-09-20 00:54:44 -07:00
bind-for="for: item; in: menuDifficulties; updateInPlace: true; pool: 5"
2018-09-19 23:29:55 +02:00
bind__visible="!!menuSelectedChallenge.id"
layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-bind-for-key"
2018-09-21 00:00:58 -07:00
position="0 0.34 0"
2018-09-19 23:29:55 +02:00
menu-difficulty-select>
{% raw %}
2018-09-18 18:41:45 -07:00
< template >
2018-09-20 00:54:44 -07:00
<!-- Item is a string representing the difficulty. -->
< a-entity class = "difficultyOption" bind-item__data-difficulty = "item" >
2018-09-18 18:41:45 -07:00
< a-entity class = "difficultyBackground"
2018-09-20 00:54:44 -07:00
bind-item__active-color="active: menuSelectedChallenge.difficulty === item"
bind-item__animation__mouseenter="enabled: menuSelectedChallenge.difficulty !== item"
bind-item__animation__mouseleave="enabled: menuSelectedChallenge.difficulty !== item"
2018-10-01 16:26:43 -07:00
bind-item__animation__mouseentervisible="enabled: menuSelectedChallenge.difficulty !== item"
bind-item__animation__mouseleavevisible="enabled: menuSelectedChallenge.difficulty !== item"
2018-09-20 00:54:44 -07:00
bind-toggle__raycastable="menu.active & & !!menuSelectedChallenge.id & & menuSelectedChallenge.difficulty !== item"
2018-09-18 18:41:45 -07:00
geometry="primitive: plane; width: 0.4; height: 0.2"
2018-07-26 02:32:15 +02:00
material="shader: flat; color: #067197; transparent: true; opacity: 0.0"
2018-09-18 18:41:45 -07:00
position="0 -0.005 0"
2018-07-21 10:21:30 +02:00
play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"
2018-09-18 18:43:13 -07:00
animation__mouseenter="property: components.material.material.opacity; to: 1.0; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"
2018-10-01 16:26:43 -07:00
animation__mouseentervisible="property: visible; from: false; to: true; startEvents: mouseenter; pauseEvents: mouseleave; dur: 1"
animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
animation__mouseleavevisible="property: visible; from: true; to: false; startEvents: mouseleave; pauseEvents: mouseenter; dur: 160">< / a-entity >
2018-09-20 00:54:44 -07:00
< a-entity class = "difficultyText" mixin = "textFont" bind-item__active-text-color = "active: menuSelectedChallenge.difficulty === item" active-text-color = "color: #333" bind-item__text-uppercase = "value: item" text = "wrapCount: 28; align: center; color: #FAFAFA" position = "0 -0.057 0.001" > < / a-entity >
2018-07-20 20:47:42 +02:00
< / a-entity >
< / template >
{% endraw %}
2018-09-19 23:29:55 +02:00
< / a-entity >
2018-09-18 18:41:45 -07:00
< / a-entity >
2018-09-18 17:12:43 -07:00
2018-09-20 01:09:16 -07:00
<!-- Selected challenge info. -->
< a-entity
id="menuSelectedChallengePanel"
bind__visible="!!menuSelectedChallenge.id"
position="0.82 0 0.001">
2018-09-18 18:41:45 -07:00
< a-entity id = "menuSelectedChallengeImage"
2018-09-20 01:09:16 -07:00
bind__menu-selected-challenge-image="selectedChallengeId: menuSelectedChallenge.id"
2018-09-19 23:29:55 +02:00
geometry="primitive: plane; height: 0.3; width: 0.3"
2018-09-18 18:41:45 -07:00
material="shader: flat"
2018-09-19 23:29:55 +02:00
position="0 0.382 0">< / a-entity >
< a-entity id = "menuSelectedChallengeInfo" >
< a-entity class = "menuSelectedChallengeSongAuthor" position = "0 0.058 0"
mixin="textFont" text="wrapCount: 40; align: center; color: #FF185B" bind__text="value: menuSelectedChallenge.songSubName">< / a-entity >
< a-entity class = "menuSelectedChallengeSongName" position = "0 -0.031 0"
2018-09-20 00:54:44 -07:00
mixin="textFont" text="align: center; color: #FF185B; wrapCount: 22; baseline: top; lineHeight: 36; width: 0.81"
2018-09-19 23:29:55 +02:00
bind__text="value: menuSelectedChallenge.songName">< / a-entity >
< a-entity class = "menuSelectedChallengeAuthor" position = "0 -0.257 0"
mixin="textFont" text="align: center; color: #FFF; wrapCount: 33; width: 0.78; baseline: bottom" bind__text="value: menuSelectedChallenge.author">< / a-entity >
2018-09-20 00:54:44 -07:00
< a-entity class = "menuSelectedChallengeDownloads" position = "0 -0.325 0"
2018-09-19 23:29:55 +02:00
mixin="textFont" text="align: center; color: #FFF; wrapCount: 35" bind__text="value: menuSelectedChallenge.downloadsText">< / a-entity >
2018-07-20 23:57:18 +02:00
< / a-entity >
2018-09-18 18:41:45 -07:00
< a-plane id = "playButton"
play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"
2018-09-19 23:29:55 +02:00
position="0 -0.482 0"
2018-09-18 18:41:45 -07:00
proxy-event="event: click; to: a-scene; as: playbuttonclick"
2018-09-19 23:29:55 +02:00
material="shader: flat; src: #playImg; transparent: true; color: #CCC"
width="0.4"
height="0.2"
animation__mouseenter1="property: components.material.material.color; type: color; from: #CCC; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"
animation__mouseleave1="property: components.material.material.color; type: color; from: #FFF; to: #CCC; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
2018-09-18 18:41:45 -07:00
animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"
animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
bind-toggle__raycastable="menu.active & & !!menuSelectedChallenge.id"
bind__visible="menu.active & & !!menuSelectedChallenge.id">< / a-plane >
2018-07-20 21:16:50 +02:00
< / a-entity >
2018-10-04 03:24:43 +02:00
< / a-entity >
< a-entity id = "searchButton" position = "0 0.76 -1.8"
mixin="slice" slice9="src: #slicebtnImg; color: #999; width: 1; height: 0.2; padding: 0.1"
animation__mouseenter1="property: slice9.color; type: color; from: #999; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"
animation__mouseleave1="property: slice9.color; type: color; from: #FFF; to: #999; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"
animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"
2018-10-03 19:01:27 -07:00
bind-toggle__raycastable="menu.active & & !keyboardActive"
bind__visible="menu.active & & !keyboardActive"
proxy-event="event: click; to: a-scene; as: keyboardopen">
2018-10-03 19:03:40 -07:00
< a-entity mixin = "textFont" text = "align: center; color: #AAA; wrapCount: 20; value: SEARCH SONGS" position = "0 -0.07 0.01" > < / a-entity >
2018-09-18 18:41:45 -07:00
< / a-entity >
2018-07-18 20:48:45 +02:00
2018-10-03 19:01:27 -07:00
< a-entity
id="keyboard"
bind__super-keyboard="show: keyboardActive"
2018-10-03 19:03:40 -07:00
super-keyboard="label: Search from over 2500 songs!; width: 1; hand: {{ DEBUG_KEYBOARD and '#mouseCursor' or '#rightHand' }}; imagePath: assets/img/keyboard/; injectToRaycasterObjects: false"
2018-10-03 19:01:27 -07:00
position="0 0.8 -1"
rotation="-40 0 0"
keyboard-raycastable
search
proxy-event__dismiss="event: superkeyboarddismiss; to: a-scene; as: keyboardclose"
proxy-event__accept="event: superkeyboardinput; to: a-scene; as: keyboardclose">< / a-entity >