Last active
December 10, 2016 23:58
-
-
Save andrewliebchen/ad840e87cd17383abfbb6f6bc1e9a941 to your computer and use it in GitHub Desktop.
Lorem Ipsum generator module for FramerJS
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
# Lorem Ipsum generator module for FramerJS | |
# Place this file in the /modules folder | |
# Add LoremIpsum = require 'LoremIpsum' | |
# To use, call the function with the number of words you want... | |
# `LoremIpsum(5)` | |
dictionary = [ | |
'ad', | |
'adipisicing', | |
'aliqua', | |
'aliquip', | |
'amet', | |
'anim', | |
'aute', | |
'cillum', | |
'commodo', | |
'consectetur', | |
'consequat', | |
'culpa', | |
'cupidatat', | |
'deserunt', | |
'do', | |
'dolor', | |
'dolore', | |
'duis', | |
'ea', | |
'eiusmod', | |
'elit', | |
'enim', | |
'esse', | |
'est', | |
'et', | |
'eu', | |
'ex', | |
'excepteur', | |
'exercitation', | |
'fugiat', | |
'id', | |
'in', | |
'incididunt', | |
'ipsum', | |
'irure', | |
'labore', | |
'laboris', | |
'laborum', | |
'Lorem', | |
'magna', | |
'minim', | |
'mollit', | |
'nisi', | |
'non', | |
'nostrud', | |
'nulla', | |
'occaecat', | |
'officia', | |
'pariatur', | |
'proident', | |
'qui', | |
'quis', | |
'reprehenderit', | |
'sint', | |
'sit', | |
'sunt', | |
'tempor', | |
'ullamco', | |
'ut', | |
'velit', | |
'veniam', | |
'voluptate' | |
] | |
capitalize = (string) -> | |
return string.charAt(0).toUpperCase() + string.slice(1) | |
LoremIpsum = (length) -> | |
array = [] | |
for i in [0..length] | |
array.push(Utils.randomChoice(dictionary)) | |
return capitalize(array.slice(0, array.length - 1).join(' ')) | |
module.exports = LoremIpsum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment