This repository was archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from natgeo/ratio-rounding
Ratio rounding
- Loading branch information
Showing
7 changed files
with
139 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
'use strict' | ||
module.exports = (grunt) -> | ||
# load all grunt tasks | ||
# this assumes matchdep, grunt-contrib-watch, grunt-contrib-coffee, | ||
# grunt-coffeelint, grunt-contrib-clean is in the package.json file | ||
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks | ||
|
||
grunt.initConfig | ||
# load in the module information | ||
pkg: grunt.file.readJSON 'package.json' | ||
# path to Grunt file for exclusion | ||
gruntfile: 'Gruntfile.coffee' | ||
# generalize the module information for banner output | ||
banner: '/**\n' + | ||
' * Description: <%= pkg.description %>\n' + | ||
' * Date Built: <%= grunt.template.today("yyyy-mm-dd") %>\n' + | ||
' * Copyright (c) <%= grunt.template.today("yyyy") %>' + | ||
'**/\n' | ||
|
||
# basic watch tasks first for development | ||
watch: | ||
coffee: | ||
files: [ | ||
'*.coffee' | ||
] | ||
tasks: 'coffee:compile' | ||
options: | ||
livereload: true | ||
|
||
|
||
# clear out any unneccessary files | ||
clean: ['<%= pkg.name %>.js', '!.node_modules/'] | ||
|
||
|
||
# lint our files to make sure we're keeping to team standards | ||
coffeelint: | ||
files: | ||
src: ['<%= pkg.name %>.coffee'] | ||
options: | ||
'indentation': | ||
value: 4 | ||
level: 'warn' | ||
'no_trailing_whitespace': | ||
level: 'ignore' | ||
'max_line_length': | ||
velue: 120 | ||
level: 'warn' | ||
|
||
|
||
# this is here, well so we can compile the files into something | ||
# readable on the interwebs. | ||
coffee: | ||
compile: | ||
files: [ | ||
expand: true | ||
cwd: '' | ||
src: ['<%= pkg.name %>.coffee'] | ||
dest: '' | ||
# we need this rename function in case files are named | ||
# with dot notation. e.g., ngm.module.coffee | ||
rename: (destBase, destPath) -> | ||
destBase + destPath.replace(/\.coffee$/, '.js') | ||
] | ||
|
||
build: | ||
tasks: ['default'], | ||
packageConfig: 'pkg', | ||
packages: '*.json', | ||
jsonSpace: 2, | ||
jsonReplacer: undefined | ||
|
||
|
||
grunt.registerTask 'default', [ | ||
'coffeelint' | ||
'clean' | ||
'coffee:compile' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset=utf-8 /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>PictureTime</title> | ||
<script src="external/matchmedia.js"></script> | ||
<script src="pictureTime.js"></script> | ||
<style> | ||
body { font-family: sans-serif } | ||
img { max-width: 100% } | ||
</style> | ||
</head> | ||
<body> | ||
<h1>PictureTime: A <picture> element polyfill, building on <a href="http://github.com/scottjehl/picturefill">picturefill</a></h1> | ||
<picture alt="Photo: Tiger in tall grass" /> | ||
<source srcset="external/imgs/small.jpg 1x, external/imgs/smallplus.jpg 2x"> | ||
<source media="(min-width: 700px)" srcset="external/imgs/medium.jpg 1x, external/imgs/mediumplus.jpg 2x" /> | ||
<source media="(min-width: 900px)" srcset="external/imgs/large.jpg 1x, external/imgs/largeplus.jpg 2x" /> | ||
<!-- noscript prevents the image from using resources unless JS fails --> | ||
<noscript> | ||
<img src="external/imgs/medium.jpg" /> | ||
</noscript> | ||
<head> | ||
<meta charset=utf-8 /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>PictureTime</title> | ||
<script src="external/matchmedia.js"></script> | ||
<script src="pictureTime.js"></script> | ||
<style> | ||
body { font-family: sans-serif } | ||
img { max-width: 100% } | ||
</style> | ||
</head> | ||
<body> | ||
<h1>PictureTime: A <picture> element polyfill, building on <a href="http://github.com/scottjehl/picturefill">picturefill</a></h1> | ||
<picture alt="Photo: Tiger in tall grass" /> | ||
<source media="(min-width: 900px)" srcset="external/imgs/large.jpg 1x, external/imgs/largeplus.jpg 2x" /> | ||
<source media="(min-width: 700px)" srcset="external/imgs/medium.jpg 1x, external/imgs/mediumplus.jpg 2x" /> | ||
<source srcset="external/imgs/small.jpg 1x, external/imgs/smallplus.jpg 2x"> | ||
|
||
<!-- noscript prevents the image from using resources unless JS fails --> | ||
<noscript> | ||
<img src="external/imgs/medium.jpg" /> | ||
</noscript> | ||
</picture> | ||
</body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "pictureTime", | ||
"version": "0.2.0", | ||
"description": "PICTURE element polyfill with support back to IE9, fallback to IE8", | ||
"main": "pictureTime.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"matchdep": "~0.1.1", | ||
"grunt-contrib-watch": "~0.4.4", | ||
"grunt-contrib-coffee": "~0.7.0", | ||
"grunt-coffeelint": "0.0.7", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-uglify": "~0.2.5", | ||
"grunt-bump-build-git": "~1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.