Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

How can i create a compass using html5 for mobile

Can anyone send me a sample code with design of a compass using html5 and some javascript

Mike,

I'd suggest you wireframe the project first. Start by mapping out the basic actions that your app will have, then map these actions to the design layout. Once you these key blocks determined you can code those HTML elements.

You might want to check CodePen or other sites where people share projects to get some ideas about the approach for linking location services to the compass site you've built. Find something that works well and build on it!

Good Luck

1 Answer

Later on when you learn AJAX and some jQuery, you can look for a website that has live compass information and you can link the API and use JavaScript to insert HTML and refresh info. Of course this Is a very blunt way of describing the project. Mobile devices contain motors, pitch sensors that can be used to recalculate the image of the compass when a user aims the device a certain way. I would suggest going through Front-End Dev track then either the Android or Ios (OR BOTH for good measure of course) In being able to make the project available to more users. Iphones for instance have longitude and latitude information so you can even parse that info and make a GPS as well. The possibilities are endless.