├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── dist ├── fitvids.js └── fitvids.min.js ├── index.js ├── package-lock.json ├── package.json ├── test.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # npm scraps 3 | node_modules/ 4 | npm-debug.log 5 | 6 | # OS X scraps 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | 3 | Copyright (C) 2015 Ross Zurowski 4 | 5 | Everyone is permitted to copy and distribute verbatim or modified 6 | copies of this license document, and changing it is allowed as long 7 | as the name is changed. 8 | 9 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 10 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 11 | 12 | 0. You just DO WHAT THE FUCK YOU WANT TO. 13 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Binaries 4 | # 5 | 6 | BIN := ./node_modules/.bin 7 | 8 | # 9 | # Variables 10 | # 11 | 12 | DIST = dist 13 | 14 | # 15 | # Tasks 16 | # 17 | 18 | build: node_modules index.js 19 | @mkdir -p $(DIST) 20 | @browserify index.js --standalone fitvids -o $(DIST)/fitvids.js 21 | @uglifyjs $(DIST)/fitvids.js -o $(DIST)/fitvids.min.js 22 | 23 | node_modules: package.json 24 | @npm install 25 | @touch node_modules 26 | 27 | test: 28 | @hihat test.js 29 | 30 | lint: 31 | @xo index.js test.js 32 | 33 | size: build 34 | @cat $(DIST)/fitvids.js | gzip -9 | wc -c 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fitvids 2 | 3 | Lets your videos be responsive by wrapping them in an [aspect ratio container](http://alistapart.com/article/creating-intrinsic-ratios-for-video). 4 | 5 | This module is based heavily off of Dave Rupert's [FitVids jQuery plugin](https://github.com/davatron5000/FitVids.js). 6 | 7 | ## Install 8 | 9 | ```bash 10 | npm install fitvids --save 11 | ``` 12 | 13 | You can also [download the files manually](https://raw.githubusercontent.com/rosszurowski/vanilla-fitvids/master/dist/fitvids.min.js) and include them via a `