Skip to content

Commit

Permalink
Merge pull request #2 from BritishMuseumDH/amendments
Browse files Browse the repository at this point in the history
Slight amendments
  • Loading branch information
JudeOsborn authored Oct 30, 2017
2 parents 152641f + a4f4377 commit 27205ae
Show file tree
Hide file tree
Showing 4 changed files with 2,701 additions and 398 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ npm start

2. Open Chrome on a the computer and go to http://localhost:8080/screen.

3. On the Android phone open mobile chrome and go to <http://<the computer's IP>:8080 (make sure your phone is connected to the same Wi-Fi as the comptuer).
3. On the Android phone open mobile chrome and go to <http://<the computer's IP>:8080 (make sure your phone is connected to the same Wi-Fi as the computer).

4. Point at the computer screen and move the ciricle around at will.
4. Point at the computer screen and move the circle around at will.


## Compatibility

For the sake of simplicity this example works Anroid only. However, Xyfi does work on iOS with [gyroscope normalization](https://www.npmjs.com/package/gyronorm).
For the sake of simplicity this example works on Android only. However, Xyfi does work on iOS with [gyroscope normalization](https://www.npmjs.com/package/gyronorm).


## About the experiment
Expand Down Expand Up @@ -61,7 +61,7 @@ This ruled out many typical connection methods, such as installing a native app,

In the end we decided to go with a Wi-Fi router and captive portal technology. Most smartphone users know how to connect to Wi-Fi, so there was plenty of familiarity there. We also loved the perceived sorcery of the captive portal popping up immediately.

The great thing about captive portal technology is that it’s supported by all but the very oldest of smartphone/OS combinations.. Also, since a captive portal is essentially a web page, we can get the UI done with classic web development technologies.
The great thing about captive portal technology is that it is supported by all but the very oldest of smartphone/OS combinations. Also, since a captive portal is essentially a web page, we can get the UI done with classic web development technologies.

There are many ways to configure a captive portal. For example, [nodogsplash](https://wiki.openwrt.org/doc/howto/wireless.hotspot.nodogsplash), which works with the custom firmware, [OpenWRT](https://openwrt.org). Or the firmware [DD-WRT](https://www.dd-wrt.com) has [its own set of captive portal solutions](https://www.dd-wrt.com/wiki/index.php/Captive_Portal) as well.

Expand Down
8 changes: 4 additions & 4 deletions app/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require('./post-css/remote.css');

var io = require('socket.io-client')('/remotes');

// The angle at which we stop listening for input from rthe phone's gyro.
// The angle at which we stop listening for input from the phone's gyro.
var MAX_X_ANGLE = 20,
MAX_Y_ANGLE = 24;

Expand Down Expand Up @@ -60,7 +60,7 @@ function handleDeviceOrientation(data) {
}

// Up/down rotation.
if (beta > 0 && beta <= MAX_Y_ANGLE
if (beta > 0 && beta <= MAX_Y_ANGLE
|| beta < 0 && beta >= MAX_Y_ANGLE * -1) {
y = 100 / MAX_Y_ANGLE * (beta * -1);
} else {
Expand Down Expand Up @@ -104,7 +104,7 @@ function update() {
// support it. For example, phones with no gyro.
if (window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', handleDeviceOrientation, false);

window.addEventListener('touchstart', handleTouchStartEvent, {
capture: true,
passive: false
Expand All @@ -127,7 +127,7 @@ if (window.DeviceOrientationEvent) {
capture: true,
passive: false
}
);
);
} else {
alert('This device is not supported.');
}
Loading

0 comments on commit 27205ae

Please sign in to comment.