Coder Social home page Coder Social logo

point-the-flag's Introduction

Игра "Укажи страну по ее флагу", сделанная с помощью React и leaflet.js

Приложение написано на React с использованием Redux архитектуры (что конечно излишне для такого небольшого приложения, но для примера моего кода сойдет).
Приложение адаптировано для мобильных устройств.
Иерархия компонентов:

    <App> - приложение, в нем все собрано и обернуто в <Provider>
        <Header>
        <GuessMap> - карта с передвигаемым маркером, на leaflet.js + react-leaflet
            <GuessGame> - fixed контейнер с игровой информацией
  • Страна, выбранная маркером, находится через GET запрос (параметры: ширина и долгота игрового маркера) к Nominatim API и сверяется с правильным ответом в src/shared/flags.json

"Guess the country by its flag" game made with React and leaflet.js

This React app is mobile-friendly.
I used Redux architecture as part of my learning experience and since the app is here mainly to show how I write code I left it.
The component hierarchy:

    <App> - container, where everything is put together and wrapped in Redux <Provider>
        <Header>
        <GuessMap> - the map with a draggable marker, done using leaflet.js + react-leaflet
            <GuessGame> - fixed container with game info
  • The chosen country is identified using a HTTP GET request (the query parameters are the marker's latitude and longitude) to Nominatim API and the answer is then compared to the correct answers in src/shared/flags.json

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.