Coder Social home page Coder Social logo

yizhuang-chew / square-flags Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kapowaz/square-flags

0.0 0.0 0.0 593 KB

A collection of 400+ minimalist square SVG country, state and language flags

Home Page: https://kapowaz.github.io/square-flags/

License: MIT License

JavaScript 20.70% Ruby 2.97% CSS 25.73% HTML 50.60%

square-flags's Introduction

square-flags square-flags animated logo

A collection of circular square SVG country flags, based on circle-flags, by HatScripts.

Why square? What’s different?

It’s a popular request for the original circle-flags project to offer square variants, but in a lot of cases the change to the original flag design is non-trivial. For simple designs like tricolours you can simply remove the mask, but a lot of the original flags carefully position elements to appear within the silhouette of a circle; once that circle mask is removed, the elements seem misplaced or concentrated around the centre of the flag.

So, I’ve taken the original artwork and reworked them to suit a square shape better. I’ve also taken the opportunity to make a few tweaks here and there to colours (adding a new middle dark yellow that has better contrast against light backgrounds), as well as building the whole thing out in Figma using components.

Using the flag for Australia, here’s an example of the kind of change: the Union Jack has been replaced with the full design at a quarter scale, the background colour has been changed to Navy to more accurately reflect the original, and the position of the largest star has been moved to the left, closer to its true location.

A comparison of the circle-flags and square-flags equivalents for the flag of Australia

Usage

https://kapowaz.github.io/square-flags/flags/xx.svg

(Where xx is the ISO 3166-1 alpha-2 code of a country).

For example, the following code:

<img src="https://kapowaz.github.io/square-flags/flags/br.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/cn.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/gb.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/id.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/in.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/ng.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/ru.svg" width="48">
<img src="https://kapowaz.github.io/square-flags/flags/us.svg" width="48">

...produces this:

To view all the available flags, check the gallery.

React

If you're using React, an equivalent react-square-flags package is in the works.

NPM

If you want to install this package as a dependency, you can install it from this GitHub repository:

npm install --save https://github.com/kapowaz/square-flags

Contributing

The design files for this set of flags can be found on Figma as part of the Square Flags shared library. If you wish to make a contribution, create a copy of that library and add your changes as a component, then create a pull request including the exported SVG file and a link to your copy of the Figma file, so that the original can be updated.

You will also need to ensure you have have the latest version of svgo installed; when exporting SVG files, run svgo on the flags/ directory:

svgo ./flags --recursive --config=svgo.config.js

Then commit the changes, and submit them as a pull request along with your Figma file.

The color palette

Like HatScript’s flag set, this set of flags uses the following color palette (with a few small additions, such as Dark Yellow). Since the original designs are in Figma, if you have a proposed modification to an existing flag, create an issue and I’ll try and amend the original Figma file.

    {% for color in site.data.colors %}
  • {{ color.hex }} {{ color.name }}
  • {% endfor %}

License

This project is released under the MIT license.

square-flags's People

Contributors

kapowaz avatar waldyrious 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.