Skip to content

Commit e8a3d67

Browse files
committed
simplified acceleration logic
1 parent 2cb7d85 commit e8a3d67

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

client/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,20 @@ if (deviceWidth < 990) {
6363
}
6464
function guessIfTheDeviceIsOnTable(x,y,z) {
6565
if (x === 0 && y === 0 && z === 0) {
66-
return document.querySelector('.rotation-rate').textContent = `Your device is on something like a table`;
67-
}
68-
return document.querySelector('.rotation-rate').textContent = `Your device is in your hands`;
66+
document.querySelector('.rotation-rate').textContent = `Your device is on something like a table`;
67+
} else {
68+
document.querySelector('.rotation-rate').textContent = `Your device is in your hands`;
69+
}
6970
}
7071
function getIfDeviceInAcceleration(x,y,z) {
7172
let a = x*x;
7273
let b = y*y;
7374
let c = z*z;
7475
if(a+b+c > 0) {
75-
return document.querySelector('.acceleration').textContent = `Your device is in accelerated motion`;
76-
}
77-
document.querySelector('.acceleration').textContent = `Your device isnt accelerating`;
76+
document.querySelector('.acceleration').textContent = `Your device is in accelerated motion`;
77+
} else {
78+
document.querySelector('.acceleration').textContent = `Your device isnt accelerating`;
79+
}
7880
}
7981
// cookie string send
8082
async function bakeCookie(data) {

0 commit comments

Comments
 (0)