Create placeholder text to use in your graphic and web design projects when the final text isn’t available. Choose how many paragraphs, sentences and words you would like to include.
export const take = [
{ key: "p", type: "number", max: 20, label: "Paragraphs" },
{ key: "s", type: "number", max: 20, label: "Sentences" },
{ key: "w", type: "number", max: 50, label: "Words" },
{
type: "script",
value: "https://cdn.jsdelivr.net/npm/fast-lorem-ipsum@1.2.0/dist/fli.js",
},
]
export const make = (data) => {
const cap = (w) => w[0].toUpperCase() + w.slice(1)
let value = ""
let words = parser(data.p * data.s * data.w, "w").split(" ")
for (let i = 0; i < data.p; i++) {
for (let j = 0; j < data.s; j++) {
value += cap(words.splice(0, data.w).join(" "))
value += ". "
}
if (i < data.p - 1) value += "\n\n"
}
value = value.replace(/\,\./g, ".")
return [{ type: "text", value }]
}