Files
WinnieAPI-v2/public/tools/lorem.html
T
2026-05-01 20:02:13 +02:00

38 lines
2.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- ═══════════════ LOREM ═══════════════ -->
<div class="page" id="page-lorem">
<button class="back-btn" onclick="showPage('home')">← Back to Tools</button>
<div class="section-header">
<h2><i class="fas fa-paragraph" style="color:var(--yellow)"></i> Lorem Ipsum Generator</h2>
<p>Generate placeholder text.</p>
</div>
<div style="max-width:720px;">
<div style="display:flex;gap:10px;align-items:center;margin-bottom:16px;">
<label style="font-size:0.85rem;color:var(--text-secondary);">Paragraphs:</label>
<input type="number" id="loremCount" value="3" min="1" max="20" style="width:80px;" />
<button class="btn btn-primary" onclick="generateLorem()"><i class="fas fa-feather"></i> Generate</button>
<button class="btn btn-green" onclick="copyOutput('loremOutput')"><i class="fas fa-copy"></i> Copy</button>
</div>
<textarea id="loremOutput" readonly placeholder="Generated text will appear here..." style="min-height:300px;"></textarea>
<div class="api-usage">
<button class="api-usage-toggle" onclick="toggleApiUsage(this)"><span><i class="fas fa-terminal"></i> API Usage <span class="badge">REST</span></span><i class="fas fa-chevron-down"></i></button>
<div class="api-usage-body">
<div class="api-baseurl-note">All examples use <code>BASE_URL</code> — set it to your deployment URL.</div>
<div class="api-endpoint">
<span class="api-method post">POST</span><span class="api-path">/api/lorem</span>
<div class="api-desc">Generate lorem ipsum placeholder text.</div>
<div class="api-code"><button class="api-code-copy" onclick="copyApiCode(this)">Copy</button><span class="kw">const</span> <span class="var">BASE_URL</span> = <span class="str">"http://localhost:3000"</span>;
<span class="kw">const</span> res = <span class="kw">await</span> <span class="fn">fetch</span>(<span class="var">`${BASE_URL}/api/lorem`</span>, {
method: <span class="str">"POST"</span>,
headers: { <span class="str">"Content-Type"</span>: <span class="str">"application/json"</span> },
body: JSON.<span class="fn">stringify</span>({ paragraphs: 3 }) <span class="cm">// 120</span>
});
<span class="kw">const</span> data = <span class="kw">await</span> res.<span class="fn">json</span>();
<span class="cm">// → { success: true, result: "Lorem ipsum dolor sit amet..." }</span></div>
</div>
</div>
</div>
</div>
</div>