Repository navigation
Expand file tree
/
Copy pathlorem-ipsum.html
More file actions
613 lines (558 loc) Β· 36.7 KB
/
Copy pathlorem-ipsum.html
File metadata and controls
613 lines (558 loc) Β· 36.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
<!DOCTYPE html>
<html lang="en">
<head>
<include src="_partials/meta-base.html"></include>
<title>Lorem Ipsum Generator β HTML Tools</title>
<meta name="description" content="Generate Lorem Ipsum placeholder text β paragraphs, sentences, words, or list items. Cupcake, Bacon, and Hipster dictionaries too. Runs in your browser β no installs, no tracking.">
<link rel="canonical" href="https://tools.mazipan.space/lorem-ipsum">
<meta property="og:title" content="Lorem Ipsum Generator β HTML Tools">
<meta property="og:description" content="Generate Lorem Ipsum placeholder text β paragraphs, sentences, words, or list items. Cupcake, Bacon, and Hipster dictionaries too. Runs in your browser β no installs, no tracking.">
<meta property="og:url" content="https://tools.mazipan.space/lorem-ipsum">
<meta name="twitter:title" content="Lorem Ipsum Generator β HTML Tools">
<meta name="twitter:description" content="Generate Lorem Ipsum placeholder text β paragraphs, sentences, words, or list items. Cupcake, Bacon, and Hipster dictionaries too. Runs in your browser β no installs, no tracking.">
<include src="_partials/meta-social.html"></include>
<link rel="icon" type="image/png" sizes="32x32" href="favicon-lorem-ipsum.png">
<include src="_partials/head-fonts.html"></include>
<link rel="stylesheet" href="styles.css">
<style>
.lorem-output {
width: 100%;
min-height: 500px;
background: #0b1220;
border: 1px solid #1f2937;
border-radius: 0.5rem;
color: #e5e7eb;
font-family: 'IBM Plex Mono', ui-monospace, monospace;
font-size: 0.85rem;
line-height: 1.65;
padding: 1rem 1.15rem;
resize: vertical;
outline: none;
transition: border-color 0.12s;
}
.lorem-output:focus { border-color: var(--accent-h); }
.control-block {
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.control-label {
font-size: 0.7rem;
font-weight: 600;
color: #9ca3af;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.pill-row {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
}
/* Light theme overrides */
html[data-theme="light"] .lorem-output {
background: #ffffff;
border-color: #d1d5db;
color: #111827;
}
html[data-theme="light"] .control-label { color: #6b7280; }
</style>
<include src="_partials/head-theme.html"></include>
<!-- BEGIN:json-ld generated by scripts/generate-sections.mjs β re-run after editing tools.json -->
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebApplication","name":"Lorem Ipsum Generator","url":"https://tools.mazipan.space/lorem-ipsum","description":"Generate Lorem Ipsum placeholder text β paragraphs, sentences, words, or list items, with Cupcake / Bacon / Hipster dictionaries too. Runs in your browser β no installs, no tracking.","applicationCategory":"DeveloperApplication","operatingSystem":"Any","browserRequirements":"Requires JavaScript","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"isPartOf":{"@type":"WebSite","name":"HTML Tools","url":"https://tools.mazipan.space/"}}</script>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"HTML Tools","item":"https://tools.mazipan.space/"},{"@type":"ListItem","position":2,"name":"Lorem Ipsum Generator","item":"https://tools.mazipan.space/lorem-ipsum"}]}</script>
<script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What does 'lorem ipsum' actually mean?","acceptedAnswer":{"@type":"Answer","text":"It's scrambled Latin adapted from Cicero's De finibus bonorum et malorum (45 BC), used as printer's filler since the 1500s. Designers reach for it because the unfamiliar letterforms keep the eye on layout instead of meaning."}},{"@type":"Question","name":"Why are there alternative dictionaries (Cupcake, Bacon, Hipster)?","acceptedAnswer":{"@type":"Answer","text":"Same purpose, more fun. Cupcake leans dessert words, Bacon leans meat words, Hipster leans artisanal-coffee-shop nouns. Pick whichever fits the vibe of what you're mocking up."}},{"@type":"Question","name":"Will the first paragraph always start with 'Lorem ipsum dolor sit ametβ¦'?","acceptedAnswer":{"@type":"Answer","text":"Only when the dictionary is set to Lorem and the 'Start with classic intro' toggle is on (both are the default). Turn it off if you want a fully random first sentence."}},{"@type":"Question","name":"Can I paste this into production copy?","acceptedAnswer":{"@type":"Answer","text":"No β it's nonsense Latin (or nonsense English). Treat it as a layout-only placeholder; replace it with real copy before shipping."}},{"@type":"Question","name":"Does my generated text ever leave my computer?","acceptedAnswer":{"@type":"Answer","text":"No. The page is a single static HTML file; all generation happens locally in your browser with no network requests."}}]}</script>
<!-- END:json-ld -->
</head>
<body class="bg-gray-950 text-gray-200 min-h-screen flex flex-col">
<header class="border-b border-gray-800 px-6 py-4">
<nav aria-label="Breadcrumb" class="max-w-[1100px] mx-auto flex items-center gap-3">
<a href="index.html" class="no-underline text-white font-bold text-lg tracking-tight hover:text-blue-400 transition-colors">HTML Tools</a>
<span class="text-gray-700">/</span>
<span class="text-gray-400 text-sm flex items-center gap-1.5" aria-current="page">π Lorem Ipsum Generator</span>
</nav>
</header>
<main class="max-w-[1100px] mx-auto w-full flex-1 py-8 px-6">
<header class="mb-7">
<h1 class="text-3xl font-bold text-white flex items-center gap-3">π Lorem Ipsum Generator</h1>
<p class="mt-1.5 text-sm text-gray-500">Generate placeholder text β paragraphs, sentences, words, or list items β with classic Lorem or a flavored dictionary.</p>
</header>
<div class="grid gap-6 md:grid-cols-[260px_1fr]">
<!-- ββ Controls column βββββββββββββββββββββββββββββββββββββββ -->
<aside class="flex flex-col gap-5">
<div class="control-block">
<span class="control-label">Dictionary</span>
<div class="pill-row" id="dict-row">
<button class="pill on" data-dict="lorem">π Lorem</button>
<button class="pill" data-dict="cupcake">π§ Cupcake</button>
<button class="pill" data-dict="bacon">π₯ Bacon</button>
<button class="pill" data-dict="hipster">π§ Hipster</button>
</div>
</div>
<div class="control-block">
<span class="control-label">Output mode</span>
<div class="pill-row" id="mode-row">
<button class="pill on" data-mode="paragraphs">Paragraphs</button>
<button class="pill" data-mode="sentences">Sentences</button>
<button class="pill" data-mode="words">Words</button>
<button class="pill" data-mode="list">List items</button>
</div>
</div>
<div class="control-block">
<span class="control-label">Count</span>
<input id="count" type="number" class="num-input" min="1" max="500" value="5" style="width: 100%;">
<span class="text-[0.7rem] text-gray-500" id="count-hint">5 paragraphs Β· 1β500</span>
</div>
<div class="control-block">
<span class="control-label">Options</span>
<label class="switch text-xs">
<input type="checkbox" id="opt-intro" checked>
<span>Start with classic intro</span>
</label>
<label class="switch text-xs" id="opt-wrap-label">
<input type="checkbox" id="opt-wrap">
<span>Wrap in <p> tags</span>
</label>
</div>
<button id="btn-shuffle" class="btn btn-secondary w-full" type="button">π² Shuffle</button>
</aside>
<!-- ββ Output column βββββββββββββββββββββββββββββββββββββββββ -->
<section class="flex flex-col gap-3 min-w-0">
<textarea id="output" class="lorem-output" readonly spellcheck="false" aria-label="Generated placeholder text"></textarea>
<div class="stats text-gray-400" id="stats">
0 paragraphs Β· 0 sentences Β· 0 words Β· 0 characters
</div>
<div class="flex flex-wrap gap-2">
<button id="btn-copy" class="btn btn-primary" type="button">π Copy</button>
<button id="btn-download" class="btn btn-secondary" type="button">β¬οΈ Download</button>
<button id="btn-clear" class="btn btn-secondary" type="button">ποΈ Clear</button>
</div>
</section>
</div>
<section class="mt-12 grid gap-6 md:grid-cols-2">
<div>
<h2 class="text-xl font-bold text-white mb-4">About Lorem Ipsum</h2>
<p class="text-gray-400 leading-relaxed">Lorem ipsum is scrambled Latin filler β passages adapted from Cicero's <em>De finibus bonorum et malorum</em> (45 BC) and used by printers and designers since the 1500s. Because the letterforms are unfamiliar, the eye stays on layout, hierarchy, and rhythm instead of getting hooked on meaning.</p>
</div>
<div>
<h2 class="text-xl font-bold text-white mb-4">How to use</h2>
<ol class="text-gray-400 leading-relaxed space-y-2 list-decimal list-inside">
<li>Pick a dictionary β classic Lorem or one of the flavored variants.</li>
<li>Pick an output mode and how many of them you want.</li>
<li>Tweak the options β classic intro and <code><p></code> wrapping.</li>
<li>Click <strong class="text-gray-300">Shuffle</strong> for a fresh take, then Copy or Download.</li>
</ol>
</div>
<div>
<h2 class="text-xl font-bold text-white mb-4">Common use cases</h2>
<ul class="text-gray-400 leading-relaxed space-y-2 list-disc list-inside">
<li>Sanity-checking line-height, leading, and column width in a mockup.</li>
<li>Filling a CMS template before real copy is ready.</li>
<li>Demoing a component library or pattern with realistic-looking content.</li>
<li>Stress-testing truncation and overflow in cards, tooltips, and tables.</li>
</ul>
</div>
<div>
<h2 class="text-xl font-bold text-white mb-4">Tips</h2>
<ul class="text-gray-400 leading-relaxed space-y-2 list-disc list-inside">
<li>Toggle <em>Start with classic intro</em> off for fully random first sentences.</li>
<li>Use <em>List items</em> mode for menu, nav, or bullet-list mock copy.</li>
<li>Switch to <em>Cupcake</em>, <em>Bacon</em>, or <em>Hipster</em> if a client keeps reading the Latin.</li>
<li>Always replace placeholder text before shipping β it's nonsense.</li>
</ul>
</div>
</section>
</main>
<script>
// ββ Dictionaries βββββββββββββββββββββββββββββββββββββββββββ
// Each ~150 words; total payload well under 10 KB gzipped.
const DICTIONARIES = {
lorem: ('lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua enim ad minim veniam quis nostrud exercitation ullamco laboris nisi aliquip ex ea commodo consequat duis aute irure in reprehenderit voluptate velit esse cillum eu fugiat nulla pariatur excepteur sint occaecat cupidatat non proident sunt culpa qui officia deserunt mollit anim id est laborum at vero eos accusamus iusto odio dignissimos ducimus blanditiis praesentium voluptatum deleniti atque corrupti quos dolores quas molestias excepturi sint obcaecati provident similique mollitia animi laborum dolorum fuga harum quidem rerum facilis expedita distinctio nam libero tempore cum soluta nobis eligendi optio cumque nihil impedit minus quod maxime placeat facere possimus assumenda repellendus temporibus autem quibusdam aut officiis debitis necessitatibus saepe eveniet repudiandae recusandae itaque earum hic tenetur sapiente delectus reiciendis maiores alias perferendis doloribus asperiores').split(' '),
cupcake: ('cake cupcake jelly sugar candy dessert tart pudding tiramisu macaroon donut brownie pastry biscuit cookie waffle pancake croissant scone muffin marshmallow caramel chocolate vanilla strawberry raspberry blueberry lemon honey syrup sprinkle frosting glaze icing buttercream meringue ganache truffle fondant praline toffee fudge marzipan nougat butterscotch cinnamon nutmeg coconut almond hazelnut pistachio peanut walnut pecan cherry peach apricot mango banana pineapple maple oat sesame poppy lavender rosewater mint matcha espresso mocha latte cocoa cream cheese mascarpone yogurt custard mousse soufflΓ© ice cream sorbet gelato cobbler crumble pavlova tres-leches cheesecake bundt sponge madeleine eclair canelΓ© crepe profiterole babka shortbread rugelach baklava cannoli churro flan pie tart parfait sundae trifle dumpling roll loaf bar slice bite drop dip drizzle dust crumb crust shell layer swirl ribbon dollop morsel nibble treat sweet bake oven kitchen baker confection bakery patisserie boulangerie').split(' '),
bacon: ('bacon pork beef ham sausage steak ribs brisket chop loin shank shoulder belly cutlet jerky pastrami prosciutto pancetta chorizo salami pepperoni mortadella bratwurst kielbasa frankfurter meatball meatloaf burger patty fillet tenderloin sirloin ribeye flank rump skirt chuck wing thigh drumstick breast leg roast smoke grill sear braise stew cure brine rub glaze marinade barbecue sauce gravy fat marrow rind crackling crust char bone gristle stock broth jus reduction butcher cleaver slab cut trim slice strip rasher mince hash skewer kebab gyro shawarma carnitas corned andouille chistorra coppa speck guanciale tasso bresaola bologna pulled smoked cured grilled roasted charred braised seared honey-glazed maple-cured peppered hickory mesquite cherry-wood apple-wood oak smokehouse butchery deli pit hearth ember coal fire flame smoker grate spit rotisserie skillet cast-iron pan plank').split(' '),
hipster: ('artisan beard vinyl mustache fixie kombucha tote selvage denim flannel cardigan beanie reclaimed salvaged repurposed upcycled small-batch cold-press locavore farm-to-table organic free-range pasture-raised heirloom seasonal foraged hand-thrown hand-poured hand-stitched typewriter polaroid mixtape cassette record turntable craft local indie ethical sustainable mindful intentional curated bespoke twee whimsical quirky vintage retro authentic raw rustic gritty roasted single-origin pour-over chemex aeropop espresso macchiato cortado flat-white latte cappuccino cold-brew nitro bitters absinthe mezcal kombu shrub matcha turmeric ashwagandha kale quinoa farro tempeh seitan kombuchery brewery distillery roastery creamery apothecary mercantile collective workshop atelier loft warehouse mill barn shed cottage cabin pop-up storefront market bazaar fair flea swap thrift dispensary studio gallery printmaker letterpress wheatpaste mural zine podcast newsletter substack tumblr microblog pickled fermented brined aged sourdough hand-rolled').split(' ')
};
// Classic Lorem intro β always available; only used when dict=lorem + opt-intro.
const CLASSIC_INTRO = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
// ββ State ββββββββββββββββββββββββββββββββββββββββββββββββββ
const state = {
dict: 'lorem',
mode: 'paragraphs',
count: 5,
intro: true,
wrap: false,
seed: 0
};
const DEFAULT_COUNT = { paragraphs: 5, sentences: 10, words: 50, list: 10 };
const MODE_LABEL = { paragraphs: 'paragraphs', sentences: 'sentences', words: 'words', list: 'list items' };
// ββ Seedable PRNG (mulberry32) βββββββββββββββββββββββββββββ
function mulberry32(seed) {
let a = seed >>> 0;
return function () {
a = (a + 0x6d2b79f5) >>> 0;
let t = a;
t = Math.imul(t ^ (t >>> 15), t | 1);
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
};
}
function pickRand(rand, arr) { return arr[Math.floor(rand() * arr.length)]; }
function intRand(rand, min, max) { return min + Math.floor(rand() * (max - min + 1)); }
// ββ Generators βββββββββββββββββββββββββββββββββββββββββββββ
function makeSentence(rand, words, opts = {}) {
const len = intRand(rand, 6, 14);
const picked = [];
for (let i = 0; i < len; i++) picked.push(pickRand(rand, words));
// Internal punctuation: ~25% chance of a comma somewhere mid-sentence,
// ~10% chance of a semicolon. Keep them away from the first/last word.
if (len >= 8 && rand() < 0.25) {
const idx = intRand(rand, 2, len - 3);
picked[idx] += ',';
}
if (len >= 10 && rand() < 0.1) {
const idx = intRand(rand, 3, len - 3);
picked[idx] += ';';
}
let s = picked.join(' ');
s = s.charAt(0).toUpperCase() + s.slice(1);
s += '.';
if (opts.classicFirst) s = CLASSIC_INTRO + ' ' + s;
return s;
}
function makeParagraph(rand, words, opts = {}) {
const sentenceCount = intRand(rand, 3, 7);
const sentences = [];
for (let i = 0; i < sentenceCount; i++) {
sentences.push(makeSentence(rand, words, i === 0 ? opts : {}));
}
return sentences.join(' ');
}
function generate(s) {
const rand = mulberry32(s.seed);
const words = DICTIONARIES[s.dict];
const useIntro = s.intro && s.dict === 'lorem';
if (s.mode === 'paragraphs') {
const out = [];
for (let i = 0; i < s.count; i++) {
out.push(makeParagraph(rand, words, i === 0 ? { classicFirst: useIntro } : {}));
}
if (s.wrap) return out.map(p => `<p>${p}</p>`).join('\n');
return out.join('\n\n');
}
if (s.mode === 'sentences') {
const out = [];
for (let i = 0; i < s.count; i++) {
out.push(makeSentence(rand, words, i === 0 ? { classicFirst: useIntro } : {}));
}
return out.join(' ');
}
if (s.mode === 'words') {
const out = [];
for (let i = 0; i < s.count; i++) out.push(pickRand(rand, words));
let str = out.join(' ');
str = str.charAt(0).toUpperCase() + str.slice(1);
if (useIntro) {
// Inject the first three classic words at the start of the run.
const classic = 'Lorem ipsum dolor'.split(' ').slice(0, Math.min(3, s.count));
for (let i = 0; i < classic.length; i++) out[i] = classic[i];
str = out.join(' ');
str = str.charAt(0).toUpperCase() + str.slice(1);
}
return str;
}
if (s.mode === 'list') {
const out = [];
for (let i = 0; i < s.count; i++) {
// List items: short noun-phrase, 2β5 words, sentence-cased, no trailing period.
const len = intRand(rand, 2, 5);
const picked = [];
for (let j = 0; j < len; j++) picked.push(pickRand(rand, words));
let line = picked.join(' ');
line = line.charAt(0).toUpperCase() + line.slice(1);
out.push(line);
}
return out.join('\n');
}
return '';
}
// ββ Stats ββββββββββββββββββββββββββββββββββββββββββββββββββ
function countStats(text) {
if (!text) return { paragraphs: 0, sentences: 0, words: 0, characters: 0 };
// Strip <p> tags for counting so wrapped output still reports content stats.
const plain = text.replace(/<\/?p>/g, '');
const paragraphs = plain.trim() ? plain.split(/\n{2,}|\n(?=\S)/).filter(p => p.trim()).length : 0;
const sentences = (plain.match(/[.!?]+(?=\s|$)/g) || []).length;
const words = plain.trim() ? plain.trim().split(/\s+/).length : 0;
const characters = plain.length;
return { paragraphs, sentences, words, characters };
}
// ββ DOM wiring βββββββββββββββββββββββββββββββββββββββββββββ
const $ = id => document.getElementById(id);
function render() {
const text = generate(state);
$('output').value = text;
const c = countStats(text);
$('stats').textContent = `${c.paragraphs} paragraph${c.paragraphs === 1 ? '' : 's'} Β· ${c.sentences} sentence${c.sentences === 1 ? '' : 's'} Β· ${c.words} word${c.words === 1 ? '' : 's'} Β· ${c.characters} character${c.characters === 1 ? '' : 's'}`;
}
function updateCountHint() {
$('count-hint').textContent = `${state.count} ${MODE_LABEL[state.mode]} Β· 1β500`;
}
function updateIntroSwitch() {
const introBox = $('opt-intro');
const introLabel = introBox.parentElement;
if (state.dict === 'lorem') {
introBox.disabled = false;
introLabel.style.opacity = '';
introLabel.style.cursor = '';
} else {
introBox.disabled = true;
state.intro = false;
introBox.checked = false;
introLabel.style.opacity = '0.5';
introLabel.style.cursor = 'not-allowed';
}
}
function updateWrapSwitch() {
const wrapBox = $('opt-wrap');
const wrapLabel = wrapBox.parentElement;
if (state.mode === 'paragraphs') {
wrapBox.disabled = false;
wrapLabel.style.opacity = '';
wrapLabel.style.cursor = '';
} else {
wrapBox.disabled = true;
wrapLabel.style.opacity = '0.5';
wrapLabel.style.cursor = 'not-allowed';
}
}
function setDictionary(d) {
state.dict = d;
document.querySelectorAll('#dict-row .pill').forEach(el => {
el.classList.toggle('on', el.dataset.dict === d);
});
updateIntroSwitch();
render();
}
function setMode(m) {
const wasMode = state.mode;
state.mode = m;
document.querySelectorAll('#mode-row .pill').forEach(el => {
el.classList.toggle('on', el.dataset.mode === m);
});
// Snap count to the new mode's default β but only when the user hasn't
// moved off the previous mode's default (i.e. they probably want a fresh
// sensible value rather than carrying 50 over from Words β Paragraphs).
if (state.count === DEFAULT_COUNT[wasMode]) {
state.count = DEFAULT_COUNT[m];
$('count').value = state.count;
}
updateCountHint();
updateWrapSwitch();
render();
}
function shuffle() {
state.seed = (Math.random() * 0xffffffff) >>> 0;
render();
}
function copyOutput() {
const text = $('output').value;
if (!text) return;
navigator.clipboard.writeText(text).then(() => flashCopied());
}
function downloadOutput() {
const text = $('output').value;
if (!text) return;
const safeMode = state.mode;
const filename = `lorem-ipsum-${safeMode}-${state.count}.txt`;
const blob = new Blob([text], { type: 'text/plain;charset=utf-8' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
a.remove();
URL.revokeObjectURL(url);
}
function clearOutput() {
$('output').value = '';
$('stats').textContent = '0 paragraphs Β· 0 sentences Β· 0 words Β· 0 characters';
}
function flashCopied() {
const banner = document.createElement('div');
banner.textContent = 'Copied!';
banner.style.cssText = 'position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#1f2937;color:#f9fafb;padding:0.5rem 1rem;border-radius:6px;font-size:0.8rem;z-index:9999;border:1px solid var(--accent-h);';
document.body.appendChild(banner);
setTimeout(() => banner.remove(), 1200);
}
// Select-all when the output textarea is focused, so clicking copies easily.
$('output').addEventListener('focus', e => e.target.select());
// Dictionary + mode pill rows
$('dict-row').addEventListener('click', e => {
const btn = e.target.closest('.pill[data-dict]');
if (btn) setDictionary(btn.dataset.dict);
});
$('mode-row').addEventListener('click', e => {
const btn = e.target.closest('.pill[data-mode]');
if (btn) setMode(btn.dataset.mode);
});
// Count input
$('count').addEventListener('input', e => {
let v = parseInt(e.target.value, 10);
if (!Number.isFinite(v)) v = 1;
v = Math.max(1, Math.min(500, v));
state.count = v;
updateCountHint();
render();
});
// Option switches
$('opt-intro').addEventListener('change', e => {
state.intro = e.target.checked;
render();
});
$('opt-wrap').addEventListener('change', e => {
state.wrap = e.target.checked;
render();
});
// Action buttons
$('btn-shuffle').addEventListener('click', shuffle);
$('btn-copy').addEventListener('click', copyOutput);
$('btn-download').addEventListener('click', downloadOutput);
$('btn-clear').addEventListener('click', clearOutput);
// ββ Init βββββββββββββββββββββββββββββββββββββββββββββββββββ
state.seed = (Math.random() * 0xffffffff) >>> 0;
updateCountHint();
updateIntroSwitch();
updateWrapSwitch();
render();
</script>
<include src="_partials/footer-script.html"></include>
<!-- BEGIN:faq generated by scripts/generate-sections.mjs β re-run after editing tools.json -->
<section class="max-w-[1100px] mx-auto w-full px-6 py-8 border-t border-gray-800">
<h2 class="text-xl font-bold text-white mb-6">FAQ</h2>
<div class="space-y-2">
<details class="disclosure">
<summary>What does 'lorem ipsum' actually mean?</summary>
<div class="disclosure-content"><div class="disclosure-body">It's scrambled Latin adapted from Cicero's De finibus bonorum et malorum (45 BC), used as printer's filler since the 1500s. Designers reach for it because the unfamiliar letterforms keep the eye on layout instead of meaning.</div></div>
</details>
<details class="disclosure">
<summary>Why are there alternative dictionaries (Cupcake, Bacon, Hipster)?</summary>
<div class="disclosure-content"><div class="disclosure-body">Same purpose, more fun. Cupcake leans dessert words, Bacon leans meat words, Hipster leans artisanal-coffee-shop nouns. Pick whichever fits the vibe of what you're mocking up.</div></div>
</details>
<details class="disclosure">
<summary>Will the first paragraph always start with 'Lorem ipsum dolor sit ametβ¦'?</summary>
<div class="disclosure-content"><div class="disclosure-body">Only when the dictionary is set to Lorem and the 'Start with classic intro' toggle is on (both are the default). Turn it off if you want a fully random first sentence.</div></div>
</details>
<details class="disclosure">
<summary>Can I paste this into production copy?</summary>
<div class="disclosure-content"><div class="disclosure-body">No β it's nonsense Latin (or nonsense English). Treat it as a layout-only placeholder; replace it with real copy before shipping.</div></div>
</details>
<details class="disclosure">
<summary>Does my generated text ever leave my computer?</summary>
<div class="disclosure-content"><div class="disclosure-body">No. The page is a single static HTML file; all generation happens locally in your browser with no network requests.</div></div>
</details>
</div>
</section>
<!-- END:faq -->
<!-- BEGIN:more-tools generated by scripts/generate-sections.mjs β re-run after editing tools.json -->
<section class="max-w-[1100px] mx-auto w-full px-6 py-8 border-t border-gray-800">
<h2 class="text-xl font-bold text-white mb-6">More tools</h2>
<div class="space-y-4">
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">JSON</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/json-formatter" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">ποΈ JSON Formatter</a>
<a href="/json-to-ts" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π· JSON to TypeScript</a>
<a href="/json-diff" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π JSON Diff</a>
<a href="/json-sort" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π€ JSON Sort</a>
<a href="/csv-to-json" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π JSON β CSV</a>
<a href="/json-to-yaml" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π JSON β YAML</a>
<a href="/json-to-schema" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π‘οΈ JSON to Validator Schema</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Code</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/regex-tester" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π§ͺ Regex Tester</a>
<a href="/svg-to-jsx" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">βοΈ SVG to JSX</a>
<a href="/svg-rasterizer" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π· SVG to Raster</a>
<a href="/cron-decoder" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">β±οΈ Cron Decoder</a>
<a href="/snippet-to-image" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">πΈ Code Snippet to Image</a>
<a href="/text-diff" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π Text Diff</a>
<a href="/markdown-preview" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π Markdown Preview</a>
<a href="/semver-checker" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π·οΈ SemVer Checker</a>
<a href="/jwt-decoder" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π JWT Decoder</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Ornaments</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/gradients" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π¨ Gradients</a>
<a href="/blob" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π«§ Blob Generator</a>
<a href="/waves" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">γ°οΈ Wave Generator</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Image</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/image-compressor" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">ποΈ Image Compressor</a>
<a href="/image-resizer" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π Image Resizer</a>
<a href="/image-cropper" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">βοΈ Image Cropper</a>
<a href="/image-converter" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">πΌοΈ Image Format Converter</a>
<a href="/image-watermark" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π Image Watermark</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Audio</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/mp3-tag-editor" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π΅ MP3 Tag Editor</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Web / SEO</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/meta-tag-preview" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π Meta Tag Preview</a>
<a href="/user-agent-parser" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π΅οΈ User Agent Parser</a>
<a href="/og-image-builder" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">πΌοΈ OG Image Builder</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Generators</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/qr-code-generator" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π± QR Code Generator</a>
<a href="/avatar-generator" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π€ Avatar Generator</a>
<a href="/favicon-generator" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">β Favicon Generator</a>
<a href="/uuid-generator" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">πͺͺ UUID Generator</a>
<a href="/wheel-of-names" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π‘ Wheel of Names</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">PDF</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/pdf-merger" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π PDF Merger</a>
<a href="/image-to-pdf" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π Image to PDF</a>
<a href="/pdf-compressor" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π€ PDF Compressor</a>
<a href="/pdf-splitter" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">βοΈ PDF Splitter</a>
<a href="/pdf-page-manager" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">ποΈ PDF Page Manager</a>
<a href="/pdf-watermark" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π§ PDF Watermark</a>
<a href="/pdf-signature" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">βοΈ PDF Signature</a>
<a href="/pdf-to-image" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">πΌοΈ PDF to Image</a>
</div>
</div>
<div>
<h3 class="text-xs font-semibold uppercase tracking-wider text-gray-500 mb-2">Time</h3>
<div class="flex flex-wrap gap-x-5 gap-y-2">
<a href="/pomodoro-timer" class="text-sm text-gray-300 hover:text-blue-400 transition-colors no-underline">π
Pomodoro Timer</a>
</div>
</div>
</div>
</section>
<!-- END:more-tools -->
<footer class="max-w-[1100px] mx-auto w-full py-8 px-6 border-t border-gray-800 text-center text-sm text-gray-600">
<div>© <span id="year"></span> <a href="https://mazipan.space" rel="noreferrer noopener" target="_blank" class="text-blue-400 transition-colors">Irfan Maulana</a> & Claude</div>
<div><span id="deploy-time"></span></div>
<div><span id="commit-sha"></span><a href="https://github.com/mazipan/html-tools" rel="noreferrer noopener" target="_blank" class="text-blue-400 transition-colors">Source</a></div>
<div><a href="design-system.html" rel="nofollow" class="text-blue-400 transition-colors">Design system</a></div>
<div><a href="https://baca-quran.id" rel="noreferrer noopener" target="_blank" class="text-blue-400 transition-colors">Baca Quran</a> Β· <a href="https://games.mazipan.space" rel="noreferrer noopener" target="_blank" class="text-blue-400 transition-colors">Games</a></div>
</footer>
</body>
</html>