diff --git a/assets/css/tools.css b/assets/css/tools.css index 2376e56..811dbd3 100644 --- a/assets/css/tools.css +++ b/assets/css/tools.css @@ -5319,3 +5319,252 @@ body.lt-landing { .lt-preview-hero__art { max-width: 100%; } .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; } +} diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..a13d7c5 --- /dev/null +++ b/dashboard.php @@ -0,0 +1,90 @@ + + + + + + + <?= htmlspecialchars(dbnToolsT('dashboard_title', $uiLang)) ?> — Do Better Norge + + + + + + + + + + +
+
+
+

+

+
+ + family-legal + . + +
+
+
+ + + +
+
+ +
+
+

+

+

+
+
+
23
+
64%
+
1,731
+
20+
+
+
+ +
+ +
+ $item): ?> + + + +

+

+ +
+ +
+
+ + + + diff --git a/includes/i18n.php b/includes/i18n.php index 5b08f8e..8cebbfe 100644 --- a/includes/i18n.php +++ b/includes/i18n.php @@ -119,6 +119,14 @@ function dbnToolsTranslations(): array 'preview_join' => 'Not a member? Join Do Better Norge', 'preview_input_label' => 'Sample input', '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' => [ '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_input_label' => 'Eksempel — inndata', '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' => [ 'meta_title' => 'Do Better Norge - юридичні AI інструменти', @@ -223,6 +239,14 @@ function dbnToolsTranslations(): array 'preview_join' => 'Не член? Приєднайтесь до Do Better Norge', 'preview_input_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' => [ '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_input_label' => 'Przykład — dane wejś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', ], ]; } diff --git a/index.php b/index.php index 13a2976..d5af233 100644 --- a/index.php +++ b/index.php @@ -35,7 +35,8 @@ if (isset($_GET['sso']) && !dbnToolsIsAuthenticated()) { $_SESSION['dbn_tools_user_email'] = (string)$tokenData['email']; $_SESSION['dbn_tools_user_role'] = 'sso'; $_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; } } @@ -43,9 +44,12 @@ if (isset($_GET['sso']) && !dbnToolsIsAuthenticated()) { exit; } -$tools = dbnToolsLaunchedTools($uiLang); -$langPath = '/'; -$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode($returnPath); +$isAuthed = dbnToolsIsAuthenticated(); +$userEmail = $isAuthed ? (string)($_SESSION['dbn_tools_user_email'] ?? '') : ''; +$tools = dbnToolsLaunchedTools($uiLang); +$langPath = '/'; +$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode($returnPath); +$registerUrl = 'https://dobetternorge.no/register.php'; require_once __DIR__ . '/includes/tool-svgs.php'; ?> @@ -68,65 +72,12 @@ require_once __DIR__ . '/includes/tool-svgs.php'; - + - -
-
-
-

-

-
- - family-legal - . - -
-
-
- - - -
-
- -
-
-

-

-

-
-
-
23
-
64%
-
1,731
-
20+
-
-
- -
- -
- $item): ?> - - - -

-

- -
- -
-
-
@@ -143,7 +94,14 @@ window.DBN_TOOLS_LANG = ; + +
+ + +
+ +
@@ -170,7 +128,15 @@ window.DBN_TOOLS_LANG = ; Legal passages indexed + +
+ + + +
+ Explore tools ↓ + @@ -195,6 +161,11 @@ window.DBN_TOOLS_LANG = ; + +
+ +
+
@@ -214,31 +185,53 @@ window.DBN_TOOLS_LANG = ;
-
-
-

Do Better Norge

-

-

- -

- + +
+
+ +
+

Do Better Norge

+

+

+ + +
+ +
+

Free membership

+

+

+ + + + + +
+
+
-