JavaScript 30- Day 21 Study Notes

https://javascript30.com/

Day 21 of JavaScript 30 by Wes Bos used an app called x-code to create a geolocation app. The x-code app is exclusive to the Mac ecosystem and since I use Windows, I had to sit this one out. I followed along with the coding, but could not build out the app.

Bos set two variables to access the HTML elements.

const arrow = document.querySelector('.arrow');const speed = document.querySelector('.speed-value');

And used one function to process the information and change the display accordingly.

navigator.geolocation.watchPosition((data)=> {   speed.textContent = data.coords.speed;   arrow.style.transform = `rotate(${data.coords.heading}deg)`}, (err)=> {      console.err(err);      alert('Hey! You gotta allow that to happen!');});

It looks like a cool app and I would have liked to make it. Apparently, you can connect this app to a mobile device, Apple devices only.

Follow my study notes as I progress through JavaScript 30.

Retired physician, writer, aspiring website designer and developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store