a11y & SEO: fix source files - aria-labels, focus management, canonical, WebApplication schema, focus-visible
This commit is contained in:
parent
17c1f00e2b
commit
9095175141
4 changed files with 23 additions and 12 deletions
|
|
@ -25,6 +25,7 @@ function openSignup() {
|
|||
document.getElementById('signupEmail').value = '';
|
||||
document.getElementById('verifyCode').value = '';
|
||||
signupEmail = '';
|
||||
setTimeout(function() { document.getElementById('signupEmail').focus(); }, 100);
|
||||
}
|
||||
|
||||
function closeSignup() {
|
||||
|
|
@ -42,6 +43,7 @@ function openRecover() {
|
|||
document.getElementById('recoverEmailInput').value = '';
|
||||
document.getElementById('recoverCode').value = '';
|
||||
recoverEmail = '';
|
||||
setTimeout(function() { document.getElementById('recoverEmailInput').focus(); }, 100);
|
||||
}
|
||||
|
||||
function closeRecover() {
|
||||
|
|
@ -125,6 +127,8 @@ async function submitVerify() {
|
|||
|
||||
document.getElementById('apiKeyText').textContent = data.apiKey;
|
||||
showState('signupResult');
|
||||
var resultH2 = document.querySelector('#signupResult h2');
|
||||
if (resultH2) { resultH2.setAttribute('tabindex', '-1'); resultH2.focus(); }
|
||||
} catch (err) {
|
||||
errEl.textContent = 'Network error. Please try again.';
|
||||
errEl.style.display = 'block';
|
||||
|
|
@ -210,6 +214,8 @@ async function submitRecoverVerify() {
|
|||
if (data.apiKey) {
|
||||
document.getElementById('recoveredKeyText').textContent = data.apiKey;
|
||||
showRecoverState('recoverResult');
|
||||
var rH2 = document.querySelector('#recoverResult h2');
|
||||
if (rH2) { rH2.setAttribute('tabindex', '-1'); rH2.focus(); }
|
||||
} else {
|
||||
errEl.textContent = data.message || 'No key found for this email.';
|
||||
errEl.style.display = 'block';
|
||||
|
|
@ -457,6 +463,8 @@ async function submitEmailChangeVerify() {
|
|||
|
||||
document.getElementById('emailChangeNewDisplay').textContent = data.newEmail || emailChangeNewEmail;
|
||||
showEmailChangeState('emailChangeResult');
|
||||
var ecH2 = document.querySelector('#emailChangeResult h2');
|
||||
if (ecH2) { ecH2.setAttribute('tabindex', '-1'); ecH2.focus(); }
|
||||
} catch (err) {
|
||||
errEl.textContent = 'Network error. Please try again.';
|
||||
errEl.style.display = 'block';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!-- Signup Modal -->
|
||||
<div class="modal-overlay" id="signupModal" role="dialog" aria-label="Sign up for API key">
|
||||
<div class="modal-overlay" id="signupModal" role="dialog" aria-modal="true" aria-label="Sign up for API key">
|
||||
<div class="modal">
|
||||
<button class="close" id="btn-close-signup" aria-label="Close">×</button>
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="signup-error" id="signupError"></div>
|
||||
<label for="signupEmail" class="sr-only">Email address</label>
|
||||
<input type="email" id="signupEmail" placeholder="your.email@example.com" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:16px;" required>
|
||||
<button class="btn btn-primary" style="width:100%" id="signupBtn">Generate API Key →</button>
|
||||
<button class="btn btn-primary" style="width:100%" id="signupBtn" aria-label="Generate API key">Generate API Key →</button>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.8rem;text-align:center;">100 free PDFs/month • All endpoints included<br><a href="#" class="open-recover" style="color:var(--muted)">Lost your API key? Recover it →</a></p>
|
||||
</div>
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="signup-error" id="verifyError"></div>
|
||||
<label for="verifyCode" class="sr-only">Verification code</label>
|
||||
<input type="text" id="verifyCode" placeholder="123456" maxlength="6" pattern="[0-9]{6}" inputmode="numeric" style="width:100%;padding:14px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:1.4rem;letter-spacing:0.3em;text-align:center;margin-bottom:16px;font-family:monospace;" required>
|
||||
<button class="btn btn-primary" style="width:100%" id="verifyBtn">Verify →</button>
|
||||
<button class="btn btn-primary" style="width:100%" id="verifyBtn" aria-label="Verify code">Verify →</button>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.8rem;text-align:center;">Code expires in 15 minutes</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
<div style="background:var(--bg);border:1px solid var(--accent);border-radius:8px;padding:14px;font-family:monospace;font-size:0.82rem;word-break:break-all;margin:16px 0;position:relative;">
|
||||
<span id="apiKeyText"></span>
|
||||
<button onclick="copyKey()" id="copyBtn" style="position:absolute;top:8px;right:8px;background:var(--accent);color:var(--bg);border:none;border-radius:4px;padding:4px 12px;cursor:pointer;font-size:0.8rem;">Copy</button>
|
||||
<button onclick="copyKey()" id="copyBtn" aria-label="Copy API key" style="position:absolute;top:8px;right:8px;background:var(--accent);color:var(--bg);border:none;border-radius:4px;padding:4px 12px;cursor:pointer;font-size:0.8rem;">Copy</button>
|
||||
</div>
|
||||
<p style="margin-top:20px;color:var(--muted);font-size:0.9rem;">100 free PDFs/month • <a href="/docs">Read the docs →</a></p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -219,5 +219,5 @@ html, body {
|
|||
}
|
||||
|
||||
/* Focus-visible for accessibility */
|
||||
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.btn:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -14,10 +14,13 @@
|
|||
<meta name="twitter:title" content="DocFast — HTML & Markdown to PDF API">
|
||||
<meta name="twitter:description" content="Convert HTML and Markdown to beautiful PDFs with a simple API call.">
|
||||
<meta name="twitter:image" content="https://docfast.dev/og-image.png">
|
||||
<link rel="canonical" href="https://docfast.dev">
|
||||
<link rel="canonical" href="https://docfast.dev/">
|
||||
<script type="application/ld+json">
|
||||
{"@context":"https://schema.org","@type":"SoftwareApplication","name":"DocFast","url":"https://docfast.dev","applicationCategory":"DeveloperApplication","operatingSystem":"Web","description":"Convert HTML and Markdown to beautiful PDFs with a simple API call. Fast, reliable, developer-friendly.","offers":[{"@type":"Offer","price":"0","priceCurrency":"EUR","name":"Free","description":"100 PDFs/month"},{"@type":"Offer","price":"9","priceCurrency":"EUR","name":"Pro","description":"5,000 PDFs per month","billingIncrement":"P1M"}]}
|
||||
</script>
|
||||
<script type="application/ld+json">
|
||||
{"@context":"https://schema.org","@type":"WebApplication","name":"DocFast","url":"https://docfast.dev","browserRequirements":"Requires JavaScript. Requires HTML5.","applicationCategory":"DeveloperApplication","operatingSystem":"All","offers":[{"@type":"Offer","price":"0","priceCurrency":"EUR","name":"Free Tier","description":"100 PDFs per month, all endpoints included"},{"@type":"Offer","price":"9","priceCurrency":"EUR","name":"Pro","description":"5,000 PDFs per month, priority support","billingIncrement":"P1M"}]}
|
||||
</script>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>⚡</text></svg>">
|
||||
{{> styles_base}}
|
||||
{{> styles_index_extra}}
|
||||
|
|
@ -36,7 +39,7 @@
|
|||
<h1>HTML to <span class="gradient">PDF</span><br>in one API call</h1>
|
||||
<p>Convert HTML, Markdown, or URLs to pixel-perfect PDFs. Built-in templates for invoices & receipts. No headless browser headaches.</p>
|
||||
<div class="hero-actions">
|
||||
<button class="btn btn-primary" id="btn-signup">Get Free API Key →</button>
|
||||
<button class="btn btn-primary" id="btn-signup" aria-label="Get free API key">Get Free API Key →</button>
|
||||
<a href="/docs" class="btn btn-secondary">Read the Docs</a>
|
||||
</div>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.9rem;">Already have an account? <a href="#" class="open-recover" style="color:var(--accent);">Lost your API key? Recover it →</a></p>
|
||||
|
|
@ -147,7 +150,7 @@
|
|||
<li>All templates included</li>
|
||||
<li>Rate limiting: 10 req/min</li>
|
||||
</ul>
|
||||
<button class="btn btn-secondary" style="width:100%" id="btn-signup-2">Get Free API Key</button>
|
||||
<button class="btn btn-secondary" style="width:100%" id="btn-signup-2" aria-label="Get free API key">Get Free API Key</button>
|
||||
</div>
|
||||
<div class="price-card featured">
|
||||
<div class="price-name">Pro</div>
|
||||
|
|
@ -159,7 +162,7 @@
|
|||
<li>All templates included</li>
|
||||
<li>Priority support (<a href="mailto:support@docfast.dev">support@docfast.dev</a>)</li>
|
||||
</ul>
|
||||
<button class="btn btn-primary" style="width:100%" id="btn-checkout">Get Started →</button>
|
||||
<button class="btn btn-primary" style="width:100%" id="btn-checkout" aria-label="Get started with Pro plan">Get Started →</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -183,7 +186,7 @@
|
|||
<div class="signup-error" id="recoverError"></div>
|
||||
<label for="recoverEmailInput" class="sr-only">Email address</label>
|
||||
<input type="email" id="recoverEmailInput" placeholder="your.email@example.com" style="width:100%;padding:12px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:0.9rem;margin-bottom:16px;" required>
|
||||
<button class="btn btn-primary" style="width:100%" id="recoverBtn">Send Verification Code →</button>
|
||||
<button class="btn btn-primary" style="width:100%" id="recoverBtn" aria-label="Send verification code">Send Verification Code →</button>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.8rem;text-align:center;">Your key will be shown here after verification — never sent via email</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -198,7 +201,7 @@
|
|||
<div class="signup-error" id="recoverVerifyError"></div>
|
||||
<label for="recoverCode" class="sr-only">Verification code</label>
|
||||
<input type="text" id="recoverCode" placeholder="123456" maxlength="6" pattern="[0-9]{6}" inputmode="numeric" style="width:100%;padding:14px;border:1px solid var(--border);background:var(--bg);color:var(--fg);border-radius:8px;font-size:1.4rem;letter-spacing:0.3em;text-align:center;margin-bottom:16px;font-family:monospace;" required>
|
||||
<button class="btn btn-primary" style="width:100%" id="recoverVerifyBtn">Verify →</button>
|
||||
<button class="btn btn-primary" style="width:100%" id="recoverVerifyBtn" aria-label="Verify recovery code">Verify →</button>
|
||||
<p style="margin-top:16px;color:var(--muted);font-size:0.8rem;text-align:center;">Code expires in 15 minutes</p>
|
||||
</div>
|
||||
|
||||
|
|
@ -210,7 +213,7 @@
|
|||
</div>
|
||||
<div style="background:var(--bg);border:1px solid var(--accent);border-radius:8px;padding:14px;font-family:monospace;font-size:0.82rem;word-break:break-all;margin:16px 0;position:relative;">
|
||||
<span id="recoveredKeyText"></span>
|
||||
<button onclick="copyRecoveredKey()" id="copyRecoveredBtn" style="position:absolute;top:8px;right:8px;background:var(--accent);color:var(--bg);border:none;border-radius:4px;padding:4px 12px;cursor:pointer;font-size:0.8rem;">Copy</button>
|
||||
<button onclick="copyRecoveredKey()" id="copyRecoveredBtn" aria-label="Copy recovered API key" style="position:absolute;top:8px;right:8px;background:var(--accent);color:var(--bg);border:none;border-radius:4px;padding:4px 12px;cursor:pointer;font-size:0.8rem;">Copy</button>
|
||||
</div>
|
||||
<p style="margin-top:20px;color:var(--muted);font-size:0.9rem;"><a href="/docs">Read the docs →</a></p>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue