Skip to content

Commit

Permalink
Add Joy Joy demo
Browse files Browse the repository at this point in the history
Demo detects and shows Joy-Cons in the browser with a graphic of the
button/joystick usage.

There is also an onboarding page to show how to connect a Joy-Con.

This was bootstrapped from `create-react-app`.
  • Loading branch information
taktran committed May 27, 2019
1 parent cc56a7d commit e51a3d9
Show file tree
Hide file tree
Showing 35 changed files with 14,057 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

A [Joy-Con](https://en.wikipedia.org/wiki/Joy-Con) game controller library for the browser. Built using the [Gamepad API](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API).

To see the library in action, see the [demo](./demo) folder.

To see the source code, look in [src/joy-joy](./src/joy-joy).
23 changes: 23 additions & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions demo/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.16.0
42 changes: 42 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Joy Joy demo

A demo of the [Joy Joy library](../src/joy-joy).

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Development

- Install [nvm](https://github.com/creationix/nvm)
- Use correct node version

nvm use

- Go to [library folder](../../src/joy-joy) and run instructions
- Install dependencies in this folder

npm install

- Run with `npm start`. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### Logging

Underneath the hood, the library uses [ulog](https://ulog.js.org/). To change the log level, add the parameter `log=[log-level]` eg, `http://localhost:3000/?log=debug`.

For logging `>= log.INFO`, there is also a [frames per second stats](https://github.com/tibotiber/react-fps-stats).

More documentation on the [ulog website](https://ulog.js.org/).

### Run tests

Run `npm test`

Launches the test runner in the interactive watch mode.

### Build the app

Run `npm run build`

Builds the app for production to the `build` folder.
Loading

0 comments on commit e51a3d9

Please sign in to comment.