This file contains hidden or 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
| /** | |
| * CSS image crop. Forces image to 4:3 aspect ratio cropping at the middle. | |
| */ | |
| .img-crop{ | |
| background-color: #ededed; | |
| overflow: hidden; | |
| width: 100%; | |
| } | |
| .img-crop img{ |
This file contains hidden or 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
| /** | |
| * CSS image crop. Forces image to 4:3 aspect ratio cropping at the middle. | |
| * http://dabblet.com/gist/4711695 | |
| */ | |
| .img-crop, | |
| .img-crop img{ | |
| width: 100%; /* gotta be responsive these days */ | |
| } | |
| .img-crop{ | |
| background-color: #ededed; /* some background color for short images */ |
This file contains hidden or 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
| var | |
| choices = ['rock','paper','scissors'], // Classic version | |
| // choices = ['cockroach','foot','nuke'], // Foot crushes cockroach, nuke blows up foot, cockroach survives nuke. | |
| // choices = ['rock','paper','scissors','spock','lizard'], // Rock-Paper-Scissor-Spock-Lizard version | |
| choicesCount = choices.length, | |
| promptString = (function(choices){ | |
| var string = '', | |
| c = choicesCount - 1; | |
| for (var i = 0; i <= c; i++) { | |
| string += (i === 0) ? capitalize(choices[i]) : choices[i]; |
OlderNewer