This is a solution to the IP address tracker challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for each page depending on their device's screen size
- See hover states for all interactive elements on the page
- See their own IP address on the map on the initial page load
- Search for any IP addresses or domains and see the key information and location
- Solution URL: Github repository
- Live Site URL: GitHub page
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- LeafletJS - JS library for Maps
- IPAPI - IP address API
I learnt how to work with the LeafletJS library.
function getUserIP(api) {
fetch(api)
.then(response => response.json())
.then(data => {
mapper(data.latitude, data.longitude);
ipAddress.text(data.ip);
userLocation.text(`${data.city}, ${data.country_name}`);
userTimezone.text(`UTC ${data.utc_offset.slice(0,3)}:00`);
userISP.text(data.org);
})
.catch(err => {
alert(err);
console.error(err);
});
}
I'd get better at working with external APIs and asynchronous javascript.
- Website - Kelechi Kizito Ugwu
- Frontend Mentor - @Kelechikizito
- Twitter - @kelechiikizito