feat: unified landing page with auth-aware gate + /dashboard.php
Removes the logged-in vs logged-out page bifurcation. index.php now always renders the public landing (tools overview, hero, trust section) with auth-conditional nav/hero CTAs and a two-column member/register gate shown only to unauthenticated visitors. Authenticated workbench extracted to new dashboard.php. Adds 8 new i18n keys across all 4 languages and new CSS for auth-nav, hero CTA, two-column gate, and register buttons. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5319,3 +5319,252 @@ body.lt-landing {
|
|||||||
.lt-preview-hero__art { max-width: 100%; }
|
.lt-preview-hero__art { max-width: 100%; }
|
||||||
.lt-preview-output pre { font-size: 0.72rem; }
|
.lt-preview-output pre { font-size: 0.72rem; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ═══════════════════════════════════════════════════════════════════════════
|
||||||
|
AUTH-AWARE LANDING PAGE
|
||||||
|
═══════════════════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
|
/* ── Nav: logged-in state ───────────────────────────────────────────────── */
|
||||||
|
.lt-auth-nav {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.lt-auth-nav__email {
|
||||||
|
font-family: 'IBM Plex Mono', monospace;
|
||||||
|
font-size: 0.72rem;
|
||||||
|
color: rgba(255,255,255,0.55);
|
||||||
|
max-width: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.lt-nav__cta--enter {
|
||||||
|
background: #00205b;
|
||||||
|
border: 1px solid rgba(255,255,255,0.20);
|
||||||
|
}
|
||||||
|
.lt-nav__cta--enter:hover {
|
||||||
|
background: #0a3080;
|
||||||
|
box-shadow: 0 6px 18px rgba(0,32,91,0.50);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Hero: logged-in CTA ─────────────────────────────────────────────────── */
|
||||||
|
.lt-hero__auth-cta {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
.lt-hero__auth-check {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(0,212,128,0.18);
|
||||||
|
border: 1.5px solid rgba(0,212,128,0.45);
|
||||||
|
color: #00d480;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.lt-hero__auth-label {
|
||||||
|
font-family: 'IBM Plex Mono', monospace;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: rgba(255,255,255,0.55);
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
}
|
||||||
|
.lt-hero__enter-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 54px;
|
||||||
|
padding: 0 36px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: var(--lt-red);
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 1.05rem;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
text-decoration: none;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
transition: background 150ms, transform 150ms, box-shadow 150ms;
|
||||||
|
box-shadow: 0 6px 24px rgba(186,12,47,0.40);
|
||||||
|
}
|
||||||
|
.lt-hero__enter-btn:hover {
|
||||||
|
background: #9a0a26;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 12px 36px rgba(186,12,47,0.55);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Tools section: enter strip for logged-in users ─────────────────────── */
|
||||||
|
.lt-tools__enter-strip {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 2.5rem;
|
||||||
|
}
|
||||||
|
.lt-tools__enter-strip .lt-access-btn {
|
||||||
|
max-width: 320px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Access gate: two-column layout ─────────────────────────────────────── */
|
||||||
|
.lt-gate.lt-access {
|
||||||
|
padding: 0;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
.lt-gate.lt-access::before { display: none; }
|
||||||
|
.lt-gate__grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
min-height: 420px;
|
||||||
|
}
|
||||||
|
.lt-gate__card {
|
||||||
|
position: relative;
|
||||||
|
padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3.5rem);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0;
|
||||||
|
}
|
||||||
|
.lt-gate__card--member {
|
||||||
|
background: var(--lt-navy);
|
||||||
|
}
|
||||||
|
.lt-gate__card--member::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 10%;
|
||||||
|
right: 0;
|
||||||
|
bottom: 10%;
|
||||||
|
width: 1px;
|
||||||
|
background: rgba(255,255,255,0.10);
|
||||||
|
}
|
||||||
|
.lt-gate__card--register {
|
||||||
|
background: linear-gradient(145deg, #00205b 0%, #001540 100%);
|
||||||
|
}
|
||||||
|
.lt-gate__card-eyebrow {
|
||||||
|
font-family: 'IBM Plex Mono', monospace;
|
||||||
|
font-size: 0.68rem;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.12em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--lt-gold);
|
||||||
|
margin: 0 0 0.9rem;
|
||||||
|
opacity: 0.80;
|
||||||
|
}
|
||||||
|
.lt-gate__card-title {
|
||||||
|
font-family: 'Crimson Pro', serif;
|
||||||
|
font-size: clamp(1.6rem, 2.8vw, 2.2rem);
|
||||||
|
font-weight: 700;
|
||||||
|
color: #fff;
|
||||||
|
margin: 0 0 0.65rem;
|
||||||
|
line-height: 1.1;
|
||||||
|
}
|
||||||
|
.lt-gate__card-note {
|
||||||
|
color: rgba(255,255,255,0.55);
|
||||||
|
font-size: 0.90rem;
|
||||||
|
line-height: 1.72;
|
||||||
|
margin: 0 0 1.8rem;
|
||||||
|
max-width: 38ch;
|
||||||
|
}
|
||||||
|
/* inherit fallback-login styles inside cards */
|
||||||
|
.lt-gate__card .fallback-login summary {
|
||||||
|
color: rgba(255,255,255,0.42);
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 0.84rem;
|
||||||
|
margin-top: 0.6rem;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
.lt-gate__card .passcode-form {
|
||||||
|
margin-top: 1rem;
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.lt-gate__card .passcode-form label {
|
||||||
|
display: block;
|
||||||
|
color: rgba(255,255,255,0.60);
|
||||||
|
font-size: 0.84rem;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.lt-gate__card .passcode-form input {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px 14px;
|
||||||
|
border: 1px solid rgba(255,255,255,0.16);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(255,255,255,0.07);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
outline: none;
|
||||||
|
transition: border-color 150ms;
|
||||||
|
}
|
||||||
|
.lt-gate__card .passcode-form input:focus { border-color: rgba(244,197,66,0.50); }
|
||||||
|
.lt-gate__card .passcode-row { display: flex; gap: 8px; }
|
||||||
|
.lt-gate__card .passcode-row input { flex: 1; margin-bottom: 0; }
|
||||||
|
.lt-gate__card .passcode-row button {
|
||||||
|
padding: 0 18px;
|
||||||
|
background: var(--lt-gold);
|
||||||
|
color: var(--lt-navy);
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 0.90rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 140ms;
|
||||||
|
}
|
||||||
|
.lt-gate__card .passcode-row button:hover { background: #e2b230; }
|
||||||
|
.lt-gate__card .form-status { color: rgba(255,255,255,0.55); font-size: 0.82rem; margin-top: 8px; }
|
||||||
|
.lt-gate__card .lt-access-btn { width: 100%; box-sizing: border-box; }
|
||||||
|
|
||||||
|
/* ── Register buttons ────────────────────────────────────────────────────── */
|
||||||
|
.lt-register-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-height: 50px;
|
||||||
|
padding: 0 22px;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.96rem;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background 150ms, transform 140ms, box-shadow 140ms;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
.lt-register-btn--google {
|
||||||
|
background: #fff;
|
||||||
|
color: #3c3c3c;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 4px 16px rgba(0,0,0,0.25);
|
||||||
|
}
|
||||||
|
.lt-register-btn--google:hover {
|
||||||
|
background: #f1f1f1;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 8px 22px rgba(0,0,0,0.32);
|
||||||
|
}
|
||||||
|
.lt-register-btn--email {
|
||||||
|
background: transparent;
|
||||||
|
color: rgba(255,255,255,0.68);
|
||||||
|
border: 1px solid rgba(255,255,255,0.20);
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.lt-register-btn--email:hover {
|
||||||
|
background: rgba(255,255,255,0.07);
|
||||||
|
color: #fff;
|
||||||
|
border-color: rgba(255,255,255,0.40);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Responsive ─────────────────────────────────────────────────────────── */
|
||||||
|
@media (max-width: 760px) {
|
||||||
|
.lt-gate__grid { grid-template-columns: 1fr; }
|
||||||
|
.lt-gate__card--member::after { display: none; }
|
||||||
|
.lt-gate__card--member {
|
||||||
|
border-bottom: 1px solid rgba(255,255,255,0.10);
|
||||||
|
}
|
||||||
|
.lt-auth-nav__email { display: none; }
|
||||||
|
.lt-hero__auth-cta { gap: 8px; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/bootstrap.php';
|
||||||
|
|
||||||
|
if (!dbnToolsIsAuthenticated()) {
|
||||||
|
header('Location: /?return=' . urlencode($_SERVER['REQUEST_URI'] ?? '/dashboard.php'));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$uiLang = dbnToolsCurrentLanguage();
|
||||||
|
$tools = dbnToolsLaunchedTools($uiLang);
|
||||||
|
$langPath = '/dashboard.php';
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/tool-svgs.php';
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="<?= htmlspecialchars($uiLang) ?>">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title><?= htmlspecialchars(dbnToolsT('dashboard_title', $uiLang)) ?> — Do Better Norge</title>
|
||||||
|
<meta name="robots" content="noindex, nofollow">
|
||||||
|
<meta name="theme-color" content="#00205B">
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Roboto:wght@300;400;500;700&family=IBM+Plex+Mono:wght@400;700&display=swap">
|
||||||
|
<link rel="stylesheet" href="assets/css/tools.css">
|
||||||
|
</head>
|
||||||
|
<body data-authenticated="true" class="lt-app">
|
||||||
|
<script>
|
||||||
|
window.DBN_TOOLS_AUTHENTICATED = true;
|
||||||
|
window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<main id="appShell" class="app-shell dashboard-shell">
|
||||||
|
<header class="topbar">
|
||||||
|
<div>
|
||||||
|
<p class="eyebrow"><?= htmlspecialchars(dbnToolsT('brand_line', $uiLang)) ?></p>
|
||||||
|
<h1><?= htmlspecialchars(dbnToolsT('dashboard_title', $uiLang)) ?></h1>
|
||||||
|
<div class="case-no">
|
||||||
|
<span class="pulse"></span>
|
||||||
|
<span>family-legal</span>
|
||||||
|
<span class="case-sep">.</span>
|
||||||
|
<span><?= htmlspecialchars(dbnToolsT('retention', $uiLang)) ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="topbar-actions">
|
||||||
|
<nav class="shell-lang-switcher" aria-label="Language">
|
||||||
|
<?php foreach (dbnToolsSupportedLanguages() as $langCode): ?>
|
||||||
|
<a href="<?= htmlspecialchars($langPath . '?lang=' . $langCode) ?>" class="<?= $langCode === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($langCode)) ?></a>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</nav>
|
||||||
|
<span id="healthPill" class="status-pill"><?= htmlspecialchars(dbnToolsT('session_active', $uiLang)) ?></span>
|
||||||
|
<button id="healthButton" class="secondary-button" type="button"><?= htmlspecialchars(dbnToolsT('health', $uiLang)) ?></button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section class="manifesto dashboard-manifesto">
|
||||||
|
<div class="manifesto-copy">
|
||||||
|
<p class="manifesto-eyebrow"><?= htmlspecialchars(dbnToolsT('dashboard_eyebrow', $uiLang)) ?></p>
|
||||||
|
<h2 class="manifesto-title"><?= htmlspecialchars(dbnToolsT('manifesto_title', $uiLang)) ?></h2>
|
||||||
|
<p class="manifesto-sub"><?= htmlspecialchars(dbnToolsT('dashboard_sub', $uiLang)) ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="manifesto-stats" aria-label="Headline statistics">
|
||||||
|
<div class="manifesto-stat"><strong>23</strong><span><?= htmlspecialchars(dbnToolsT('stat_echr', $uiLang)) ?></span></div>
|
||||||
|
<div class="manifesto-stat"><strong>64%</strong><span><?= htmlspecialchars(dbnToolsT('stat_loss', $uiLang)) ?></span></div>
|
||||||
|
<div class="manifesto-stat"><strong>1,731</strong><span><?= htmlspecialchars(dbnToolsT('stat_tribunal', $uiLang)) ?></span></div>
|
||||||
|
<div class="manifesto-stat"><strong>20+</strong><span><?= htmlspecialchars(dbnToolsT('stat_pending', $uiLang)) ?></span></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="disclaimer" role="note"><?= htmlspecialchars(dbnToolsT('disclaimer', $uiLang)) ?></div>
|
||||||
|
|
||||||
|
<section class="tool-dashboard-grid" aria-label="Available tools">
|
||||||
|
<?php foreach ($tools as $slug => $item): ?>
|
||||||
|
<a class="dashboard-tool-card" href="<?= htmlspecialchars($item['url']) ?>">
|
||||||
|
<span class="dashboard-tool-card__icon"><?= htmlspecialchars($item['icon']) ?></span>
|
||||||
|
<span class="dashboard-tool-card__badge"><?= htmlspecialchars($item['badge']) ?></span>
|
||||||
|
<h2><?= htmlspecialchars($item['label']) ?></h2>
|
||||||
|
<p><?= htmlspecialchars($item['description']) ?></p>
|
||||||
|
<strong><?= htmlspecialchars(dbnToolsT('open_tool', $uiLang)) ?></strong>
|
||||||
|
</a>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
||||||
|
<script src="assets/js/tools.js" defer></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -119,6 +119,14 @@ function dbnToolsTranslations(): array
|
|||||||
'preview_join' => 'Not a member? Join Do Better Norge',
|
'preview_join' => 'Not a member? Join Do Better Norge',
|
||||||
'preview_input_label' => 'Sample input',
|
'preview_input_label' => 'Sample input',
|
||||||
'preview_output_label' => 'Sample output',
|
'preview_output_label' => 'Sample output',
|
||||||
|
'enter_workbench' => 'Open Workbench',
|
||||||
|
'signed_in_as' => 'Signed in as',
|
||||||
|
'member_card_title' => 'Already a member?',
|
||||||
|
'member_card_note' => 'Sign in with your Do Better Norge account. Google login is handled on the main site.',
|
||||||
|
'register_card_title' => 'New to Do Better Norge?',
|
||||||
|
'register_card_note' => 'Free for families navigating Norwegian child-welfare cases.',
|
||||||
|
'register_google' => 'Register with Google',
|
||||||
|
'register_email' => 'Register with email',
|
||||||
],
|
],
|
||||||
'no' => [
|
'no' => [
|
||||||
'meta_title' => 'Do Better Norge - juridiske AI-verktøy',
|
'meta_title' => 'Do Better Norge - juridiske AI-verktøy',
|
||||||
@@ -171,6 +179,14 @@ function dbnToolsTranslations(): array
|
|||||||
'preview_join' => 'Ikke medlem? Bli med i Do Better Norge',
|
'preview_join' => 'Ikke medlem? Bli med i Do Better Norge',
|
||||||
'preview_input_label' => 'Eksempel — inndata',
|
'preview_input_label' => 'Eksempel — inndata',
|
||||||
'preview_output_label' => 'Eksempel — utdata',
|
'preview_output_label' => 'Eksempel — utdata',
|
||||||
|
'enter_workbench' => 'Åpne arbeidsbenk',
|
||||||
|
'signed_in_as' => 'Innlogget som',
|
||||||
|
'member_card_title' => 'Allerede medlem?',
|
||||||
|
'member_card_note' => 'Logg inn med Do Better Norge-kontoen din. Google-pålogging skjer på hovedsiden.',
|
||||||
|
'register_card_title' => 'Ny bruker?',
|
||||||
|
'register_card_note' => 'Gratis for familier i norske barnevernssaker.',
|
||||||
|
'register_google' => 'Registrer med Google',
|
||||||
|
'register_email' => 'Registrer med e-post',
|
||||||
],
|
],
|
||||||
'uk' => [
|
'uk' => [
|
||||||
'meta_title' => 'Do Better Norge - юридичні AI інструменти',
|
'meta_title' => 'Do Better Norge - юридичні AI інструменти',
|
||||||
@@ -223,6 +239,14 @@ function dbnToolsTranslations(): array
|
|||||||
'preview_join' => 'Не член? Приєднайтесь до Do Better Norge',
|
'preview_join' => 'Не член? Приєднайтесь до Do Better Norge',
|
||||||
'preview_input_label' => 'Приклад — вхідні дані',
|
'preview_input_label' => 'Приклад — вхідні дані',
|
||||||
'preview_output_label' => 'Приклад — вихідні дані',
|
'preview_output_label' => 'Приклад — вихідні дані',
|
||||||
|
'enter_workbench' => 'Відкрити робочий простір',
|
||||||
|
'signed_in_as' => 'Увійшли як',
|
||||||
|
'member_card_title' => 'Вже є акаунт?',
|
||||||
|
'member_card_note' => 'Увійдіть через обліковий запис Do Better Norge. Google-вхід відбувається на основному сайті.',
|
||||||
|
'register_card_title' => 'Вперше на Do Better Norge?',
|
||||||
|
'register_card_note' => 'Безкоштовно для сімей у норвезьких справах із захисту дітей.',
|
||||||
|
'register_google' => 'Зареєструватися через Google',
|
||||||
|
'register_email' => 'Зареєструватися через email',
|
||||||
],
|
],
|
||||||
'pl' => [
|
'pl' => [
|
||||||
'meta_title' => 'Do Better Norge - prawne narzędzia AI',
|
'meta_title' => 'Do Better Norge - prawne narzędzia AI',
|
||||||
@@ -275,6 +299,14 @@ function dbnToolsTranslations(): array
|
|||||||
'preview_join' => 'Nie jesteś członkiem? Dołącz do Do Better Norge',
|
'preview_join' => 'Nie jesteś członkiem? Dołącz do Do Better Norge',
|
||||||
'preview_input_label' => 'Przykład — dane wejściowe',
|
'preview_input_label' => 'Przykład — dane wejściowe',
|
||||||
'preview_output_label' => 'Przykład — dane wyjściowe',
|
'preview_output_label' => 'Przykład — dane wyjściowe',
|
||||||
|
'enter_workbench' => 'Otwórz panel pracy',
|
||||||
|
'signed_in_as' => 'Zalogowany jako',
|
||||||
|
'member_card_title' => 'Jesteś już członkiem?',
|
||||||
|
'member_card_note' => 'Zaloguj przez konto Do Better Norge. Logowanie Google odbywa się na głównej stronie.',
|
||||||
|
'register_card_title' => 'Nowy w Do Better Norge?',
|
||||||
|
'register_card_note' => 'Bezpłatnie dla rodzin w norweskich sprawach dotyczących ochrony dzieci.',
|
||||||
|
'register_google' => 'Zarejestruj przez Google',
|
||||||
|
'register_email' => 'Zarejestruj przez email',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ if (isset($_GET['sso']) && !dbnToolsIsAuthenticated()) {
|
|||||||
$_SESSION['dbn_tools_user_email'] = (string)$tokenData['email'];
|
$_SESSION['dbn_tools_user_email'] = (string)$tokenData['email'];
|
||||||
$_SESSION['dbn_tools_user_role'] = 'sso';
|
$_SESSION['dbn_tools_user_role'] = 'sso';
|
||||||
$_SESSION['dbn_tools_tier'] = (string)($tokenData['tier'] ?? 'free');
|
$_SESSION['dbn_tools_tier'] = (string)($tokenData['tier'] ?? 'free');
|
||||||
header('Location: ' . $returnPath);
|
// Send to workbench directly after SSO; honour a specific return path if set
|
||||||
|
header('Location: ' . ($returnPath === '/' ? '/dashboard.php' : $returnPath));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,9 +44,12 @@ if (isset($_GET['sso']) && !dbnToolsIsAuthenticated()) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$isAuthed = dbnToolsIsAuthenticated();
|
||||||
|
$userEmail = $isAuthed ? (string)($_SESSION['dbn_tools_user_email'] ?? '') : '';
|
||||||
$tools = dbnToolsLaunchedTools($uiLang);
|
$tools = dbnToolsLaunchedTools($uiLang);
|
||||||
$langPath = '/';
|
$langPath = '/';
|
||||||
$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode($returnPath);
|
$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode($returnPath);
|
||||||
|
$registerUrl = 'https://dobetternorge.no/register.php';
|
||||||
|
|
||||||
require_once __DIR__ . '/includes/tool-svgs.php';
|
require_once __DIR__ . '/includes/tool-svgs.php';
|
||||||
?>
|
?>
|
||||||
@@ -68,65 +72,12 @@ require_once __DIR__ . '/includes/tool-svgs.php';
|
|||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Roboto:wght@300;400;500;700&family=IBM+Plex+Mono:wght@400;700&display=swap">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Roboto:wght@300;400;500;700&family=IBM+Plex+Mono:wght@400;700&display=swap">
|
||||||
<link rel="stylesheet" href="assets/css/tools.css">
|
<link rel="stylesheet" href="assets/css/tools.css">
|
||||||
</head>
|
</head>
|
||||||
<body data-authenticated="<?= dbnToolsIsAuthenticated() ? 'true' : 'false' ?>" class="<?= dbnToolsIsAuthenticated() ? 'lt-app' : 'lt-landing' ?>">
|
<body data-authenticated="<?= $isAuthed ? 'true' : 'false' ?>" class="lt-landing">
|
||||||
<script>
|
<script>
|
||||||
window.DBN_TOOLS_AUTHENTICATED = <?= dbnToolsIsAuthenticated() ? 'true' : 'false' ?>;
|
window.DBN_TOOLS_AUTHENTICATED = <?= $isAuthed ? 'true' : 'false' ?>;
|
||||||
window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php if (dbnToolsIsAuthenticated()): ?>
|
|
||||||
<main id="appShell" class="app-shell dashboard-shell">
|
|
||||||
<header class="topbar">
|
|
||||||
<div>
|
|
||||||
<p class="eyebrow"><?= htmlspecialchars(dbnToolsT('brand_line', $uiLang)) ?></p>
|
|
||||||
<h1><?= htmlspecialchars(dbnToolsT('dashboard_title', $uiLang)) ?></h1>
|
|
||||||
<div class="case-no">
|
|
||||||
<span class="pulse"></span>
|
|
||||||
<span>family-legal</span>
|
|
||||||
<span class="case-sep">.</span>
|
|
||||||
<span><?= htmlspecialchars(dbnToolsT('retention', $uiLang)) ?></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="topbar-actions">
|
|
||||||
<nav class="shell-lang-switcher" aria-label="Language">
|
|
||||||
<?php foreach (dbnToolsSupportedLanguages() as $langCode): ?>
|
|
||||||
<a href="<?= htmlspecialchars($langPath . '?lang=' . $langCode) ?>" class="<?= $langCode === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($langCode)) ?></a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</nav>
|
|
||||||
<span id="healthPill" class="status-pill"><?= htmlspecialchars(dbnToolsT('session_active', $uiLang)) ?></span>
|
|
||||||
<button id="healthButton" class="secondary-button" type="button"><?= htmlspecialchars(dbnToolsT('health', $uiLang)) ?></button>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<section class="manifesto dashboard-manifesto">
|
|
||||||
<div class="manifesto-copy">
|
|
||||||
<p class="manifesto-eyebrow"><?= htmlspecialchars(dbnToolsT('dashboard_eyebrow', $uiLang)) ?></p>
|
|
||||||
<h2 class="manifesto-title"><?= htmlspecialchars(dbnToolsT('manifesto_title', $uiLang)) ?></h2>
|
|
||||||
<p class="manifesto-sub"><?= htmlspecialchars(dbnToolsT('dashboard_sub', $uiLang)) ?></p>
|
|
||||||
</div>
|
|
||||||
<div class="manifesto-stats" aria-label="Headline statistics">
|
|
||||||
<div class="manifesto-stat"><strong>23</strong><span><?= htmlspecialchars(dbnToolsT('stat_echr', $uiLang)) ?></span></div>
|
|
||||||
<div class="manifesto-stat"><strong>64%</strong><span><?= htmlspecialchars(dbnToolsT('stat_loss', $uiLang)) ?></span></div>
|
|
||||||
<div class="manifesto-stat"><strong>1,731</strong><span><?= htmlspecialchars(dbnToolsT('stat_tribunal', $uiLang)) ?></span></div>
|
|
||||||
<div class="manifesto-stat"><strong>20+</strong><span><?= htmlspecialchars(dbnToolsT('stat_pending', $uiLang)) ?></span></div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div class="disclaimer" role="note"><?= htmlspecialchars(dbnToolsT('disclaimer', $uiLang)) ?></div>
|
|
||||||
|
|
||||||
<section class="tool-dashboard-grid" aria-label="Available tools">
|
|
||||||
<?php foreach ($tools as $slug => $item): ?>
|
|
||||||
<a class="dashboard-tool-card" href="<?= htmlspecialchars($item['url']) ?>">
|
|
||||||
<span class="dashboard-tool-card__icon"><?= htmlspecialchars($item['icon']) ?></span>
|
|
||||||
<span class="dashboard-tool-card__badge"><?= htmlspecialchars($item['badge']) ?></span>
|
|
||||||
<h2><?= htmlspecialchars($item['label']) ?></h2>
|
|
||||||
<p><?= htmlspecialchars($item['description']) ?></p>
|
|
||||||
<strong><?= htmlspecialchars(dbnToolsT('open_tool', $uiLang)) ?></strong>
|
|
||||||
</a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
<?php else: ?>
|
|
||||||
<main id="publicLanding" class="dbn-public-tools">
|
<main id="publicLanding" class="dbn-public-tools">
|
||||||
|
|
||||||
<header class="lt-nav">
|
<header class="lt-nav">
|
||||||
@@ -143,7 +94,14 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
|||||||
<a href="<?= htmlspecialchars($langPath . '?lang=' . $langCode . '&return=' . urlencode($returnPath)) ?>" class="<?= $langCode === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($langCode)) ?></a>
|
<a href="<?= htmlspecialchars($langPath . '?lang=' . $langCode . '&return=' . urlencode($returnPath)) ?>" class="<?= $langCode === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($langCode)) ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</nav>
|
</nav>
|
||||||
|
<?php if ($isAuthed): ?>
|
||||||
|
<div class="lt-auth-nav">
|
||||||
|
<span class="lt-auth-nav__email"><?= htmlspecialchars($userEmail) ?></span>
|
||||||
|
<a href="/dashboard.php" class="lt-nav__cta lt-nav__cta--enter"><?= htmlspecialchars(dbnToolsT('enter_workbench', $uiLang)) ?> →</a>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
<a href="#access" class="lt-nav__cta"><?= htmlspecialchars(dbnToolsT('primary_access', $uiLang)) ?></a>
|
<a href="#access" class="lt-nav__cta"><?= htmlspecialchars(dbnToolsT('primary_access', $uiLang)) ?></a>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -170,7 +128,15 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
|||||||
<span>Legal passages indexed</span>
|
<span>Legal passages indexed</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if ($isAuthed): ?>
|
||||||
|
<div class="lt-hero__auth-cta">
|
||||||
|
<span class="lt-hero__auth-check" aria-hidden="true">✓</span>
|
||||||
|
<span class="lt-hero__auth-label"><?= htmlspecialchars(dbnToolsT('signed_in_as', $uiLang)) ?> <?= htmlspecialchars($userEmail) ?></span>
|
||||||
|
<a href="/dashboard.php" class="lt-hero__enter-btn"><?= htmlspecialchars(dbnToolsT('enter_workbench', $uiLang)) ?> →</a>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
<a href="#tools" class="lt-hero__cta-link">Explore tools ↓</a>
|
<a href="#tools" class="lt-hero__cta-link">Explore tools ↓</a>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -195,6 +161,11 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
|||||||
</a>
|
</a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if ($isAuthed): ?>
|
||||||
|
<div class="lt-tools__enter-strip">
|
||||||
|
<a href="/dashboard.php" class="lt-access-btn"><?= htmlspecialchars(dbnToolsT('enter_workbench', $uiLang)) ?> →</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="lt-trust">
|
<section class="lt-trust">
|
||||||
@@ -214,13 +185,15 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="access" class="lt-access" aria-labelledby="ltAccessTitle">
|
<?php if (!$isAuthed): ?>
|
||||||
<div class="lt-access__inner">
|
<section id="access" class="lt-access lt-gate" aria-labelledby="ltGateTitle">
|
||||||
<p class="lt-access__eyebrow">Do Better Norge</p>
|
<div class="lt-gate__grid">
|
||||||
<h2 class="lt-access__title" id="ltAccessTitle"><?= htmlspecialchars(dbnToolsT('primary_access', $uiLang)) ?></h2>
|
|
||||||
<p class="lt-access__note"><?= htmlspecialchars(dbnToolsT('member_note', $uiLang)) ?></p>
|
<div class="lt-gate__card lt-gate__card--member">
|
||||||
|
<p class="lt-gate__card-eyebrow">Do Better Norge</p>
|
||||||
|
<h2 class="lt-gate__card-title" id="ltGateTitle"><?= htmlspecialchars(dbnToolsT('member_card_title', $uiLang)) ?></h2>
|
||||||
|
<p class="lt-gate__card-note"><?= htmlspecialchars(dbnToolsT('member_card_note', $uiLang)) ?></p>
|
||||||
<a class="lt-access-btn" href="<?= htmlspecialchars($toolsLogin) ?>"><?= htmlspecialchars(dbnToolsT('primary_access', $uiLang)) ?></a>
|
<a class="lt-access-btn" href="<?= htmlspecialchars($toolsLogin) ?>"><?= htmlspecialchars(dbnToolsT('primary_access', $uiLang)) ?></a>
|
||||||
<p class="gate-copy"><a href="https://dobetternorge.no/register.php"><?= htmlspecialchars(dbnToolsT('register', $uiLang)) ?></a></p>
|
|
||||||
<details class="fallback-login">
|
<details class="fallback-login">
|
||||||
<summary><?= htmlspecialchars(dbnToolsT('secondary_access', $uiLang)) ?></summary>
|
<summary><?= htmlspecialchars(dbnToolsT('secondary_access', $uiLang)) ?></summary>
|
||||||
<form id="passcodeForm" class="passcode-form">
|
<form id="passcodeForm" class="passcode-form">
|
||||||
@@ -235,10 +208,30 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
|||||||
</form>
|
</form>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="lt-gate__card lt-gate__card--register">
|
||||||
|
<p class="lt-gate__card-eyebrow">Free membership</p>
|
||||||
|
<h2 class="lt-gate__card-title"><?= htmlspecialchars(dbnToolsT('register_card_title', $uiLang)) ?></h2>
|
||||||
|
<p class="lt-gate__card-note"><?= htmlspecialchars(dbnToolsT('register_card_note', $uiLang)) ?></p>
|
||||||
|
<a class="lt-register-btn lt-register-btn--google" href="<?= htmlspecialchars($registerUrl . '?method=google') ?>">
|
||||||
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" aria-hidden="true" focusable="false">
|
||||||
|
<path d="M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615Z" fill="#4285F4"/>
|
||||||
|
<path d="M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18Z" fill="#34A853"/>
|
||||||
|
<path d="M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332Z" fill="#FBBC05"/>
|
||||||
|
<path d="M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 6.29C4.672 4.163 6.656 3.58 9 3.58Z" fill="#EA4335"/>
|
||||||
|
</svg>
|
||||||
|
<?= htmlspecialchars(dbnToolsT('register_google', $uiLang)) ?>
|
||||||
|
</a>
|
||||||
|
<a class="lt-register-btn lt-register-btn--email" href="<?= htmlspecialchars($registerUrl) ?>">
|
||||||
|
<?= htmlspecialchars(dbnToolsT('register_email', $uiLang)) ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<?php endif; ?>
|
|
||||||
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
||||||
<script src="assets/js/tools.js" defer></script>
|
<script src="assets/js/tools.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user