Skip to content

Commit 71bd696

Browse files
author
Max Carlson
committed
Remove dynamic styles, logging
1 parent ebdfd16 commit 71bd696

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

WebSites/spacetime/navigator.html

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@
5959
})
6060
}
6161

62-
// dummy log method
63-
const log = () => {};
64-
6562
// Global vars to cache event state
6663
const evCache = [];
6764
let prevDiff = -1;
@@ -80,20 +77,10 @@
8077
// The pointerdown event signals the start of a touch interaction.
8178
// This event is cached to support 2-finger gestures
8279
evCache.push(ev);
83-
log("pointerDown", ev);
8480
}
8581

8682
function pointermoveHandler(ev) {
8783
// This function implements a 2-pointer horizontal pinch/zoom gesture.
88-
//
89-
// If the distance between the two pointers has increased (zoom in),
90-
// the target element's background is changed to "pink" and if the
91-
// distance is decreasing (zoom out), the color is changed to "lightblue".
92-
//
93-
// This function sets the target element's border to "dashed" to visually
94-
// indicate the pointer's target received a move event.
95-
log("pointerMove", ev);
96-
// ev.target.style.border = "dashed";
9784

9885
// Find this event in the cache and update its record with this event
9986
const index = evCache.findIndex(
@@ -108,16 +95,6 @@
10895

10996
if (prevDiff > 0) {
11097
sendEvent('zoom', { zoom: curDiff - prevDiff})
111-
if (curDiff > prevDiff) {
112-
// The distance between the two pointers has increased
113-
log("Pinch moving OUT -> Zoom in", ev);
114-
ev.target.style.background = "pink";
115-
}
116-
if (curDiff < prevDiff) {
117-
// The distance between the two pointers has decreased
118-
log("Pinch moving IN -> Zoom out", ev);
119-
ev.target.style.background = "lightblue";
120-
}
12198
}
12299

123100
// Cache the distance for the next move event
@@ -136,12 +113,8 @@
136113
}
137114

138115
function pointerupHandler(ev) {
139-
log(ev.type, ev);
140-
// Remove this pointer from the cache and reset the target's
141-
// background and border
116+
// Remove this pointer from the cache
142117
removeEvent(ev);
143-
ev.target.style.background = "white";
144-
// ev.target.style.border = "1px solid black";
145118

146119
// If the number of pointers down is less than two then reset diff tracker
147120
if (evCache.length < 2) {

0 commit comments

Comments
 (0)