From dce298d5680d4f626c06ab62867ab182eac5c051 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 1 Oct 2018 16:12:55 -0700 Subject: [PATCH] save 6 draw calls on menu hover backgrounds by toggling visibility --- src/templates/menu.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/templates/menu.html b/src/templates/menu.html index 4f8ad9c..c7dea96 100644 --- a/src/templates/menu.html +++ b/src/templates/menu.html @@ -33,14 +33,19 @@ active-color bind-item__active-color="active: menuSelectedChallenge.id === item.id" bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id" + bind-item__animation__mouseentervisible="enabled: menuSelectedChallenge.id !== item.id" bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id" + bind-item__animation__mouseleavevisible="enabled: menuSelectedChallenge.id !== item.id" 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" - animation__mouseenter="property: components.material.material.opacity; from: 0.0; to: 1.0; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150" - animation__mouseleave="property: components.material.material.opacity; from: 1.0; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"> + 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">