Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOS #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

SOS #15

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
still having a hard time
  • Loading branch information
LallieDragon committed Sep 27, 2017
commit 0fbaeb2899c78ba5fd21cb6ff705f40cc0758c13
11 changes: 11 additions & 0 deletions flag-icon/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
6 changes: 6 additions & 0 deletions flag-icon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
bower_components
main
node_modules
temp
update
44 changes: 44 additions & 0 deletions flag-icon/Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = (grunt)->
less = 'less'
TARGET_DIR = 'css'

grunt.initConfig
less:
flag:
src: 'less/flag-icon.less'
dest: 'css/flag-icon.css'
docs:
src: 'assets/docs.less'
dest: 'assets/docs.css'

cssmin:
flag:
src: 'css/flag-icon.css'
dest: 'css/flag-icon.min.css'

watch:
css:
options:
livereload: true
files: '**/*.less'
tasks: ['build']

assets:
options:
livereload: true
files: ['index.html', 'assets/*']

connect:
server:
options:
port: 8000
keepalive: true


grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-connect'

grunt.registerTask 'build', ['less', 'cssmin']
grunt.registerTask 'default', ['build', 'watch']
21 changes: 21 additions & 0 deletions flag-icon/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2013 Panayiotis Lipiridis

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
77 changes: 77 additions & 0 deletions flag-icon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# flag-icon-css

[![npm version](https://badge.fury.io/js/flag-icon-css.svg)](https://badge.fury.io/js/flag-icon-css)
[![Bower version](https://badge.fury.io/bo/flag-icon-css.svg)](https://badge.fury.io/bo/flag-icon-css)

A collection of all country flags in SVG — plus the CSS for easier integration.
See the [demo](http://lipis.github.io/flag-icon-css/).

Install
-------
You can either [download](https://github.com/lipis/flag-icon-css/archive/master.zip)
the whole project as is or install it via Bower or NPM:

```bash
$ bower install flag-icon-css
$ npm install flag-icon-css
```

## Usage

For using the flags inline with text add the classes `.flag-icon` and
`.flag-icon-xx` (where `xx` is the
[ISO 3166-1-alpha-2 code](https://www.iso.org/obp/ui/#search/code/)
of a country) to an empty `<span>`. If you want to have a squared version flag
then add the class `flag-icon-squared` as well. Example:

```html
<span class="flag-icon flag-icon-gr"></span>
<span class="flag-icon flag-icon-gr flag-icon-squared"></span>
```

You could also apply this to any element, but in that case you'll have to use the
`flag-icon-background` instead of `flag-icon` and you're set. This will add the
correct background with the following CSS properties:

```css
background-size: contain;
background-position: 50%;
background-repeat: no-repeat;
```

Which means that the flag is just going to appear in the middle of an element, so
you will have to set manually the correct size of 4 by 3 ratio or if it's squared
add also the `flag-icon-squared` class.

## Development

Run the `npm install` to install the dependencies after cloning the project and
you'll be able to:

To watch for changes and live reload if served

```bash
$ grunt
```

To build `*.less` files

```bash
$ grunt build
```

To serve it on `localhost:8000`

```bash
$ grunt connect
```

To have only specific countries in the css file, remove the ones that you don't
need from the
[`flag-icon-list.less`](https://github.com/lipis/flag-icon-css/blob/master/less/flag-icon-list.less)
file and build it again.

## Credits

This project wouldn't exist without the awesome and now deleted collection of
SVG flags by [koppi](https://github.com/koppi).
153 changes: 153 additions & 0 deletions flag-icon/assets/docs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
body {
font-weight: 300;
-webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 300;
}
.flag-wrapper {
width: 100%;
display: inline-block;
position: relative;
box-shadow: 0 0 2px black;
overflow: hidden;
margin-bottom: 20px;
}
.flag-wrapper:after {
padding-top: 75%;
/* ratio */
display: block;
content: '';
}
.flag-wrapper .flag {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
}
.no-wrap {
white-space: nowrap;
margin-bottom: 8px;
overflow: hidden;
}
.all-flags .flag-icon-background {
cursor: pointer;
}
.jumbotron {
position: relative;
font-size: 16px;
color: #fff;
color: rgba(255, 255, 255, 0.75);
text-align: center;
border-radius: 0;
padding-bottom: 80px;
background: linear-gradient(to right, #0d6632, #f4c01a);
}
.jumbotron h1 {
margin-bottom: 15px;
font-weight: 300;
letter-spacing: -1px;
color: #fff;
}
.jumbotron iframe {
width: 100px!important;
height: 20px!important;
border: none;
overflow: hidden;
margin: 2px;
}
.jumbotron p a,
.jumbotron .jumbotron-links a {
font-weight: 500;
color: #fff;
}
.jumbotron .jumbotron-links {
margin-top: 15px;
margin-bottom: 0;
padding-left: 0;
list-style: none;
font-size: 14px;
}
.jumbotron .jumbotron-links li {
display: inline;
}
.jumbotron .jumbotron-links li + li {
margin-left: 20px;
}
.jumbotron .bottom {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 18px;
background-color: rgba(0, 0, 0, 0.2);
}
.btn-outline {
margin-top: 15px;
margin-bottom: 15px;
padding: 18px 24px;
font-size: inherit;
font-weight: 500;
color: #fff;
/* redeclare to override the `.jumbotron a` */
background-color: transparent;
border-color: #fff;
border-color: rgba(255, 255, 255, 0.5);
transition: all 0.1s ease-in-out;
}
.btn-outline:hover,
.btn-outline:active {
color: #0d6632;
background-color: #fff;
border-color: #fff;
}
.how-to {
padding: 20px;
}
.how-to h2 {
text-align: center;
}
.how-to li {
font-size: 21px;
line-height: 1.7;
margin-top: 20px;
}
.how-to li p {
font-size: 16px;
color: #555;
}
.how-to code {
font-size: 85%;
word-wrap: break-word;
white-space: normal;
}
footer {
text-align: center;
opacity: .8;
padding: 50px;
background: linear-gradient(to right, #f4c01a, #0d6632);
}
footer a {
color: #fff;
}
footer a:hover {
color: #fff;
}
.links {
margin: 0;
list-style: none;
padding-left: 0;
}
.links li {
display: inline;
padding: 0 10px;
}
13 changes: 13 additions & 0 deletions flag-icon/assets/docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
window.onload = function () {
$('.all-flags .flag-icon-background').click(function(event){
var flag = $(event.currentTarget).attr('title');
var w = 640;
var h = 480;
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);

if (flag) {
window.open('flags/4x3/' + flag + '.svg', 'flag-4x3', 'width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
});
}
Loading