Add member welcome modal and promote public login CTAs

- dashboard.php: welcome overlay modal on first visit, shows all 10 tool
  tips in a 2-col grid; localStorage key dbn-welcome-v1-seen persists
  dismiss; "Don't show again" checkbox (default checked); backdrop+Escape
  close without persisting
- index.php: Sign in / Join free buttons added to sticky nav; access gate
  section moved from page bottom to immediately after hero so login CTAs
  are the first thing a visitor sees without scrolling; gate card titles
  enlarged and top-border accent added for visual weight
- tools.css: .wlc-* welcome modal styles; .lt-nav__btn-signin/join nav
  CTA button styles; .lt-gate--prominent and .lt-gate__card-title--large

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 20:17:02 +02:00
parent b27ad348ff
commit e0aeefc73e
3 changed files with 368 additions and 47 deletions
+95
View File
@@ -149,8 +149,103 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
</a>
<?php endforeach; ?>
</section>
<!-- Welcome modal — shown once per browser until dismissed with "don't show again" -->
<div id="welcomeModal" class="wlc-backdrop" role="dialog" aria-modal="true" aria-labelledby="wlcTitle" hidden>
<div class="wlc-card">
<div class="wlc-header">
<p class="wlc-eyebrow"><?= htmlspecialchars(dbnToolsT('brand_line', $uiLang)) ?></p>
<h2 class="wlc-title" id="wlcTitle">Welcome to Do Better Norge Legal Tools</h2>
<p class="wlc-sub">Here&rsquo;s a quick look at what each tool does &mdash; click any card on the dashboard to go straight in.</p>
</div>
<div class="wlc-workbench-tip">
<span class="wlc-tip-icon" aria-hidden="true">💡</span>
<span><strong>Start with the Case Workbench</strong> &mdash; frame your situation first, then use the tools below with context already loaded.</span>
</div>
<div class="wlc-tools-grid">
<?php
$welcomeTips = [
'transcribe' => 'Upload a hearing recording to get an accurate, speaker-separated transcript',
'timeline' => 'Paste case notes to instantly map all key dates and Barnevernet milestones',
'redact' => 'Strip names and ID numbers before sharing any document with third parties',
'korrespond' => 'Draft authority letters in Norwegian + your language with verified citations',
'barnevernet' => 'Upload child-welfare documents to flag procedural violations and red flags',
'advocate' => 'Generate a fully-cited brief for your position from ECHR and Lovdata',
'deep-research' => 'Ask a complex legal question and get a multi-angle cited research brief',
'discrepancy' => 'Upload two doc versions to surface deleted facts or new allegations',
'corpus' => 'Browse the 220 K+ indexed legal passages behind every AI answer',
'citations' => 'Trace how cases cite each other to find supporting precedents',
];
$toolIcons = [
'transcribe' => '🎙',
'timeline' => '📅',
'redact' => '🔒',
'korrespond' => '✉️',
'barnevernet' => '🔍',
'advocate' => '⚖️',
'deep-research' => '🔬',
'discrepancy' => '🔎',
'corpus' => '📚',
'citations' => '🔗',
];
foreach ($tools as $slug => $item):
$tip = $welcomeTips[$slug] ?? $item['description'];
$icon = $toolIcons[$slug] ?? '🛠';
?>
<a class="wlc-tool-item" href="<?= htmlspecialchars($item['url']) ?>">
<span class="wlc-tool-icon" aria-hidden="true"><?= $icon ?></span>
<span class="wlc-tool-name"><?= htmlspecialchars($item['label']) ?></span>
<span class="wlc-tool-tip"><?= htmlspecialchars($tip) ?></span>
</a>
<?php endforeach; ?>
</div>
<div class="wlc-footer">
<label class="wlc-no-show">
<input type="checkbox" id="wlcDontShow" checked>
Don&rsquo;t show this again
</label>
<button id="wlcGetStarted" class="wlc-btn-start" type="button">Get started &rarr;</button>
</div>
</div>
</div>
</main>
<?php require_once __DIR__ . '/includes/footer.php'; ?>
<script src="assets/js/tools.js" defer></script>
<script>
(function () {
var STORAGE_KEY = 'dbn-welcome-v1-seen';
var modal = document.getElementById('welcomeModal');
var btnStart = document.getElementById('wlcGetStarted');
var chkDontShow = document.getElementById('wlcDontShow');
function closeModal(saveFlag) {
modal.hidden = true;
document.body.style.overflow = '';
if (saveFlag) {
try { localStorage.setItem(STORAGE_KEY, '1'); } catch (e) {}
}
}
if (modal && !localStorage.getItem(STORAGE_KEY)) {
modal.hidden = false;
document.body.style.overflow = 'hidden';
}
if (btnStart) {
btnStart.addEventListener('click', function () {
closeModal(chkDontShow && chkDontShow.checked);
});
}
if (modal) {
modal.addEventListener('click', function (e) {
if (e.target === modal) closeModal(false);
});
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape' && !modal.hidden) closeModal(false);
});
}
}());
</script>
</body>
</html>