mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 14:17:31 +00:00
feat(notices): 5.2.0 release modal and Patreon for monthly support
The release modal now shows 5.2.0: booking mails that land in the trip, live flight status and the new trip PDF, each with its own drawn card, and links the 5.2.0 release notes. The maintainer note and the support block are rewritten, shorter and without the sponsor wording. Patreon joins Buy Me a Coffee and Ko-fi as the monthly way to support TREK: a full-width button in the release and thank-you notices (a new optional tertiaryCta on the notice contract), a tile in About and in the admin GitHub panel on desktop and phone, the README badges and FUNDING.yml. Like the other donation links it stays hidden inside the native apps.
This commit is contained in:
@@ -20,6 +20,7 @@ import { escapeReleaseHtml as escapeHtml, parseReleaseNotes } from '../../utils/
|
||||
import { fs } from '../shared/DialogShell';
|
||||
import { SETTINGS_BUTTON, SettingsCard, StatusPill } from '../Settings/settingsKit';
|
||||
import { useGithubReleases } from './useGithubReleases';
|
||||
import PatreonIcon, { PATREON_COLOR, PATREON_URL } from '../shared/PatreonIcon';
|
||||
|
||||
const REPO = 'liketrek/TREK';
|
||||
|
||||
@@ -136,6 +137,13 @@ export default function GitHubPanel({ isPrerelease = false }: { isPrerelease?: b
|
||||
};
|
||||
|
||||
const supportLinks: SupportLink[] = withoutDonationsInApp([
|
||||
{
|
||||
href: PATREON_URL,
|
||||
brand: PATREON_COLOR,
|
||||
icon: PatreonIcon,
|
||||
title: 'Patreon',
|
||||
hint: t('admin.github.supportMonthly'),
|
||||
},
|
||||
{
|
||||
href: 'https://ko-fi.com/mauriceboe',
|
||||
brand: '#ff5e5b', // theme-lint-disable: Ko-fi brand colour
|
||||
|
||||
@@ -60,8 +60,9 @@ describe('AboutTab', () => {
|
||||
it('FE-COMP-ABOUT-009: all external links have rel="noopener noreferrer"', () => {
|
||||
render(<AboutTab appVersion="2.9.10" />);
|
||||
const links = document.querySelectorAll('a');
|
||||
// Six tiles, and the sponsor panel: its logo, its button and the name in its title and body.
|
||||
expect(links).toHaveLength(10);
|
||||
// Seven tiles, and the sponsor panel: its logo, its button and the name in its title and body.
|
||||
expect(links).toHaveLength(11);
|
||||
expect(document.querySelector('a[href="https://www.patreon.com/cw/mauriceboe"]')).not.toBeNull();
|
||||
links.forEach((link) => {
|
||||
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ import { useTranslation } from '../../i18n';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import { donationsShown } from '../../utils/donations';
|
||||
import { fs } from '../shared/DialogShell';
|
||||
import PatreonIcon, { PATREON_COLOR, PATREON_URL } from '../shared/PatreonIcon';
|
||||
import Section from './Section';
|
||||
import { StatusPill } from './settingsKit';
|
||||
|
||||
@@ -246,6 +247,13 @@ export default function AboutTab({ appVersion }: Props): React.ReactElement {
|
||||
{/* Not in the native apps, whose store rules allow no outside payment links. */}
|
||||
{donationsShown() && (
|
||||
<>
|
||||
<LinkTile
|
||||
href={PATREON_URL}
|
||||
color={PATREON_COLOR}
|
||||
icon={<PatreonIcon size={17} />}
|
||||
title="Patreon"
|
||||
hint={t('admin.github.supportMonthly')}
|
||||
/>
|
||||
<LinkTile
|
||||
href="https://ko-fi.com/mauriceboe"
|
||||
color={BRAND.kofi}
|
||||
|
||||
@@ -24,9 +24,9 @@ function releaseNotice(overrides: Partial<SystemNoticeDTO> = {}): SystemNoticeDT
|
||||
introKey: 'rel.intro',
|
||||
featuresLabelKey: 'rel.features.label',
|
||||
features: [
|
||||
{ iconName: 'Mountain', visual: 'tours', titleKey: 'rel.f1.title', bodyKey: 'rel.f1.body' },
|
||||
{ iconName: 'BookOpen', visual: 'studio', titleKey: 'rel.f2.title', bodyKey: 'rel.f2.body' },
|
||||
{ iconName: 'Sparkles', visual: 'assistant', titleKey: 'rel.f3.title', bodyKey: 'rel.f3.body' },
|
||||
{ iconName: 'Mail', visual: 'mail', titleKey: 'rel.f1.title', bodyKey: 'rel.f1.body' },
|
||||
{ iconName: 'Plane', visual: 'flight', titleKey: 'rel.f2.title', bodyKey: 'rel.f2.body' },
|
||||
{ iconName: 'FileText', visual: 'pdf', titleKey: 'rel.f3.title', bodyKey: 'rel.f3.body' },
|
||||
],
|
||||
note: {
|
||||
eyebrowKey: 'rel.note.eyebrow',
|
||||
@@ -85,9 +85,9 @@ describe('ReleaseNoticeModal', () => {
|
||||
renderModal();
|
||||
expect(screen.getByText('rel.f1.title')).toBeInTheDocument();
|
||||
expect(document.querySelectorAll('.rn-feature')).toHaveLength(3);
|
||||
expect(document.querySelector('.rn-vis-tours')).not.toBeNull();
|
||||
expect(document.querySelector('.rn-vis-studio')).not.toBeNull();
|
||||
expect(document.querySelector('.rn-vis-assist')).not.toBeNull();
|
||||
expect(document.querySelector('.rn-vis-mail')).not.toBeNull();
|
||||
expect(document.querySelector('.rn-vis-flight')).not.toBeNull();
|
||||
expect(document.querySelector('.rn-vis-pdf')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('FE-RN-004: splits the note body on the blank line into separate paragraphs', () => {
|
||||
@@ -201,20 +201,19 @@ describe('ReleaseNoticeModal', () => {
|
||||
const n = releaseNotice();
|
||||
n.release!.features = [
|
||||
...n.release!.features,
|
||||
{ iconName: 'LifeBuoy', visual: 'help', layout: 'wide', titleKey: 'rel.f4.title', bodyKey: 'rel.f4.body' },
|
||||
{ iconName: 'Search', visual: 'search', layout: 'wide', titleKey: 'rel.f4.title', bodyKey: 'rel.f4.body' },
|
||||
];
|
||||
renderModal(n);
|
||||
const cards = document.querySelectorAll('.rn-feature');
|
||||
expect(cards).toHaveLength(4);
|
||||
expect(cards[3].classList.contains('rn-feature-wide')).toBe(true);
|
||||
expect([...cards].slice(0, 3).some((c) => c.classList.contains('rn-feature-wide'))).toBe(false);
|
||||
// The help drawing: the help button and two rows of greetings, each written twice to loop.
|
||||
// The search drawing: the field and its three results, the right place on top.
|
||||
const wide = cards[3];
|
||||
expect(wide.querySelector('.rn-vis-help-q')).not.toBeNull();
|
||||
expect(wide.querySelectorAll('.rn-vis-hello-row')).toHaveLength(2);
|
||||
expect(wide.querySelectorAll('.rn-vis-hello').length % 2).toBe(0);
|
||||
// The tours card lists the kinds of tour along its foot.
|
||||
expect(cards[0].querySelectorAll('.rn-vis-tours-kind')).toHaveLength(5);
|
||||
expect(wide.querySelector('.rn-vis-search-field')).not.toBeNull();
|
||||
expect(wide.querySelectorAll('.rn-vis-search-row')).toHaveLength(3);
|
||||
// The mail card ends on the booking it added, with its tick.
|
||||
expect(cards[0].querySelector('.rn-vis-mail-row-new .rn-vis-mail-check')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('FE-RN-016: the close button belongs to the panel, not the note', () => {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ArrowRight, Heart, Infinity as InfinityIcon, ShieldCheck, X } from 'luc
|
||||
import React from 'react';
|
||||
import { useTranslation } from '../../i18n/TranslationContext.js';
|
||||
import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js';
|
||||
import { PATREON_PATH } from '../shared/PatreonIcon';
|
||||
import { ReleaseFeatureVisual } from './ReleaseNoticeVisuals.js';
|
||||
import './releaseNotice.css';
|
||||
|
||||
@@ -11,6 +12,7 @@ interface Props {
|
||||
onDismiss: () => void;
|
||||
onCTA: () => void;
|
||||
onSecondaryCTA: () => void;
|
||||
onTertiaryCTA: () => void;
|
||||
}
|
||||
|
||||
/** Lucide's coffee cup, drawn here so its three steam strokes can drift up in waves. */
|
||||
@@ -74,7 +76,7 @@ function paragraphs(text: string): string[] {
|
||||
* generic modal's behaviour: the host hook still owns ESC, the scroll lock and
|
||||
* the dismissal, this component only draws.
|
||||
*/
|
||||
export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecondaryCTA }: Props) {
|
||||
export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecondaryCTA, onTertiaryCTA }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const release = notice.release;
|
||||
if (!release) return null;
|
||||
@@ -208,6 +210,26 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
|
||||
</div>
|
||||
)}
|
||||
<div className="rn-support-buttons">
|
||||
{notice.tertiaryCta && (
|
||||
<button
|
||||
type="button"
|
||||
id={`notice-cta3-${notice.id}`}
|
||||
className="rn-support-btn rn-support-patreon"
|
||||
onClick={onTertiaryCTA}
|
||||
>
|
||||
<svg
|
||||
className="rn-patreon"
|
||||
viewBox="0 0 24 24"
|
||||
width={16}
|
||||
height={16}
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d={PATREON_PATH} />
|
||||
</svg>
|
||||
{t(notice.tertiaryCta.labelKey)}
|
||||
</button>
|
||||
)}
|
||||
{notice.cta && (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
import * as LucideIcons from 'lucide-react';
|
||||
import {
|
||||
Bike,
|
||||
BedDouble,
|
||||
Check,
|
||||
Clock,
|
||||
Coffee,
|
||||
Footprints,
|
||||
Globe,
|
||||
Image as ImageIcon,
|
||||
Landmark,
|
||||
Mail,
|
||||
MapPin,
|
||||
Phone,
|
||||
Plane,
|
||||
Sailboat,
|
||||
Search,
|
||||
Snowflake,
|
||||
Sparkles,
|
||||
Star,
|
||||
TrendingUp,
|
||||
Zap,
|
||||
} from 'lucide-react';
|
||||
import React from 'react';
|
||||
@@ -30,174 +26,84 @@ import './releaseNoticeVisuals.css';
|
||||
* releaseNoticeVisuals.css, and every motion stops under reduced motion.
|
||||
*/
|
||||
|
||||
// ── Tours: a trail climbing to the summit at dusk, and the kinds of tour under it ──
|
||||
// ── Booking mails: a forwarded mail flies into the trip and becomes its booking ──
|
||||
|
||||
const FAR_RIDGE = 'M0 66 L20 50 L38 60 L60 38 L84 56 L104 44 L128 58 L152 40 L176 54 L200 46 V112 H0 Z';
|
||||
const MOUNTAIN = 'M0 112 V86 L44 62 L84 28 L98 38 L112 32 L152 68 L200 80 V112 Z';
|
||||
const SNOW = 'M84 28 L73 38 L79 37 L84 42 L89 37.5 L95 37 Z';
|
||||
const MEADOW = 'M0 112 V96 C 30 88, 60 90, 92 94 S 160 82, 200 90 V112 Z';
|
||||
// From the valley up the mountain's flank to the summit, in switchbacks.
|
||||
const TRAIL = 'M24 100 C 40 96, 50 90, 54 84 S 66 78, 70 72 S 64 62, 72 56 S 82 48, 78 42 S 82 34, 84 29';
|
||||
const KINDS = [Footprints, Bike, Sailboat, Snowflake, Landmark];
|
||||
|
||||
function ToursVisual() {
|
||||
function MailVisual() {
|
||||
return (
|
||||
<div className="rn-vis rn-vis-tours">
|
||||
<svg className="rn-vis-tours-scene" viewBox="0 0 200 112" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
|
||||
<circle className="rn-vis-tours-sun" cx="160" cy="24" r="9" />
|
||||
<path className="rn-vis-tours-far" d={FAR_RIDGE} />
|
||||
<path className="rn-vis-tours-mountain" d={MOUNTAIN} />
|
||||
<path className="rn-vis-tours-snow" d={SNOW} />
|
||||
<path className="rn-vis-tours-meadow" d={MEADOW} />
|
||||
<path className="rn-vis-tours-trail" d={TRAIL} pathLength={1} />
|
||||
<circle className="rn-vis-tours-walker" r="2.6">
|
||||
<animateMotion dur="5s" begin="1.6s" repeatCount="indefinite" path={TRAIL} />
|
||||
</circle>
|
||||
<g className="rn-vis-tours-flag">
|
||||
<line x1="84" y1="29" x2="84" y2="17" />
|
||||
<path d="M84 17 L93 20 L84 23 Z" />
|
||||
<div className="rn-vis rn-vis-mail">
|
||||
<span className="rn-vis-mail-env">
|
||||
<Mail size={13} strokeWidth={2.2} />
|
||||
</span>
|
||||
<div className="rn-vis-mail-trip">
|
||||
<span className="rn-vis-mail-head">Tokyo</span>
|
||||
<span className="rn-vis-mail-row">
|
||||
<BedDouble size={9} strokeWidth={2.4} />
|
||||
<i />
|
||||
</span>
|
||||
<span className="rn-vis-mail-row rn-vis-mail-row-new">
|
||||
<Plane size={9} strokeWidth={2.4} />
|
||||
<b>LH 716</b>
|
||||
<span className="rn-vis-mail-check">
|
||||
<Check size={8} strokeWidth={3.2} />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── Live flight status: the aircraft on its way, and how late it runs ──
|
||||
|
||||
const FLIGHT_ARC = 'M24 86 C 70 18, 130 18, 176 86';
|
||||
|
||||
function FlightVisual() {
|
||||
return (
|
||||
<div className="rn-vis rn-vis-flight">
|
||||
<svg className="rn-vis-flight-map" viewBox="0 0 200 112" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
|
||||
<path className="rn-vis-flight-arc" d={FLIGHT_ARC} pathLength={1} />
|
||||
<circle className="rn-vis-flight-airport" cx="24" cy="86" r="3.4" />
|
||||
<circle className="rn-vis-flight-airport" cx="176" cy="86" r="3.4" />
|
||||
<g className="rn-vis-flight-plane">
|
||||
<path d="M-6 0 L5 0 M1 -4 L4 0 L1 4 M-5 -2 L-3 0 L-5 2" />
|
||||
<animateMotion dur="4.2s" begin="0.4s" repeatCount="indefinite" rotate="auto" path={FLIGHT_ARC} />
|
||||
</g>
|
||||
</svg>
|
||||
<span className="rn-vis-tours-climb">
|
||||
<TrendingUp size={9} strokeWidth={2.6} />
|
||||
860 m
|
||||
<span className="rn-vis-flight-code rn-vis-flight-from">FRA</span>
|
||||
<span className="rn-vis-flight-code rn-vis-flight-to">HND</span>
|
||||
<span className="rn-vis-flight-live">
|
||||
<i />
|
||||
+12 min
|
||||
</span>
|
||||
<div className="rn-vis-tours-kinds">
|
||||
{KINDS.map((Kind, i) => (
|
||||
<span key={i} className="rn-vis-tours-kind" style={{ animationDelay: `${1.2 + i * 0.08}s` }}>
|
||||
<Kind size={10} strokeWidth={2.2} />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── The trip PDF: a cover with the route in the day colours, the days behind it ──
|
||||
|
||||
const COVER_ROUTE = 'M10 40 L22 30 L30 34 L40 22 L50 26';
|
||||
|
||||
function PdfVisual() {
|
||||
return (
|
||||
<div className="rn-vis rn-vis-pdf">
|
||||
<span className="rn-vis-pdf-page rn-vis-pdf-back">
|
||||
{[0, 1, 2, 3].map((i) => (
|
||||
<i key={i} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── TREK Studio: an open photo book with a polaroid, a stamp and a sticker ──
|
||||
|
||||
function StudioVisual() {
|
||||
return (
|
||||
<div className="rn-vis rn-vis-studio">
|
||||
<div className="rn-vis-book">
|
||||
<div className="rn-vis-page rn-vis-page-start">
|
||||
<div className="rn-vis-polaroid">
|
||||
<svg viewBox="0 0 60 44" aria-hidden="true">
|
||||
<rect className="rn-vis-sky" width="60" height="44" />
|
||||
<circle className="rn-vis-sun" cx="42" cy="15" r="6" />
|
||||
<path className="rn-vis-peak-far" d="M0 32 L12 20 L20 26 L32 12 L44 24 L52 18 L60 26 V44 H0 Z" />
|
||||
<path className="rn-vis-peak-near" d="M0 38 L14 28 L26 34 L38 26 L60 36 V44 H0 Z" />
|
||||
</svg>
|
||||
</div>
|
||||
<span className="rn-vis-tape" />
|
||||
</div>
|
||||
<div className="rn-vis-page rn-vis-page-end">
|
||||
<span className="rn-vis-book-title">Dolomiti</span>
|
||||
<span className="rn-vis-book-line" />
|
||||
<span className="rn-vis-book-line rn-vis-book-line-short" />
|
||||
<span className="rn-vis-stamp">
|
||||
<Plane size={10} strokeWidth={2.2} />
|
||||
</span>
|
||||
</div>
|
||||
<span className="rn-vis-gutter" />
|
||||
</div>
|
||||
<span className="rn-vis-sticker">
|
||||
<Star size={15} strokeWidth={1.8} />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── The assistant: a day in Porto proposed stop by stop, ready to apply ──
|
||||
|
||||
const PORTO: Array<{ time: string; name: string; tone: string }> = [
|
||||
{ time: '09:30', name: 'Ribeira', tone: 'sight' },
|
||||
{ time: '12:30', name: 'Livraria Lello', tone: 'culture' },
|
||||
{ time: '16:00', name: 'Torre dos Clérigos', tone: 'view' },
|
||||
];
|
||||
|
||||
function AssistantVisual() {
|
||||
return (
|
||||
<div className="rn-vis rn-vis-assist">
|
||||
<div className="rn-vis-assist-head">
|
||||
<span className="rn-vis-assist-avatar">
|
||||
<Sparkles size={10} strokeWidth={2.4} />
|
||||
</span>
|
||||
<span className="rn-vis-assist-typing">
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
</span>
|
||||
</div>
|
||||
<div className="rn-vis-assist-card">
|
||||
{PORTO.map((stop, i) => (
|
||||
<div key={stop.name} className="rn-vis-assist-row" style={{ animationDelay: `${0.5 + i * 0.35}s` }}>
|
||||
<span className="rn-vis-assist-time">{stop.time}</span>
|
||||
<span className={`rn-vis-assist-dot rn-vis-assist-dot-${stop.tone}`} />
|
||||
<span className="rn-vis-assist-name">{stop.name}</span>
|
||||
</div>
|
||||
<span className="rn-vis-pdf-page rn-vis-pdf-mid">
|
||||
{[0, 1, 2].map((i) => (
|
||||
<i key={i} />
|
||||
))}
|
||||
</div>
|
||||
<span className="rn-vis-assist-apply">
|
||||
<Check size={11} strokeWidth={3} />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── Help on every screen, in 27 languages: hello in each of them, drifting by ──
|
||||
|
||||
const HELLO_A = [
|
||||
'Hallo',
|
||||
'Bonjour',
|
||||
'Hola',
|
||||
'Ciao',
|
||||
'Olá',
|
||||
'Hej',
|
||||
'Ahoj',
|
||||
'Cześć',
|
||||
'Szia',
|
||||
'Tere',
|
||||
'Salam',
|
||||
'Bon dia',
|
||||
'Halo',
|
||||
];
|
||||
const HELLO_B = [
|
||||
'Привіт',
|
||||
'Привет',
|
||||
'Γεια σου',
|
||||
'مرحبا',
|
||||
'こんにちは',
|
||||
'안녕하세요',
|
||||
'你好',
|
||||
'哈囉',
|
||||
'สวัสดี',
|
||||
'Xin chào',
|
||||
'Merhaba',
|
||||
'Dobrý deň',
|
||||
];
|
||||
|
||||
function HelloRow({ words, reverse }: { words: string[]; reverse?: boolean }) {
|
||||
// Written twice, so the row can slide by half its width and start over without a seam.
|
||||
return (
|
||||
<div className={reverse ? 'rn-vis-hello-row rn-vis-hello-row-reverse' : 'rn-vis-hello-row'}>
|
||||
{[...words, ...words].map((word, i) => (
|
||||
<span key={i} className="rn-vis-hello" lang="und">
|
||||
{word}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function HelpVisual() {
|
||||
return (
|
||||
<div className="rn-vis rn-vis-help">
|
||||
<span className="rn-vis-help-q">?</span>
|
||||
<div className="rn-vis-help-langs">
|
||||
<HelloRow words={HELLO_A} />
|
||||
<HelloRow words={HELLO_B} reverse />
|
||||
</div>
|
||||
<span className="rn-vis-help-count">27</span>
|
||||
<span className="rn-vis-pdf-page rn-vis-pdf-cover">
|
||||
<svg viewBox="0 0 60 50" aria-hidden="true">
|
||||
<path className="rn-vis-pdf-route" d={COVER_ROUTE} pathLength={1} />
|
||||
<circle cx="10" cy="40" r="2.2" />
|
||||
<circle cx="50" cy="26" r="2.2" />
|
||||
</svg>
|
||||
<b />
|
||||
<i />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -315,10 +221,9 @@ function RoutingVisual() {
|
||||
}
|
||||
|
||||
const VISUALS: Record<string, () => React.ReactElement> = {
|
||||
tours: ToursVisual,
|
||||
studio: StudioVisual,
|
||||
assistant: AssistantVisual,
|
||||
help: HelpVisual,
|
||||
mail: MailVisual,
|
||||
flight: FlightVisual,
|
||||
pdf: PdfVisual,
|
||||
search: SearchVisual,
|
||||
share: ShareVisual,
|
||||
routing: RoutingVisual,
|
||||
|
||||
@@ -10,6 +10,7 @@ import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js';
|
||||
import { useTranslation, isRtlLanguage } from '../../i18n/index.js';
|
||||
import { runNoticeAction } from './noticeActions.js';
|
||||
import { ReleaseNoticeModal } from './ReleaseNoticeModal.js';
|
||||
import { PATREON_PATH } from '../shared/PatreonIcon';
|
||||
import { lockBodyScroll } from '../../utils/bodyScrollLock.js';
|
||||
|
||||
const ReactMarkdown = React.lazy(() =>
|
||||
@@ -44,6 +45,7 @@ const SEVERITY_ACCENT: Record<string, string> = {
|
||||
const BRAND_ICON_PATHS: Record<string, string> = {
|
||||
buymeacoffee:
|
||||
'M20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379-.197-.069-.42-.098-.57-.241-.152-.143-.196-.366-.231-.572-.065-.378-.125-.756-.192-1.133-.057-.325-.102-.69-.25-.987-.195-.4-.597-.634-.996-.788a5.723 5.723 0 00-.626-.194c-1-.263-2.05-.36-3.077-.416a25.834 25.834 0 00-3.7.062c-.915.083-1.88.184-2.75.5-.318.116-.646.256-.888.501-.297.302-.393.77-.177 1.146.154.267.415.456.692.58.36.162.737.284 1.123.366 1.075.238 2.189.331 3.287.37 1.218.05 2.437.01 3.65-.118.299-.033.598-.073.896-.119.352-.054.578-.513.474-.834-.124-.383-.457-.531-.834-.473-.466.074-.96.108-1.382.146-1.177.08-2.358.082-3.536.006a22.228 22.228 0 01-1.157-.107c-.086-.01-.18-.025-.258-.036-.243-.036-.484-.08-.724-.13-.111-.027-.111-.185 0-.212h.005c.277-.06.557-.108.838-.147h.002c.131-.009.263-.032.394-.048a25.076 25.076 0 013.426-.12c.674.019 1.347.067 2.017.144l.228.031c.267.04.533.088.798.145.392.085.895.113 1.07.542.055.137.08.288.111.431l.319 1.484a.237.237 0 01-.199.284h-.003c-.037.006-.075.01-.112.015a36.704 36.704 0 01-4.743.295 37.059 37.059 0 01-4.699-.304c-.14-.017-.293-.042-.417-.06-.326-.048-.649-.108-.973-.161-.393-.065-.768-.032-1.123.161-.29.16-.527.404-.675.701-.154.316-.199.66-.267 1-.069.34-.176.707-.135 1.056.087.753.613 1.365 1.37 1.502a39.69 39.69 0 0011.343.376.483.483 0 01.535.53l-.071.697-1.018 9.907c-.041.41-.047.832-.125 1.237-.122.637-.553 1.028-1.182 1.171-.577.131-1.165.2-1.756.205-.656.004-1.31-.025-1.966-.022-.699.004-1.556-.06-2.095-.58-.475-.458-.54-1.174-.605-1.793l-.731-7.013-.322-3.094c-.037-.351-.286-.695-.678-.678-.336.015-.718.3-.678.679l.228 2.185.949 9.112c.147 1.344 1.174 2.068 2.446 2.272.742.12 1.503.144 2.257.156.966.016 1.942.053 2.892-.122 1.408-.258 2.465-1.198 2.616-2.657.34-3.332.683-6.663 1.024-9.995l.215-2.087a.484.484 0 01.39-.426c.402-.078.787-.212 1.074-.518.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233-2.416.359-4.866.54-7.308.46-1.748-.06-3.477-.254-5.207-.498-.17-.024-.353-.055-.47-.18-.22-.236-.111-.71-.054-.995.052-.26.152-.609.463-.646.484-.057 1.046.148 1.526.22.577.088 1.156.159 1.737.212 2.48.226 5.002.19 7.472-.14.45-.06.899-.13 1.345-.21.399-.072.84-.206 1.08.206.166.281.188.657.162.974a.544.544 0 01-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a5.884 5.884 0 01-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38 0 0 1.243.065 1.658.065.447 0 1.786-.065 1.786-.065.783 0 1.434-.6 1.499-1.38l.94-9.95a3.996 3.996 0 00-1.322-.238c-.826 0-1.491.284-2.26.613z',
|
||||
patreon: PATREON_PATH,
|
||||
kofi:
|
||||
'M11.351 2.715c-2.7 0-4.986.025-6.83.26C2.078 3.285 0 5.154 0 8.61c0 3.506.182 6.13 1.585 8.493 1.584 2.701 4.233 4.182 7.662 4.182h.83c4.209 0 6.494-2.234 7.637-4a9.5 9.5 0 0 0 1.091-2.338C21.792 14.688 24 12.22 24 9.208v-.415c0-3.247-2.13-5.507-5.792-5.87-1.558-.156-2.65-.208-6.857-.208m0 1.947c4.208 0 5.09.052 6.571.182 2.624.311 4.13 1.584 4.13 4v.39c0 2.156-1.792 3.844-3.87 3.844h-.935l-.156.649c-.208 1.013-.597 1.818-1.039 2.546-.909 1.428-2.545 3.064-5.922 3.064h-.805c-2.571 0-4.831-.883-6.078-3.195-1.09-2-1.298-4.155-1.298-7.506 0-2.181.857-3.402 3.012-3.714 1.533-.233 3.559-.26 6.39-.26m6.547 2.287c-.416 0-.65.234-.65.546v2.935c0 .311.234.545.65.545 1.324 0 2.051-.754 2.051-2s-.727-2.026-2.052-2.026m-10.39.182c-1.818 0-3.013 1.48-3.013 3.142 0 1.533.858 2.857 1.949 3.897.727.701 1.87 1.429 2.649 1.896a1.47 1.47 0 0 0 1.507 0c.78-.467 1.922-1.195 2.623-1.896 1.117-1.039 1.974-2.364 1.974-3.897 0-1.662-1.247-3.142-3.039-3.142-1.065 0-1.792.545-2.338 1.298-.493-.753-1.246-1.298-2.312-1.298',
|
||||
};
|
||||
@@ -52,6 +54,7 @@ function brandForHref(href?: string): string | null {
|
||||
if (!href) return null;
|
||||
if (href.includes('buymeacoffee')) return 'buymeacoffee';
|
||||
if (href.includes('ko-fi.com') || href.includes('kofi')) return 'kofi';
|
||||
if (href.includes('patreon.com')) return 'patreon';
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -76,12 +79,14 @@ interface ContentProps {
|
||||
body: string;
|
||||
ctaLabel: string | null;
|
||||
secondaryCtaLabel: string | null;
|
||||
tertiaryCtaLabel: string | null;
|
||||
titleId: string;
|
||||
bodyId: string;
|
||||
isDark: boolean;
|
||||
onDismissAll: () => void;
|
||||
onCTA: () => void;
|
||||
onSecondaryCTA: () => void;
|
||||
onTertiaryCTA: () => void;
|
||||
// Pager
|
||||
total: number;
|
||||
currentPage: number;
|
||||
@@ -91,7 +96,7 @@ interface ContentProps {
|
||||
onGoto: (i: number) => void;
|
||||
}
|
||||
|
||||
function NoticeContent({ notice, title, body, ctaLabel, secondaryCtaLabel, titleId, bodyId, isDark, onDismissAll, onCTA, onSecondaryCTA, total, currentPage, canPage, onPrev, onNext, onGoto }: ContentProps) {
|
||||
function NoticeContent({ notice, title, body, ctaLabel, secondaryCtaLabel, tertiaryCtaLabel, titleId, bodyId, isDark, onDismissAll, onCTA, onSecondaryCTA, onTertiaryCTA, total, currentPage, canPage, onPrev, onNext, onGoto }: ContentProps) {
|
||||
const { t } = useTranslation();
|
||||
const isLastPage = total <= 1 || currentPage === total - 1;
|
||||
|
||||
@@ -329,6 +334,17 @@ function NoticeContent({ notice, title, body, ctaLabel, secondaryCtaLabel, title
|
||||
{secondaryCtaLabel}
|
||||
</button>
|
||||
)}
|
||||
{tertiaryCtaLabel && (
|
||||
<button type="button"
|
||||
id={`notice-cta3-${notice.id}`}
|
||||
onClick={onTertiaryCTA}
|
||||
className="flex-1 h-11 inline-flex items-center justify-center gap-2 rounded-lg font-semibold shadow-sm transition hover:brightness-110 active:scale-[0.98]"
|
||||
style={{ background: 'var(--text-primary)', color: 'var(--bg-primary)' }}
|
||||
>
|
||||
<BrandIcon brand="patreon" size={16} />
|
||||
{tertiaryCtaLabel}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
) : (notice.dismissible || isLastPage) && (
|
||||
<button type="button"
|
||||
@@ -551,6 +567,7 @@ function useSystemNoticeModal(notices: SystemNoticeDTO[]) {
|
||||
// Both buttons only render when the notice carries the matching cta.
|
||||
function handleCTA() { runCta(notice!.cta!); }
|
||||
function handleSecondaryCTA() { runCta(notice!.secondaryCta!); }
|
||||
function handleTertiaryCTA() { runCta(notice!.tertiaryCta!); }
|
||||
|
||||
function animatedDismissAll() {
|
||||
const sheet = sheetRef.current;
|
||||
@@ -610,7 +627,7 @@ function useSystemNoticeModal(notices: SystemNoticeDTO[]) {
|
||||
notice, canPage, isLastPage, language, t, dur, ease,
|
||||
touchStartX, touchStartY, dragLockRef, scrollTopAtTouchStart, isPageNavRef,
|
||||
stripRef, sheetRef, prevSlotRef, contentWrapperRef, nextSlotRef,
|
||||
announceIndex, handleDismissAll, handleCTA, handleSecondaryCTA, animatedDismissAll,
|
||||
announceIndex, handleDismissAll, handleCTA, handleSecondaryCTA, handleTertiaryCTA, animatedDismissAll,
|
||||
handlePrev, handleNext, handleGoto,
|
||||
};
|
||||
}
|
||||
@@ -621,7 +638,7 @@ const escapeRe = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
// Build the NoticeContent props for a given notice + pager slot index.
|
||||
function makeContentProps(S: NoticeState, n: SystemNoticeDTO, slotIdx: number): ContentProps {
|
||||
const { t, isDark, canPage, notices, handleDismissAll, handleCTA, handleSecondaryCTA, handlePrev, handleNext, handleGoto } = S;
|
||||
const { t, isDark, canPage, notices, handleDismissAll, handleCTA, handleSecondaryCTA, handleTertiaryCTA, handlePrev, handleNext, handleGoto } = S;
|
||||
const rawBody = t(n.bodyKey);
|
||||
// The key is escaped into the pattern and the value goes in through a function, so a
|
||||
// value carrying $&, $1 or $` is inserted as typed instead of being expanded.
|
||||
@@ -637,12 +654,14 @@ function makeContentProps(S: NoticeState, n: SystemNoticeDTO, slotIdx: number):
|
||||
body,
|
||||
ctaLabel: n.cta ? t(n.cta.labelKey) : null,
|
||||
secondaryCtaLabel: n.secondaryCta ? t(n.secondaryCta.labelKey) : null,
|
||||
tertiaryCtaLabel: n.tertiaryCta ? t(n.tertiaryCta.labelKey) : null,
|
||||
titleId: `notice-title-${n.id}`,
|
||||
bodyId: `notice-body-${n.id}`,
|
||||
isDark,
|
||||
onDismissAll: handleDismissAll,
|
||||
onCTA: handleCTA,
|
||||
onSecondaryCTA: handleSecondaryCTA,
|
||||
onTertiaryCTA: handleTertiaryCTA,
|
||||
total: notices.length,
|
||||
currentPage: slotIdx,
|
||||
canPage,
|
||||
@@ -889,6 +908,7 @@ export function ModalRenderer({ notices }: Props) {
|
||||
onDismiss={S.handleDismissAll}
|
||||
onCTA={S.handleCTA}
|
||||
onSecondaryCTA={S.handleSecondaryCTA}
|
||||
onTertiaryCTA={S.handleTertiaryCTA}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -626,6 +626,8 @@
|
||||
/* Brand colours: Buy Me a Coffee and Ko-fi own these. */
|
||||
.rn-support-bmc { --rn-btn: #ffdd00; color: #101013; } /* theme-lint-disable */
|
||||
.rn-support-kofi { --rn-btn: #ff5e5b; color: #ffffff; } /* theme-lint-disable */
|
||||
/* Patreon, the monthly one: a full row in Patreon's own black above the two. */
|
||||
.rn-support-patreon { --rn-btn: #141518; color: #ffffff; grid-column: 1 / -1; } /* theme-lint-disable */
|
||||
|
||||
/* Narrow viewports: keep the proportions, drop the outer padding. */
|
||||
@media (max-width: 900px) {
|
||||
|
||||
@@ -46,494 +46,301 @@
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
@keyframes rn-typing {
|
||||
0%,
|
||||
60%,
|
||||
100% {
|
||||
opacity: 0.35;
|
||||
|
||||
/* Booking mails: a forwarded mail flies into the trip and turns into its booking. */
|
||||
.rn-vis-mail {
|
||||
background:
|
||||
radial-gradient(90% 90% at 15% 30%, oklch(0.7 0.15 55 / 0.32) 0%, transparent 62%),
|
||||
linear-gradient(165deg, #241c16 0%, #15110e 100%);
|
||||
}
|
||||
|
||||
.rn-vis-mail-env {
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
inset-inline-start: 14px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 30px;
|
||||
height: 22px;
|
||||
border-radius: 5px;
|
||||
background: #fbbf24;
|
||||
color: #1c1308;
|
||||
box-shadow: 0 6px 14px oklch(0 0 0 / 0.45);
|
||||
animation: rn-mail-fly 2.4s cubic-bezier(0.55, 0, 0.3, 1) 0.4s both;
|
||||
}
|
||||
|
||||
.rn-vis-mail-trip {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
inset-inline-end: 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
width: 104px;
|
||||
padding: 7px;
|
||||
border-radius: 9px;
|
||||
background: #f5f5f7;
|
||||
color: #101013;
|
||||
transform: translateY(-50%);
|
||||
box-shadow: 0 6px 16px oklch(0 0 0 / 0.45);
|
||||
}
|
||||
|
||||
.rn-vis-mail-head {
|
||||
font-size: 9.5px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.rn-vis-mail-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 3px 5px;
|
||||
border-radius: 6px;
|
||||
background: #e8e8ed;
|
||||
font-size: 8.5px;
|
||||
}
|
||||
|
||||
.rn-vis-mail-row i {
|
||||
flex: 1;
|
||||
height: 4px;
|
||||
border-radius: 2px;
|
||||
background: #c7c7cc;
|
||||
}
|
||||
|
||||
.rn-vis-mail-row-new {
|
||||
background: oklch(0.93 0.07 80);
|
||||
animation: rn-rise 0.34s ease 2.4s both;
|
||||
}
|
||||
|
||||
.rn-vis-mail-row-new b {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.rn-vis-mail-check {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background: #16a34a;
|
||||
color: #ffffff;
|
||||
animation: rn-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 2.75s both;
|
||||
}
|
||||
|
||||
@keyframes rn-mail-fly {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translate(0, 6px) rotate(-8deg);
|
||||
}
|
||||
15% {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
30% {
|
||||
80% {
|
||||
opacity: 1;
|
||||
transform: translateY(-2px);
|
||||
transform: translate(92px, 40px) scale(0.55) rotate(6deg);
|
||||
}
|
||||
}
|
||||
@keyframes rn-ring {
|
||||
0% {
|
||||
box-shadow: 0 0 0 0 oklch(0.72 0.19 150 / 0.55);
|
||||
}
|
||||
70%,
|
||||
100% {
|
||||
box-shadow: 0 0 0 9px oklch(0.72 0.19 150 / 0);
|
||||
}
|
||||
}
|
||||
@keyframes rn-marquee {
|
||||
from {
|
||||
transform: translateX(0);
|
||||
}
|
||||
to {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
@keyframes rn-sticker {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.2) rotate(-50deg);
|
||||
}
|
||||
70% {
|
||||
opacity: 1;
|
||||
transform: scale(1.12) rotate(12deg);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: rotate(8deg);
|
||||
transform: translate(100px, 44px) scale(0.3);
|
||||
}
|
||||
}
|
||||
|
||||
/* Tours: a trail climbing to the summit at dusk, and the kinds of tour along the foot. */
|
||||
.rn-vis-tours {
|
||||
background: linear-gradient(180deg, #24304f 0%, #3c4a6b 46%, #c9876a 100%);
|
||||
/* Live flight status: the aircraft on its arc, the live delay in the corner. */
|
||||
.rn-vis-flight {
|
||||
background:
|
||||
radial-gradient(100% 90% at 50% 0%, oklch(0.62 0.15 250 / 0.35) 0%, transparent 65%),
|
||||
linear-gradient(170deg, #121a2b 0%, #0c111c 100%);
|
||||
}
|
||||
|
||||
.rn-vis-tours-scene {
|
||||
.rn-vis-flight-map {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.rn-vis-tours-sun {
|
||||
fill: #fde68a;
|
||||
filter: drop-shadow(0 0 6px oklch(0.92 0.12 90 / 0.7));
|
||||
}
|
||||
|
||||
.rn-vis-tours-far {
|
||||
fill: #56668a;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.rn-vis-tours-mountain {
|
||||
fill: #23344a;
|
||||
}
|
||||
|
||||
.rn-vis-tours-snow {
|
||||
fill: #e8f0f8;
|
||||
}
|
||||
|
||||
.rn-vis-tours-meadow {
|
||||
fill: #14202d;
|
||||
}
|
||||
|
||||
.rn-vis-tours-trail {
|
||||
.rn-vis-flight-arc {
|
||||
fill: none;
|
||||
stroke: #fbbf24;
|
||||
stroke: oklch(0.8 0.1 250 / 0.75);
|
||||
stroke-width: 1.6;
|
||||
stroke-dasharray: 1;
|
||||
stroke-dashoffset: 1;
|
||||
animation: rn-draw 1.2s cubic-bezier(0.6, 0, 0.3, 1) 0.2s forwards;
|
||||
}
|
||||
|
||||
.rn-vis-flight-airport {
|
||||
fill: #f5f5f7;
|
||||
}
|
||||
|
||||
.rn-vis-flight-plane path {
|
||||
fill: none;
|
||||
stroke: #ffffff;
|
||||
stroke-width: 1.8;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
filter: drop-shadow(0 0 3px oklch(0.85 0.1 250));
|
||||
}
|
||||
|
||||
.rn-vis-flight-code {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
color: oklch(1 0 0 / 0.75);
|
||||
}
|
||||
|
||||
/* rtl-lint-disable-next-line: the map runs west to east in every language */
|
||||
.rn-vis-flight-from {
|
||||
left: 12px; /* rtl-lint-disable */
|
||||
}
|
||||
|
||||
.rn-vis-flight-to {
|
||||
right: 12px; /* rtl-lint-disable */
|
||||
}
|
||||
|
||||
.rn-vis-flight-live {
|
||||
position: absolute;
|
||||
top: 9px;
|
||||
inset-inline-end: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 7px;
|
||||
border-radius: 99px;
|
||||
background: oklch(0.8 0.15 75 / 0.2);
|
||||
border: 1px solid oklch(0.8 0.15 75 / 0.5);
|
||||
color: #fcd34d;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
animation: rn-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 1.3s both;
|
||||
}
|
||||
|
||||
.rn-vis-flight-live i {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: #fbbf24;
|
||||
animation: rn-blink 1.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes rn-blink {
|
||||
50% {
|
||||
opacity: 0.25;
|
||||
}
|
||||
}
|
||||
|
||||
/* The trip PDF: three pages fanned out, the cover on top with the route drawn on it. */
|
||||
.rn-vis-pdf {
|
||||
background:
|
||||
radial-gradient(90% 90% at 70% 40%, oklch(0.66 0.14 300 / 0.3) 0%, transparent 65%),
|
||||
linear-gradient(165deg, #1d1726 0%, #120f18 100%);
|
||||
}
|
||||
|
||||
.rn-vis-pdf-page {
|
||||
position: absolute;
|
||||
top: 14px;
|
||||
left: 50%; /* rtl-lint-disable */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
width: 58px;
|
||||
height: 80px;
|
||||
padding: 8px 7px;
|
||||
border-radius: 4px;
|
||||
background: #f5f5f7;
|
||||
box-shadow: 0 8px 18px oklch(0 0 0 / 0.5);
|
||||
transform-origin: 50% 100%;
|
||||
}
|
||||
|
||||
.rn-vis-pdf-page i {
|
||||
height: 4px;
|
||||
border-radius: 2px;
|
||||
background: #d1d1d6;
|
||||
}
|
||||
|
||||
.rn-vis-pdf-back {
|
||||
animation: rn-fan-back 0.6s cubic-bezier(0.34, 1.3, 0.64, 1) 0.3s both;
|
||||
}
|
||||
|
||||
.rn-vis-pdf-mid {
|
||||
animation: rn-fan-mid 0.6s cubic-bezier(0.34, 1.3, 0.64, 1) 0.45s both;
|
||||
}
|
||||
|
||||
.rn-vis-pdf-cover {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
transform: translateX(-50%);
|
||||
animation: rn-cover 0.45s ease 0.15s both;
|
||||
}
|
||||
|
||||
.rn-vis-pdf-cover svg {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: linear-gradient(160deg, #f97316 0%, #db2777 55%, #6d28d9 100%);
|
||||
}
|
||||
|
||||
.rn-vis-pdf-cover svg circle {
|
||||
fill: #ffffff;
|
||||
}
|
||||
|
||||
.rn-vis-pdf-route {
|
||||
fill: none;
|
||||
stroke: #ffffff;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
stroke-dasharray: 1;
|
||||
stroke-dashoffset: 1;
|
||||
filter: drop-shadow(0 0 2px oklch(0.85 0.16 80 / 0.6));
|
||||
animation: rn-draw 1.3s ease-in-out 0.3s both;
|
||||
animation: rn-draw 1s ease-in-out 0.9s forwards;
|
||||
}
|
||||
|
||||
.rn-vis-tours-walker {
|
||||
fill: #ffffff;
|
||||
filter: drop-shadow(0 0 3px #ffffff);
|
||||
opacity: 0;
|
||||
animation: rn-show 0.2s linear 1.6s both;
|
||||
.rn-vis-pdf-cover b {
|
||||
display: block;
|
||||
height: 5px;
|
||||
margin: 8px 7px 5px;
|
||||
border-radius: 2px;
|
||||
background: #3a3a3c;
|
||||
}
|
||||
|
||||
@keyframes rn-show {
|
||||
.rn-vis-pdf-cover i {
|
||||
margin: 0 7px;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
@keyframes rn-cover {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-50%) translateY(6px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.rn-vis-tours-flag {
|
||||
transform-box: fill-box;
|
||||
transform-origin: 0% 100%;
|
||||
animation: rn-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s both;
|
||||
@keyframes rn-fan-back {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-50%) rotate(0);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(-104%) rotate(-12deg);
|
||||
}
|
||||
}
|
||||
|
||||
.rn-vis-tours-flag line {
|
||||
stroke: #f5f5f7;
|
||||
stroke-width: 1.2;
|
||||
}
|
||||
|
||||
.rn-vis-tours-flag path {
|
||||
fill: #ef4444;
|
||||
}
|
||||
|
||||
.rn-vis-tours-climb {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
inset-inline-start: 9px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
padding: 2px 7px;
|
||||
border-radius: 99px;
|
||||
background: oklch(1 0 0 / 0.14);
|
||||
border: 1px solid oklch(1 0 0 / 0.18);
|
||||
backdrop-filter: blur(6px);
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.rn-vis-tours-kinds {
|
||||
position: absolute;
|
||||
inset-inline: 0;
|
||||
bottom: 7px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.rn-vis-tours-kind {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: oklch(1 0 0 / 0.12);
|
||||
border: 1px solid oklch(1 0 0 / 0.2);
|
||||
backdrop-filter: blur(6px);
|
||||
animation: rn-rise 0.3s ease both;
|
||||
}
|
||||
|
||||
/* TREK Studio: an open book, a polaroid taped in, a title, a stamp and a sticker. */
|
||||
.rn-vis-studio {
|
||||
background:
|
||||
radial-gradient(120% 90% at 50% 115%, oklch(0.62 0.14 45 / 0.38) 0%, transparent 60%),
|
||||
linear-gradient(165deg, #23201c 0%, #171513 100%);
|
||||
}
|
||||
|
||||
.rn-vis-book {
|
||||
position: absolute;
|
||||
inset: 13px 20px 13px;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
transform: perspective(520px) rotateX(16deg);
|
||||
box-shadow:
|
||||
0 16px 22px -10px oklch(0 0 0 / 0.75),
|
||||
0 0 0 1px oklch(1 0 0 / 0.08);
|
||||
}
|
||||
|
||||
.rn-vis-page {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.rn-vis-page-start {
|
||||
background: #ede2c9;
|
||||
}
|
||||
|
||||
.rn-vis-page-end {
|
||||
background: #f6eedc;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 11px 9px 0;
|
||||
}
|
||||
|
||||
.rn-vis-gutter {
|
||||
position: absolute;
|
||||
inset-block: 0;
|
||||
inset-inline-start: 50%;
|
||||
width: 16px;
|
||||
margin-inline-start: -8px;
|
||||
background: linear-gradient(90deg, transparent, oklch(0 0 0 / 0.2), transparent);
|
||||
}
|
||||
|
||||
.rn-vis-polaroid {
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
inset-inline-start: 10px;
|
||||
width: 58%;
|
||||
padding: 3px 3px 9px;
|
||||
background: #ffffff;
|
||||
transform: rotate(-6deg);
|
||||
box-shadow: 0 3px 6px oklch(0 0 0 / 0.25);
|
||||
}
|
||||
|
||||
.rn-vis-polaroid svg {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.rn-vis-sky {
|
||||
fill: #fcd5b0;
|
||||
}
|
||||
.rn-vis-sun {
|
||||
fill: #fb923c;
|
||||
}
|
||||
.rn-vis-peak-far {
|
||||
fill: #7c8aa0;
|
||||
}
|
||||
.rn-vis-peak-near {
|
||||
fill: #334155;
|
||||
}
|
||||
|
||||
.rn-vis-tape {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
inset-inline-start: 30%;
|
||||
width: 24px;
|
||||
height: 7px;
|
||||
transform: rotate(-24deg);
|
||||
background: repeating-linear-gradient(45deg, #f43f5e 0 3px, #fecdd3 3px 6px);
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
.rn-vis-book-title {
|
||||
font-family: Georgia, 'Times New Roman', serif;
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
color: #1f3d2b;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rn-vis-book-line {
|
||||
height: 3px;
|
||||
width: 88%;
|
||||
border-radius: 2px;
|
||||
background: oklch(0.4 0.03 60 / 0.3);
|
||||
}
|
||||
.rn-vis-book-line-short {
|
||||
width: 58%;
|
||||
}
|
||||
|
||||
.rn-vis-stamp {
|
||||
position: absolute;
|
||||
bottom: 9px;
|
||||
inset-inline-end: 9px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
border: 1.5px dashed #b45309;
|
||||
color: #b45309;
|
||||
transform: rotate(-14deg);
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.rn-vis-sticker {
|
||||
position: absolute;
|
||||
bottom: 7px;
|
||||
inset-inline-start: 14px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 50%;
|
||||
background: #facc15;
|
||||
color: #fff8db;
|
||||
box-shadow:
|
||||
0 0 0 2px #ffffff,
|
||||
0 4px 10px oklch(0 0 0 / 0.4);
|
||||
animation: rn-sticker 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
|
||||
}
|
||||
|
||||
.rn-vis-sticker svg {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
/* The assistant: a day in Porto proposed stop by stop, and the button that applies it. */
|
||||
.rn-vis-assist {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 9px 10px;
|
||||
background:
|
||||
radial-gradient(110% 80% at 0% 0%, oklch(0.55 0.2 290 / 0.36) 0%, transparent 62%),
|
||||
linear-gradient(165deg, #1d1b29 0%, #141320 100%);
|
||||
}
|
||||
|
||||
.rn-vis-assist-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.rn-vis-assist-avatar {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 2px 8px oklch(0.55 0.2 290 / 0.6);
|
||||
}
|
||||
|
||||
.rn-vis-assist-typing {
|
||||
display: flex;
|
||||
gap: 3px;
|
||||
padding: 5px 7px;
|
||||
border-radius: 99px;
|
||||
background: oklch(1 0 0 / 0.1);
|
||||
}
|
||||
|
||||
.rn-vis-assist-typing i {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: 50%;
|
||||
background: #f5f5f7;
|
||||
animation: rn-typing 1.2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.rn-vis-assist-typing i:nth-child(2) {
|
||||
animation-delay: 0.15s;
|
||||
}
|
||||
.rn-vis-assist-typing i:nth-child(3) {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
|
||||
.rn-vis-assist-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
padding: 5px 8px;
|
||||
border-radius: 9px;
|
||||
background: oklch(1 0 0 / 0.08);
|
||||
border: 1px solid oklch(1 0 0 / 0.14);
|
||||
box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.12);
|
||||
}
|
||||
|
||||
.rn-vis-assist-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
font-size: 9.5px;
|
||||
line-height: 1.35;
|
||||
animation: rn-rise 0.34s ease both;
|
||||
}
|
||||
|
||||
.rn-vis-assist-time {
|
||||
flex: none;
|
||||
width: 27px;
|
||||
color: oklch(1 0 0 / 0.5);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.rn-vis-assist-dot {
|
||||
flex: none;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.rn-vis-assist-dot-sight {
|
||||
background: #f59e0b;
|
||||
}
|
||||
.rn-vis-assist-dot-culture {
|
||||
background: #a78bfa;
|
||||
}
|
||||
.rn-vis-assist-dot-view {
|
||||
background: #34d399;
|
||||
}
|
||||
.rn-vis-assist-name {
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.rn-vis-assist-apply {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
inset-inline-end: 9px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #22c55e;
|
||||
color: #ffffff;
|
||||
animation:
|
||||
rn-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 1.7s both,
|
||||
rn-ring 2.2s ease-out 2s infinite;
|
||||
}
|
||||
|
||||
/* Help on every screen: the help button, and hello in TREK's languages drifting past it. */
|
||||
.rn-vis-help {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 0 12px;
|
||||
background:
|
||||
radial-gradient(70% 120% at 10% 50%, oklch(0.6 0.16 250 / 0.34) 0%, transparent 70%),
|
||||
linear-gradient(165deg, #1a1f2b 0%, #12151d 100%);
|
||||
}
|
||||
|
||||
.rn-vis-help-q {
|
||||
position: relative;
|
||||
flex: none;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 50%;
|
||||
background: #f5f5f7;
|
||||
color: #101013;
|
||||
font-size: 24px;
|
||||
font-weight: 800;
|
||||
box-shadow:
|
||||
0 0 0 5px oklch(1 0 0 / 0.08),
|
||||
0 6px 16px oklch(0 0 0 / 0.5);
|
||||
}
|
||||
|
||||
.rn-vis-help-count {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
inset-inline-start: 42px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 99px;
|
||||
background: #3b82f6;
|
||||
color: #ffffff;
|
||||
font-size: 9.5px;
|
||||
font-weight: 800;
|
||||
font-variant-numeric: tabular-nums;
|
||||
box-shadow: 0 0 0 2px #12151d;
|
||||
}
|
||||
|
||||
/* The rows slide the same way in every language: they are a picture, not text. */
|
||||
.rn-vis-help-langs {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
overflow: hidden;
|
||||
direction: ltr;
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
|
||||
mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
|
||||
}
|
||||
|
||||
.rn-vis-hello-row {
|
||||
display: flex;
|
||||
width: max-content;
|
||||
animation: rn-marquee 34s linear infinite;
|
||||
}
|
||||
.rn-vis-hello-row-reverse {
|
||||
animation-direction: reverse;
|
||||
animation-duration: 40s;
|
||||
}
|
||||
|
||||
.rn-vis-hello {
|
||||
flex: none;
|
||||
margin-inline-end: 5px;
|
||||
padding: 3px 8px;
|
||||
border-radius: 99px;
|
||||
background: oklch(1 0 0 / 0.09);
|
||||
border: 1px solid oklch(1 0 0 / 0.13);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
@keyframes rn-fan-mid {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-50%) rotate(0);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(4%) rotate(11deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Place search: the query typed into the field, the right place on top. */
|
||||
@@ -795,14 +602,14 @@
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.rn-vis-tours-trail,
|
||||
.rn-vis-tours-flag,
|
||||
.rn-vis-tours-kind,
|
||||
.rn-vis-sticker,
|
||||
.rn-vis-assist-typing i,
|
||||
.rn-vis-assist-row,
|
||||
.rn-vis-assist-apply,
|
||||
.rn-vis-hello-row,
|
||||
.rn-vis-mail-env,
|
||||
.rn-vis-mail-row-new,
|
||||
.rn-vis-mail-check,
|
||||
.rn-vis-flight-arc,
|
||||
.rn-vis-flight-live,
|
||||
.rn-vis-flight-live i,
|
||||
.rn-vis-pdf-page,
|
||||
.rn-vis-pdf-route,
|
||||
.rn-vis-search-query,
|
||||
.rn-vis-search-caret,
|
||||
.rn-vis-search-row,
|
||||
@@ -820,25 +627,32 @@
|
||||
.rn-vis-route-line {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
.rn-vis-tours-trail {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
.rn-vis-tours-walker {
|
||||
.rn-vis-mail-env {
|
||||
display: none;
|
||||
}
|
||||
.rn-vis-sticker {
|
||||
transform: rotate(8deg);
|
||||
.rn-vis-flight-arc,
|
||||
.rn-vis-pdf-route {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
.rn-vis-pdf-back {
|
||||
transform: translateX(-104%) rotate(-12deg);
|
||||
}
|
||||
.rn-vis-pdf-mid {
|
||||
transform: translateX(4%) rotate(11deg);
|
||||
}
|
||||
.rn-vis-pdf-cover {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-tours-trail,
|
||||
[data-reduce-motion='true'] .rn-vis-tours-flag,
|
||||
[data-reduce-motion='true'] .rn-vis-tours-kind,
|
||||
[data-reduce-motion='true'] .rn-vis-sticker,
|
||||
[data-reduce-motion='true'] .rn-vis-assist-typing i,
|
||||
[data-reduce-motion='true'] .rn-vis-assist-row,
|
||||
[data-reduce-motion='true'] .rn-vis-assist-apply,
|
||||
[data-reduce-motion='true'] .rn-vis-hello-row,
|
||||
[data-reduce-motion='true'] .rn-vis-mail-env,
|
||||
[data-reduce-motion='true'] .rn-vis-mail-row-new,
|
||||
[data-reduce-motion='true'] .rn-vis-mail-check,
|
||||
[data-reduce-motion='true'] .rn-vis-flight-arc,
|
||||
[data-reduce-motion='true'] .rn-vis-flight-live,
|
||||
[data-reduce-motion='true'] .rn-vis-flight-live i,
|
||||
[data-reduce-motion='true'] .rn-vis-pdf-page,
|
||||
[data-reduce-motion='true'] .rn-vis-pdf-route,
|
||||
[data-reduce-motion='true'] .rn-vis-search-query,
|
||||
[data-reduce-motion='true'] .rn-vis-search-caret,
|
||||
[data-reduce-motion='true'] .rn-vis-search-row,
|
||||
@@ -859,14 +673,23 @@
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-tours-trail {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-tours-walker {
|
||||
[data-reduce-motion='true'] .rn-vis-mail-env {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-sticker {
|
||||
transform: rotate(8deg);
|
||||
[data-reduce-motion='true'] .rn-vis-flight-arc,
|
||||
[data-reduce-motion='true'] .rn-vis-pdf-route {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-pdf-back {
|
||||
transform: translateX(-104%) rotate(-12deg);
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-pdf-mid {
|
||||
transform: translateX(4%) rotate(11deg);
|
||||
}
|
||||
|
||||
[data-reduce-motion='true'] .rn-vis-pdf-cover {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
|
||||
/** Patreon's mark (simple-icons), drawn in the current text colour. */
|
||||
export const PATREON_PATH =
|
||||
'M22.957 7.21c-.004-3.064-2.391-5.576-5.191-6.482-3.478-1.125-8.064-.962-11.384.604C2.357 3.231 1.093 7.391 1.046 11.54c-.039 3.411.302 12.396 5.369 12.46 3.765.047 4.326-4.804 6.068-7.141 1.24-1.662 2.836-2.132 4.801-2.618 3.376-.836 5.678-3.501 5.673-7.031Z';
|
||||
|
||||
/** Where TREK takes monthly support. */
|
||||
export const PATREON_URL = 'https://www.patreon.com/cw/mauriceboe';
|
||||
|
||||
/** Patreon's own coral, for the icon on the support tiles. */
|
||||
export const PATREON_COLOR = '#ff424d';
|
||||
|
||||
export default function PatreonIcon({
|
||||
size = 18,
|
||||
className,
|
||||
}: {
|
||||
size?: number;
|
||||
className?: string;
|
||||
}): React.ReactElement {
|
||||
return (
|
||||
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden="true">
|
||||
<path d={PATREON_PATH} />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user