diff --git a/services/frontend/src/app/Landing.tsx b/services/frontend/src/app/Landing.tsx index ea2f624..c99e06a 100644 --- a/services/frontend/src/app/Landing.tsx +++ b/services/frontend/src/app/Landing.tsx @@ -145,6 +145,14 @@ export function Landing({ inviteOnly }: { inviteOnly: boolean }) { Megnézem → + + Híres emberek horoszkópja + + Ismert emberek születési képlete és részletes asztrológiai portréja: mit árul el róluk a születésük + pillanatának égboltja? + + Megnézem → + diff --git a/services/frontend/src/app/globals.css b/services/frontend/src/app/globals.css index 7fae058..82d6e85 100644 --- a/services/frontend/src/app/globals.css +++ b/services/frontend/src/app/globals.css @@ -1249,3 +1249,55 @@ span.tarot-fan-card { cursor: default; } .celeb-tile { padding: 10px; } .celeb-tile strong { font-size: 19px; } } + +/* The ☰ menu: instead of the header's link rows where they no longer fit + on one line (logged out below 1240px; logged in below 1380px, with more + links and the package). */ +.mobile-menu { display: none; margin-left: auto; } +.mobile-menu-button { + display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; + background: none; border: 1px solid var(--line-2); border-radius: 10px; color: var(--ink); cursor: pointer; +} +.mobile-menu-button:hover, .mobile-menu-button[aria-expanded="true"] { color: var(--gold); border-color: #5a6790; } +.mobile-menu-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; } +.mobile-menu-panel { + position: absolute; top: 100%; left: 0; right: 0; z-index: 20; + display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 16px; + background: rgba(13, 18, 32, 0.98); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45); + max-height: calc(100vh - 70px); overflow-y: auto; +} +.mobile-menu-group { display: flex; flex-direction: column; } +.mobile-menu-group + .mobile-menu-group { border-top: 1px solid var(--line); padding-top: 10px; } +.mobile-menu-group .lp-free-label { align-self: flex-start; margin: 2px 0 6px 12px; } +.mobile-menu-panel a { color: var(--ink-2); text-decoration: none; padding: 12px; border-radius: 8px; font-size: 17px; min-height: 44px; display: flex; align-items: center; } +.mobile-menu-panel a:hover, .mobile-menu-panel a[aria-current="page"] { color: var(--gold); background: rgba(217, 180, 106, 0.08); } +@media (max-width: 1240px) { + .mobile-menu-public { display: block; } + .lp-header .lp-nav, .lp-header .lp-free { display: none; } + .lp-header > .btn { margin-left: auto; } + .lp-header > .btn + .mobile-menu { margin-left: 0; } +} +@media (max-width: 1500px) { + .site-header .pkg-pill-detail { display: none; } +} +@media (max-width: 1380px) { + .mobile-menu-app { display: block; } + .site-header .app-nav { display: none; } + .site-header .who { margin-left: auto; } + .site-header .who + .mobile-menu { margin-left: 0; } +} +@media (max-width: 640px) { + /* Logo, account and ☰ on one line: the name only as an icon. */ + .site-header { flex-wrap: nowrap; } + .site-header .who { flex-wrap: nowrap; gap: 8px; min-width: 0; } + .site-header .who-name-text, .site-header .pkg-pill-detail { display: none; } + .site-header .who-name { padding: 0 10px; } +} +@media (max-width: 460px) { + /* No room for the package next to the account and ☰ (the menu has Csomagok). */ + .site-header .pkg-pill { display: none; } +} +@media (max-width: 380px) { + .site-header { gap: 8px; padding-left: 12px; padding-right: 12px; } + .logo { font-size: 22px; } +} diff --git a/services/frontend/src/app/hires-emberek/page.tsx b/services/frontend/src/app/hires-emberek/page.tsx index 19e4441..2ed00bf 100644 --- a/services/frontend/src/app/hires-emberek/page.tsx +++ b/services/frontend/src/app/hires-emberek/page.tsx @@ -21,7 +21,7 @@ export default async function CelebritiesPage() { const [people, me] = await Promise.all([loadCelebrities(), getMe()]); return ( <> - {!me && } + {!me && }
Híres emberek diff --git a/services/frontend/src/components/MobileMenu.tsx b/services/frontend/src/components/MobileMenu.tsx new file mode 100644 index 0000000..50d2c05 --- /dev/null +++ b/services/frontend/src/components/MobileMenu.tsx @@ -0,0 +1,83 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { useEffect, useId, useRef, useState } from "react"; + +export interface MenuSection { + /** A small heading above the group (e.g. "Ingyenes"). */ + title?: string; + links: { href: string; label: string }[]; +} + +/** + * The menu behind the ☰ button on narrow screens (the header's link rows are + * hidden there, see globals.css). Closes on a click outside, Escape, or + * moving to another page. `className` sets the width from which it shows. + */ +export function MobileMenu({ sections, className }: { sections: MenuSection[]; className: string }) { + const [open, setOpen] = useState(false); + const box = useRef(null); + const button = useRef(null); + const panelId = useId(); + const pathname = usePathname(); + + useEffect(() => setOpen(false), [pathname]); + useEffect(() => { + if (!open) return; + const outside = (e: PointerEvent) => { + if (box.current && !box.current.contains(e.target as Node)) setOpen(false); + }; + const escape = (e: KeyboardEvent) => { + if (e.key === "Escape") { + setOpen(false); + button.current?.focus(); + } + }; + document.addEventListener("pointerdown", outside); + document.addEventListener("keydown", escape); + return () => { + document.removeEventListener("pointerdown", outside); + document.removeEventListener("keydown", escape); + }; + }, [open]); + + const current = (href: string) => !href.includes("#") && pathname.startsWith(href); + + return ( +
+ + {open && ( + + )} +
+ ); +} diff --git a/services/frontend/src/components/NavLinks.tsx b/services/frontend/src/components/NavLinks.tsx index 7083782..27912e4 100644 --- a/services/frontend/src/components/NavLinks.tsx +++ b/services/frontend/src/components/NavLinks.tsx @@ -6,7 +6,7 @@ import { usePathname } from "next/navigation"; export function NavLinks({ links }: { links: { href: string; label: string }[] }) { const pathname = usePathname(); return ( -
+ ); }