Search code examples
javascriptjquerycsssmartphone

Connect smartphone to website


I've come across this link a while ago: https://lightsaber.withgoogle.com

I thought it was really cool, the ability to connect your phone to a website and let it control certain things. And just now I found this link: http://www.pauljobard.com/#!/ it implements the phone connect option too (if you go to 'experience my work').

I'm considering of experimenting a little something with this for my portfolio website, but I have no idea where to start; can someone give me a push in the right direction? What is this 'function' called? Is it very hard?

to be more specific what I want to use this for: I want the user to be able to drag along a screen and pan and rotate a 3D object that way (I'm a 3d artist).


Solution

  • Take a link at Hammerjs, this allows you to capture your phone's accelerometer and gyroscope data, it's fairly quick to get up and running.

    In terms of connecting up a phone to your desktop via a web app, it's a little more work, take a look at this article on establishing a connection with a node server as well at this article which goes into a little more detail and it should point you in the right direction.