Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reserve-protocol/elm-iso3166-data
ISO 3166 data including country names, flags sprite sheet, dial codes, and more
https://github.com/reserve-protocol/elm-iso3166-data
Last synced: about 1 month ago
JSON representation
ISO 3166 data including country names, flags sprite sheet, dial codes, and more
- Host: GitHub
- URL: https://github.com/reserve-protocol/elm-iso3166-data
- Owner: reserve-protocol
- License: mit
- Created: 2019-01-10T20:05:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-11T03:17:16.000Z (almost 6 years ago)
- Last Synced: 2024-05-09T15:21:39.770Z (8 months ago)
- Language: Elm
- Size: 75.2 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-iso3166-data
Information about world countries. This library contains lists of facts about countries.
### Convert Alpha-2 Code to name
Find the name of a country including the country name in local language in parenthesis### Convert Alpha-2 Code to flag
Find the flag of a country in this sprite sheet.![Sprite sheet](assets/flag.png)
```elm
> import Iso3166
> Dict.get Iso3166.flagPositions "MX"
Just ( -112, -144 )
: Maybe.Maybe (Float, Float)
> import Html exposing (div)
> (x, y) = (-112, -144)
> div
[ style "background-image" ("url(\"" ++ Iso3166.flagImageData ++ "\")"
, style "background-position" (String.fromFloat x ++ "px " ++ String.fromFloat y ++ "px")
, style "width" "16px"
, style "height" "16px"
]
[]
```