Git Product home page Git Product logo

ip-address-tracker's Introduction

Frontend Mentor - IP address tracker solution

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.

Table of contents

Overview

The challenge

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

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Bootstrap-5 - Front-End Framework
  • jQuery - JS library

What I learned

I've learned lot of stuff in this challenge:

  • Object Oriented Programming
class App {
	// Data
	#map;
	#mapZoom = 15;
	#coords;
	#marker;

	constructor() {
		// Some Code
	}

	_getIPData() {
		// Some Code
	}

	_setIPData() {
		// Some Code
	}

	_loadMap() {
		// Some Code
	}

	#_setMarker() {
		// Some Code
	}
}

const app = new App();
  • How to get fetch from APIs
fetch(`https://ipapi.co/json`)
  .then(res =>  res.json())
  .then(data => {
    if (data.error) throw new Error(`Error: ${data.reason}.`);
    this._setIPData(data);
  })
  .catch(e =>
    alert(`${	e.message} Try again!`)
  );
}
  • Grid System of Bootstrap-5
<main class="row">
	<div class="col-lg-5"></div>

	<div class="col-lg-12">
		<div class="row row-cols-lg-4">
			<div>1</div>
			<div>2</div>
			<div>3</div>
			<div>4</div>
		</div>
	</div>
</main>
  • How to use LealletsJs
const map = L.map('mapID').setView([lat, lon], 15);

// Google Map
L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
	maxZoom: 20,
	subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
}).addTo(map);

L.marker([lat, lon], {
	icon: L.icon({
		iconUrl: 'images/icon-location.svg',
		iconAnchor: [24, 56],
	}),
})
	.addTo(map)
	.openPopup();

Continued development

Stuff I find usefull and want to learn:

  • Node.js
  • Express
  • React
  • CSS Animations
  • JS Regular Expressipns
  • Data Structures
  • Databases (MongoDB)
  • Flutter & Dart

Useful resources

  • TheNetNinja Youtube - This helped me learn jQuery, GitHub, CSS Grid. This guy is legend there's lot of stuff to learn, which I will be learning in future.
  • GeeksForGeeks - This is amazing website for articles, snippets, projects, algorithms etc.
  • MDN Docs - This is an amazing reference which helped me finally understand detailed concepts like data- attr, aria attr, input range etc.

Author

Acknowledgments

ip-address-tracker's People

Contributors

vatsalsinghkv avatar axelawh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.