Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,22 @@ summary{font-weight:700;cursor:pointer}
.style-warm .footer a{color:#F3E8F7}
.style-warm details{border:0;box-shadow:0 4px 12px color-mix(in srgb,var(--ink) 6%,transparent)}

/* Evening (SwingAndScore): a dark night-out hero and footer, light pages in between so articles stay easy to read. */
.age-gate button{font:inherit}
.style-evening{--eyebrow:var(--accent);--card-radius:22px;--night:#1B1020;--night-ink:#F6E9F0;--night-sub:#D4BFCC}
.style-evening .hero-band{background:radial-gradient(900px 420px at 90% 0%,color-mix(in srgb,var(--accent) 55%,transparent),transparent 65%),radial-gradient(700px 380px at 0% 100%,color-mix(in srgb,var(--second) 22%,transparent),transparent 60%),var(--night);color:var(--night-ink)}
.style-evening .hero-copy h1{font-weight:700;color:var(--night-ink)}
.style-evening .hero-copy .lead{color:var(--night-sub)}
.style-evening .hero-copy .eyebrow{display:inline-block;justify-self:start;color:var(--night-ink);border:1px solid color-mix(in srgb,var(--night-ink) 35%,transparent);padding:6px 14px;border-radius:999px;font-size:15px}
.style-evening .hero-copy .checks li::before{border-color:var(--second)}
.style-evening .join{border:0;box-shadow:0 22px 50px rgba(0,0,0,.35);color:var(--ink)}
.style-evening .btn{border-radius:999px}
.style-evening .card{border:0;box-shadow:0 6px 18px color-mix(in srgb,var(--ink) 8%,transparent)}
.style-evening .num{background:var(--accent);color:#fff;width:48px;height:48px;border-radius:24px;font-size:20px}
.style-evening .cta{background:linear-gradient(120deg,var(--night),var(--accent))}
.style-evening .footer{background:var(--night);color:var(--night-sub)}
.style-evening .footer a{color:var(--night-ink)}

@media(max-width:820px){.hero{grid-template-columns:1fr;padding-block:36px;gap:28px}.nav .hide-sm{display:none}}
/* Cookie choice: shown only when the owner turned on Google tags for this site. */
.consent{position:fixed;left:16px;right:16px;bottom:16px;z-index:50;max-width:560px;margin-inline:auto;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 8px 30px rgba(0,0,0,.18);padding:16px 18px;display:grid;gap:12px;font-size:15px;line-height:1.45}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function generateMetadata(): Promise<Metadata> {
const site = await getSite();
return {
title: { default: `${site.name}: ${site.audience}`, template: `%s | ${site.name}` },
description: `${site.tagline} ${site.audience}. Verified members, private photos you control.`,
description: `${site.tagline} ${site.audience.replace(/\.$/, '')}. Verified members, private photos you control.`,
openGraph: { siteName: site.name, type: 'website' },
robots: { index: true, follow: true },
};
Expand Down Expand Up @@ -67,7 +67,7 @@ export default async function RootLayout({ children }: { children: ReactNode })
<footer className="footer">
<div className="wrap">
<strong className="footer-name">{site.name}</strong>
<span>{site.audience}. Part of the WhatBox network.</span>
<span>{site.audience.replace(/\.$/, '')}. Part of the WhatBox network.</span>
{topics.length ? (
<nav aria-label="Resources" className="footer-topics">
<a href="/guides"><strong>Resources</strong></a>
Expand Down
3 changes: 2 additions & 1 deletion apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { Metadata } from 'next';
import { HOME_SLUG, landingStyle, type ContentPage, type PublicSite } from '@whatbox/core';
import { appUrl, baseUrl, getPages, getSite } from '../lib/site';
import { FriendsScene, MeetupScene } from './scenes';
import { EveningScene, FriendsScene, MeetupScene } from './scenes';

type Section = { heading: string; cards: { title: string; text: string }[] };

Expand Down Expand Up @@ -44,6 +44,7 @@ function Art({ style, image, alt }: { style: string; image?: string; alt?: strin
if (image && /^(https:\/\/|\/(?!\/))\S+$/.test(image)) return <img className="scene photo" src={image} alt={alt ?? ''} />;
if (style === 'accessible') return <FriendsScene />;
if (style === 'warm') return <MeetupScene />;
if (style === 'evening') return <EveningScene />;
return null;
}

Expand Down
34 changes: 34 additions & 0 deletions apps/web/app/scenes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,37 @@ export function MeetupScene() {
</svg>
);
}

/** Adult sites (SwingAndScore): a night out, with no people at all. A skyline, a moon, and two glasses meeting in a toast. */
export function EveningScene() {
const towers = [[0, 210, 46], [50, 180, 38], [92, 228, 30], [126, 160, 44], [174, 200, 34], [212, 140, 40], [256, 190, 28], [288, 170, 46], [338, 214, 32], [374, 150, 42], [420, 196, 36], [460, 172, 60]];
const glass = (x: number, tilt: number, fill: string) => (
<g transform={`translate(${x} 150) rotate(${tilt})`}>
<path d="M-34 0 H34 L4 46 V104 H-4 V46 Z" fill="rgba(255,255,255,.08)" stroke="#F6E9F0" strokeWidth="3" strokeLinejoin="round" />
<path d="M-25 13 H25 L4 41 H-4 Z" fill={fill} />
<path d="M-24 104 H24" stroke="#F6E9F0" strokeWidth="4" strokeLinecap="round" />
</g>
);
return (
<svg className="scene" viewBox="0 0 520 340" role="img" aria-label="Illustration: two cocktail glasses meeting in a toast in front of a city skyline at night.">
<defs>
<linearGradient id="night" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#1B1020" /><stop offset="1" stopColor="color-mix(in srgb, var(--accent) 45%, #1B1020)" /></linearGradient>
</defs>
<rect x="0" y="0" width="520" height="340" rx="28" fill="url(#night)" />
{[[40, 40], [120, 70], [190, 30], [300, 56], [350, 24], [470, 110], [250, 90], [80, 110]].map(([x, y]) => <circle key={`${x}-${y}`} cx={x} cy={y} r="1.8" fill="#F6E9F0" opacity=".7" />)}
<circle cx="430" cy="64" r="30" fill="var(--second)" />
<circle cx="444" cy="54" r="27" fill="#1B1020" />
<g fill="#2B1830">
{towers.map(([x, top, w]) => <rect key={x} x={x} y={top} width={w} height={340 - top} />)}
</g>
<g fill="var(--second)" opacity=".55">
{towers.flatMap(([x, top, w]) => [0, 1, 2].map((r) => <rect key={`${x}-${r}`} x={x + 8 + (r % 2) * (w - 24)} y={top + 16 + r * 26} width="6" height="8" />))}
</g>
{glass(222, -12, 'var(--accent)')}
{glass(298, 12, 'var(--second)')}
<g stroke="#F6E9F0" strokeWidth="3" strokeLinecap="round">
<path d="M260 120 v-16" /><path d="M246 126 l-10 -10" /><path d="M274 126 l10 -10" />
</g>
</svg>
);
}
4 changes: 3 additions & 1 deletion packages/core/src/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export function upgradeSiteTheme(site: Site): boolean {
let changed = false;
const tpl = seedSites(new Date()).find((t) => t.slug === site.slug);
if (!site.theme.style) { site.theme.style = tpl?.theme.style ?? (site.settings.mode === 'sensitive' ? 'discreet' : 'warm'); changed = true; }
// SwingAndScore first shipped with DateALittle's warm layout (and its meetup illustration of little people).
if (site.slug === 'swingandscore' && site.theme.style === 'warm') { site.theme.style = 'evening'; changed = true; }
if (site.slug === 'hfriends' && site.theme.headingFont === 'Libre Franklin' && site.theme.bodyFont === 'Figtree') { Object.assign(site.theme, HFRIENDS_TYPE); changed = true; }
return changed;
}
Expand Down Expand Up @@ -147,7 +149,7 @@ export function seedSites(now: Date): Site[] {
audience: 'For couples and singles in the swinger lifestyle. Adults 18+ only.',
theme: {
ground: '#F7F2F4', surface: '#FFFFFF', ink: '#221722', sub: '#5A4858', line: '#E7DAE2', accent: '#8E2459',
accentSoft: '#F5E3EC', second: '#C8952E', alert: '#9A2E3A', headingFont: 'Fraunces', bodyFont: 'Figtree', radius: 999, style: 'warm',
accentSoft: '#F5E3EC', second: '#C8952E', alert: '#9A2E3A', headingFont: 'Fraunces', bodyFont: 'Figtree', radius: 999, style: 'evening',
fontsHref: 'https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Figtree:wght@400;500;600;700&display=swap',
},
settings: settings({ mode: 'adult', publicTeasers: false, couples: true, photoModeration: 'pre', paymentProvider: 'none' }),
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export interface SiteTheme {
heroAlt?: string; // its description for screen readers
}

/** Public site layouts: discreet (sensitive sites), accessible (larger text, strong focus, plain shapes), warm (rounded, playful). */
export type SiteLandingStyle = 'discreet' | 'accessible' | 'warm';
/** Public site layouts: discreet (sensitive sites), accessible (larger text, strong focus, plain shapes), warm (rounded, playful),
* evening (adult sites: a dark night-out hero, no people pictured). */
export type SiteLandingStyle = 'discreet' | 'accessible' | 'warm' | 'evening';

// Membership tiers. Each site owner edits what each tier can do. Pricing is by tier, never by gender.
export type Tier = 'free' | 'paid' | 'vip';
Expand Down
10 changes: 10 additions & 0 deletions packages/core/test/couples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,13 @@ test('couple profiles stay off on other sites, and adult sites refuse the apps',
const app = await join(mp, 'swingandscore', 'phone@example.com', 'ios');
await assert.rejects(app.me(), (e: ApiError) => e.code === 'web_only');
});

test('SwingAndScore uses the evening look, and sites saved with the first look move to it', async () => {
const { seedSites, upgradeSiteTheme, landingStyle } = await import('../src/index');
const s = seedSites(new Date()).find((x) => x.slug === 'swingandscore')!;
assert.equal(landingStyle(s), 'evening');
s.theme.style = 'warm';
assert.equal(upgradeSiteTheme(s), true);
assert.equal(s.theme.style, 'evening');
assert.equal(upgradeSiteTheme(s), false);
});
Loading