-
-
Save certainlyakey/0eca9ad99b39fa53f321 to your computer and use it in GitHub Desktop.
Hipstum ipsum jade mixin
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
//- ---------------------------------- | |
//- Usage: | |
//- include lorem | |
//- p | |
//- mixin lorem(25) | |
//- ---------------------------------- | |
//- new sentece after N words | |
- var colonEvery = 10 | |
//- 175 words | |
- var words = ["Voluptate", "retro", "dolor", "anim", "Austin", "messenger", "bag", "cred", "delectus", "aesthetic", "ullamco", "stumptown", "actually", "fashion", "axe", "nostrud", "excepteur", "Magna", "chillwave", "DIY", "beard", "mlkshk", "McSweeney's", "nostrud", "cillum", "Irony", "consectetur", "master", "cleanse", "vero", "fingerstache", "VHS", "artisan", "mumblecore", "Small", "batch", "roof", "party", "voluptate", "messenger", "bag", "narwhal", "Austin", "Etsy", "PBR", "cred", "lomo", "chambray", "magna", "wayfarers", "next level", "Aliquip", "assumenda", "meditation", "chia", "iPhone", "pork", "belly", "pop-up", "Neutra", "proident", "aliqua", "Blue Bottle", "selvage", "magna", "Pitchfork", "banjo", "next level", "beard", "irony", "lo-fi", "id", "Vice", "tilde", "Quinoa", "Odd Future", "veniam", "bitters", "paleo", "sapiente", "accusamus", "Tofu", "excepteur", "Truffaut", "heirloom", "vegan", "selvage", "fashion", "axe", "ennui", "irure", "magna", "XOXO", "Williamsburg", "proident", "aesthetic", "Marfa Carles", "brunch", "High Life", "anime", "seitan", "sint", "Vice", "dolore", "locavore", "paleo", "swag", "do single-origin coffee", "sriracha", "placeat", "Crucifix", "roof party", "heirloom", "photo booth", "organic", "butcher", "before they sold out", "Keytar", "next level", "Godard", "Shoreditch", "Kickstarter", "whatever", "gluten-free", "8-bit", "art", "party", "mixtape", "cred", "freegan", "Intelligentsia", "Odio", "wolf", "cardigan", "art", "party", "pug", "actually", "butcher", "dreamcatcher", "exercitation", "pour-over", "culpa", "odio", "elit", "tofu", "trust", "fund", "Banksy", "pug", "twee", "Mlkshk", "leggings", "mollit", "plaid", "ad", "hashtag", "odio", "distillery", "esse", "consequat", "roof party", "Ea", "DIY", "scenester", "street art", "skateboard", "salvia", "culpa", "bespoke", "roof party", "fingerstache", "swag", "Occupy", "sint", "Brooklyn", "Carles", "tilde", "cillum", "ennui", "Mixtape", "irony", "flannel", "nisi", "raw", "denim", "Banh", "mi", "swag", "esse", "Odd Future", "anim", "Marfa", "bicycle", "rights", "ullamco", "officia", "Freegan", "eu", "crucifix", "Banksy", "cliche", "biodiesel", "fixie", "sustainable", "Umami", "PBR", "street", "art", "nostrud", "scenester", "bicycle", "rights", "master", "cleanse", "cray", "taxidermy", "twee", "gastropub", "Shoreditch", "minim", "Neutra", "Ullamco", "gastropub", "Wes Anderson", "bespoke", "Non", "meggings", "skateboard", "vero", "pour-over", "craft beer", "dolor", "odio", "flexitarian", "consequat", "normcore", "sartorial", "Kale", "chips", "put a bird on it", "beard", "Neutra", "drinking", "vinegar", "pork", "belly", "Bushwick", "Williamsburg", "Banksy", "Echo", "Park", "street art", "ad", "McSweeney's", "photo booth", "dolore", "twee", "semiotics", "sint", "brunch", "narwhal", "XOXO", "authentic", "quinoa", "labore", "Paleo", "Neutra", "Godard", "chambray", "assumenda", "shabby", "chic", "sapiente", "lumbersexual", "sartorial", "Occaecat", "put a bird on it", "quinoa", "Tumblr", "salvia", "pork", "belly", "flexitarian", "Intelligentsia", "pariatur", "jean", "shorts", "fingerstache", "meditation", "crucifix", "sint"] | |
//- first letter to uppercase | |
mixin capitalize(string) | |
= string.charAt(0).toUpperCase() + string.slice(1) | |
//- begin a new sentence | |
mixin beginSentence(string) | |
= '. ' | |
mixin capitalize(string) | |
- var maxWords = words.length - 1 | |
//- howmany: number of words in paragraph | |
//- loremipsum: include the paragraph typical initiation? | |
mixin lorem(howmany, loremipsum) | |
//- include lorem ipsum? | |
if loremipsum || typeof loremipsum == 'undefined' | |
= 'Lorem ipsum dolor sit amet. ' | |
- for (var i = 0; i < howmany; i++) { | |
- var nextWord = words[Math.floor((Math.random()*maxWords))] | |
if (i == 0) | |
mixin capitalize(nextWord) | |
else | |
if ! parseInt(i % colonEvery) && (howmany - i > colonEvery) | |
mixin beginSentence(nextWord) | |
else | |
= ' ' + nextWord | |
if i == howmany - 1 | |
= '.' | |
- } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment