diff --git a/Gruntfile.coffee b/Gruntfile.coffee index dc56a5e93..f876abe10 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1,24 +1,27 @@ module.exports = (grunt)-> - SRC_DIR = "less" - TARGET_DIR = "css" + less = 'less' + TARGET_DIR = 'css' grunt.initConfig less: - app_css: - src: "#{SRC_DIR}/flag-icon.less" - dest: "#{TARGET_DIR}/flag-icon.css" + flag: + src: 'less/flag-icon.less' + dest: 'css/flag-icon.css' + docs: + src: 'assets/docs.less' + dest: 'assets/docs.css' cssmin: - app_css: - src: "#{TARGET_DIR}/flag-icon.css" - dest: "#{TARGET_DIR}/flag-icon.min.css" + flag: + src: 'css/flag-icon.css' + dest: 'css/flag-icon.min.css' watch: css: options: livereload: true - files: "#{SRC_DIR}/*.less" - tasks: ["build"] + files: '**/*.less' + tasks: ['build'] assets: options: @@ -32,10 +35,10 @@ module.exports = (grunt)-> keepalive: true - grunt.loadNpmTasks("grunt-contrib-less") - grunt.loadNpmTasks("grunt-contrib-cssmin") - grunt.loadNpmTasks("grunt-contrib-watch") - grunt.loadNpmTasks('grunt-contrib-connect') + grunt.loadNpmTasks 'grunt-contrib-less' + grunt.loadNpmTasks 'grunt-contrib-cssmin' + grunt.loadNpmTasks 'grunt-contrib-watch' + grunt.loadNpmTasks 'grunt-contrib-connect' - grunt.registerTask("default", ["build", "watch"]) - grunt.registerTask("build", ["less", "cssmin"]) + grunt.registerTask 'build', ['less', 'cssmin'] + grunt.registerTask 'default', ['build', 'watch'] diff --git a/assets/docs.css b/assets/docs.css index e7560d4de..d15de22f2 100644 --- a/assets/docs.css +++ b/assets/docs.css @@ -1,3 +1,15 @@ +body { + font-weight: 300; + -webkit-font-smoothing: antialiased; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: 300; +} .flag-wrapper { width: 100%; display: inline-block; @@ -6,31 +18,136 @@ overflow: hidden; margin-bottom: 20px; } - .flag-wrapper:after { - padding-top: 75%; /* ratio */ + padding-top: 75%; + /* ratio */ display: block; content: ''; } - .flag-wrapper .flag { position: absolute; - top: 0; bottom: 0; right: 0; left: 0; + top: 0; + bottom: 0; + right: 0; + left: 0; width: 100%; height: 100%; background-size: cover; } - -h1, h2, h3, h4, h5, h6 { - font-weight: 300; -} - .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; +} diff --git a/assets/docs.js b/assets/docs.js index 874eedd0f..e95e66370 100644 --- a/assets/docs.js +++ b/assets/docs.js @@ -1,14 +1,4 @@ window.onload = function () { - document.getElementById('btn-bootstrap').onclick = function() { - if (document.getElementById('bootstrap').rel == 'stylesheet') { - document.getElementById('bootstrap').rel = 'styleshit'; - document.getElementById('btn-bootstrap').innerHTML = document.getElementById('btn-bootstrap').innerHTML.replace('Disable', 'Enable'); - } else { - document.getElementById('bootstrap').rel = 'stylesheet'; - document.getElementById('btn-bootstrap').innerHTML = document.getElementById('btn-bootstrap').innerHTML.replace('Enable', 'Disable'); - } - } - $('.all-flags .flag-icon-background').click(function(event){ var flag = $(event.currentTarget).attr('title'); var w = 640; diff --git a/assets/docs.less b/assets/docs.less new file mode 100644 index 000000000..50965b56d --- /dev/null +++ b/assets/docs.less @@ -0,0 +1,162 @@ +@color-from: #0d6632; +@color-to: #f4c01a; + +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; + + &:after { + padding-top: 75%; /* ratio */ + display: block; + content: ''; + } + + .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,.75); + text-align: center; + border-radius: 0; + padding-bottom: 80px; + background: linear-gradient(to right, @color-from, @color-to); + h1 { + margin-bottom: 15px; + font-weight: 300; + letter-spacing: -1px; + color: #fff; + } + iframe { + width: 100px!important; + height: 20px!important; + border: none; + overflow: hidden; + margin: 2px; + } + + p + a, + .jumbotron-links a { + font-weight: 500; + color: #fff; + } + + .jumbotron-links { + margin-top: 15px; + margin-bottom: 0; + padding-left: 0; + list-style: none; + font-size: 14px; + li { + display: inline; + } + li + li { + margin-left: 20px; + } + } + + .bottom { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 18px; + background-color: fade(#000, 20%); + } +} + +.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,.5); + transition: all .1s ease-in-out; + &:hover, + &:active { + color: @color-from; + background-color: #fff; + border-color: #fff; + } +} + +.how-to { + padding: 20px; + h2 { + text-align: center; + } + li { + font-size: 21px; + line-height: 1.7; + margin-top: 20px; + p { + font-size: 16px; + color: #555; + } + } + code { + font-size: 85%; + word-wrap: break-word; + white-space: normal; + } +} + +footer { + text-align: center; + opacity: .8; + padding: 50px; + background: linear-gradient(to right, @color-to, @color-from); + + a { + color: #fff; + &:hover { + color: #fff; + } + } +} + +.links { + margin: 0; + list-style: none; + padding-left: 0; + li { + display: inline; + padding: 0 10px; + } +} diff --git a/index.html b/index.html index 04cec529c..755e9ddf5 100644 --- a/index.html +++ b/index.html @@ -3,13 +3,16 @@
- - -- CSS for vector based country flags! -
-- - View Project - - - Download - -
-- -
-- + SVG country flags that could be used anywhere via CSS!
+ View on GitHub +