feat: mobile-first landing pass, lesson bar, dark default, simulated courses
Inspo MCP references: Hyper Effekt / Ferrari (photo hero), Coursera / Babbel (phone rails). - Hero: headline set on a full-bleed, slowly scrolling reel of portraits - How it works + payment panels replaced by three photo step cards; pay marks inside step 2 - Phones: category and step cards swipe as rails, stats in one row, header fits 360-390px - Lesson bar (Previous / n of N / Next lesson) replaces the app tabs inside a course below 1024px; app tabs show only when signed in - Header logo crossfades from wordmark to monogram on scroll - Language picker is one dropdown (header and footer) - Dark theme by default; saved choice still wins - Demo banner removed - Footer: "Powered by Yaltopia Tech" with a shine sweep - Seed: three more simulated courses (soft glam, traditional Habesha, building your clientele) - artifact-check: data: URIs (the favicon) aren't network requests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3f1993028e
commit
92cc6a8ddf
|
|
@ -12,15 +12,15 @@ const css = readFileSync(join(process.cwd(), '../../packages/features/src/styles
|
|||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang="en" data-theme="light" suppressHydrationWarning>
|
||||
<html lang="en" data-theme="dark" suppressHydrationWarning>
|
||||
<head>
|
||||
{/* next/font emits separate files, so fonts come from Google Fonts (allowed by the artifact CSP, §18.5) */}
|
||||
<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=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+Ethiopic:wght@400;700&family=Noto+Serif+Ethiopic:wght@500;700&display=swap" />
|
||||
<style dangerouslySetInnerHTML={{ __html: css }} />
|
||||
{/* Saved theme, else the OS setting; runs before paint so dark mode doesn't flash white. */}
|
||||
<script dangerouslySetInnerHTML={{ __html: "try{var t=localStorage.getItem('theme')||(matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light');document.documentElement.dataset.theme=t}catch(e){}" }} />
|
||||
{/* Saved theme, else dark (the brand default); runs before paint so there's no flash. */}
|
||||
<script dangerouslySetInnerHTML={{ __html: "try{var t=localStorage.getItem('theme')||'dark';document.documentElement.dataset.theme=t}catch(e){}" }} />
|
||||
</head>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -122,6 +122,51 @@ put('courses', 'crs-skin', order({ ...base, slug: 'skin-prep-and-care', category
|
|||
]),
|
||||
] }));
|
||||
|
||||
// ---- simulated catalog extras so there is more to browse, buy (simulated) and watch
|
||||
put('courses', 'crs-softglam', order({ ...base, slug: 'soft-glam-evening', categoryId: 'cat-fundamentals', instructorName: 'Meron Tesfaye', instructionLocale: 'am', coverTone: 'clay', status: 'PUBLISHED', isFeatured: true, publishedAt: '2026-06-01T08:00:00.000Z', updatedAt: '2026-09-10T08:00:00.000Z', prices: { ETB: 150000 },
|
||||
translations: {
|
||||
en: { title: 'Soft glam for evenings', subtitle: 'A camera-ready evening look in under an hour.', audience: 'Artists who know the basics and want a signature evening look.', description: 'Sculpt, smoke and highlight for parties, graduations and photo shoots, with looks built for deep and medium skin.', outcomes: ['Sculpt with warm bronzer instead of grey contour', 'Build a soft smoky eye in three layers', 'Finish skin that glows on camera without flashback'] },
|
||||
am: { title: 'የምሽት ሶፍት ግላም', subtitle: 'ከአንድ ሰዓት ባነሰ ጊዜ ለካሜራ ዝግጁ የሆነ የምሽት ሜካፕ።', description: 'ለግብዣ፣ ለምረቃና ለፎቶ ቀረጻ ፊትን ማስዋብ፣ የጭስ ዓይንና ብርሃን አሰጣጥ።' },
|
||||
},
|
||||
chapters: [
|
||||
ch('ch-g1', { en: 'Sculpt and glow', am: 'ቅርጽና ብርሃን' }, { en: 'Shape the face with warmth, not shadow.' }, [
|
||||
L('les-g1', 8, tt('Warm sculpting for deep skin', 'ለጠቆረ ቆዳ ሞቅ ያለ ቅርጽ', 'Bocaa gogaa gurraachaaf', 'ቅርጺ ንጸሊም ቆርበት'), { isPreview: true }),
|
||||
L('les-g2', 11, tt('Highlight that photographs well', 'በፎቶ የሚያምር ብርሃን', 'Ifa suuraa irratti mul\'atu', 'ኣብ ስእሊ ዝጽቡቕ ብርሃን')),
|
||||
]),
|
||||
ch('ch-g2', { en: 'Eyes and lips', am: 'ዓይንና ከንፈር' }, { en: 'One soft smoky eye, three ways.' }, [
|
||||
L('les-g3', 14, tt('Soft smoky eye in three layers', 'በሦስት ደረጃ የጭስ ዓይን', 'Ija aaraa sadarkaa sadiin', 'ናይ ትኪ ዓይኒ ብሰለስተ ደረጃ')),
|
||||
L('les-g4', 9, tt('Lips that last the night', 'ሌሊቱን ሙሉ የሚቆይ ከንፈር', 'Hidhii halkan guutuu turu', 'ንምሉእ ለይቲ ዝጸንሕ ከንፈር')),
|
||||
]),
|
||||
] }));
|
||||
|
||||
put('courses', 'crs-habesha', order({ ...base, slug: 'traditional-habesha-looks', categoryId: 'cat-bridal', instructorName: 'Hanna Bekele', instructionLocale: 'am', coverTone: 'sand', status: 'PUBLISHED', publishedAt: '2026-07-01T08:00:00.000Z', updatedAt: '2026-09-15T08:00:00.000Z', prices: { ETB: 180000 },
|
||||
translations: {
|
||||
en: { title: 'Traditional Habesha looks', subtitle: 'Makeup for kemis, holidays and cultural ceremonies.', audience: 'Artists booked for Timket, Meskel, weddings and cultural events.', description: 'Looks that work with netela, gold jewelry and braided hair, from a soft holiday face to a full ceremony look.', outcomes: ['Match makeup to kemis colors and gold', 'Keep the look fresh through an outdoor holiday', 'Work around braids and head jewelry'] },
|
||||
am: { title: 'ባህላዊ የሀበሻ ሜካፕ', subtitle: 'ለሀበሻ ቀሚስ፣ ለበዓላትና ለባህላዊ ሥነ ሥርዓቶች።', description: 'ከነጠላ፣ ከወርቅ ጌጣጌጥና ከሹሩባ ጋር የሚሄድ ሜካፕ።' },
|
||||
},
|
||||
chapters: [
|
||||
ch('ch-h1', { en: 'Holiday looks', am: 'የበዓል ሜካፕ' }, { en: 'Outdoor light and long days call for a soft, sure base.' }, [
|
||||
L('les-h1', 10, tt('A soft look for Timket and Meskel', 'ለጥምቀትና ለመስቀል ለስላሳ ሜካፕ', 'Meekaappii Timqataa fi Masqalaaf', 'ሜካፕ ንጥምቀትን መስቀልን'), { isPreview: true }),
|
||||
L('les-h2', 13, tt('Makeup with gold and netela', 'ከወርቅና ከነጠላ ጋር ሜካፕ', 'Meekaappii warqee fi netelaa wajjin', 'ሜካፕ ምስ ወርቅን ነጠላን')),
|
||||
]),
|
||||
ch('ch-h2', { en: 'Ceremony looks', am: 'የሥነ ሥርዓት ሜካፕ' }, { en: 'Full looks that hold up in photos and in person.' }, [
|
||||
L('les-h3', 16, tt('Full ceremony look, start to finish', 'ሙሉ የሥነ ሥርዓት ሜካፕ', 'Meekaappii sirnaa guutuu', 'ምሉእ ሜካፕ ስነ ስርዓት')),
|
||||
]),
|
||||
] }));
|
||||
|
||||
put('courses', 'crs-clientele', order({ ...base, slug: 'building-your-clientele', categoryId: 'cat-fundamentals', instructorName: 'Meron Tesfaye', instructionLocale: 'en', coverTone: 'ink', status: 'PUBLISHED', publishedAt: '2026-08-01T08:00:00.000Z', updatedAt: '2026-09-18T08:00:00.000Z', prices: { ETB: 60000 },
|
||||
translations: {
|
||||
en: { title: 'Building your clientele', subtitle: 'Pricing, kit and bookings for freelance artists.', audience: 'Artists ready to take paid clients.', description: 'Set your prices, build a kit you can afford, and turn Instagram and Telegram into steady bookings.', outcomes: ['Price a look so it pays', 'Build a starter kit on a budget', 'Get repeat bookings from social media'] },
|
||||
am: { title: 'ደንበኞችዎን መገንባት', subtitle: 'ለግል ባለሙያዎች ዋጋ፣ ዕቃና ቀጠሮ።', description: 'ዋጋ ማውጣት፣ በአቅም ዕቃ መግዛትና ማኅበራዊ ሚዲያን ወደ ቋሚ ቀጠሮ መቀየር።' },
|
||||
},
|
||||
chapters: [
|
||||
ch('ch-c1', { en: 'Getting booked', am: 'ቀጠሮ ማግኘት' }, { en: 'Your first ten clients come from people who already know you.' }, [
|
||||
L('les-c1', 7, tt('What to charge in Addis', 'በአዲስ አበባ ምን ያህል ማስከፈል', 'Finfinneetti meeqa kaffalchiisuu', 'ኣብ ኣዲስ ኣበባ ክንደይ ምኽፋል'), { isPreview: true }),
|
||||
L('les-c2', 9, tt('A starter kit on a budget', 'በአቅም የሚገዛ የመጀመሪያ ኪት', 'Meeshaa jalqabaa baasii xiqqaan', 'መጀመርታ ኪት ብውሑድ ዋጋ')),
|
||||
L('les-c3', 11, tt('Bookings from Instagram and Telegram', 'ከኢንስታግራምና ከቴሌግራም ቀጠሮ', 'Beellama Instagram fi Telegram irraa', 'ቆጸራ ካብ ኢንስታግራምን ቴሌግራምን')),
|
||||
]),
|
||||
] }));
|
||||
|
||||
put('courses', 'crs-business', order({ ...base, slug: 'crs-business', categoryId: 'cat-fundamentals', instructorName: 'Meron Tesfaye', instructionLocale: 'am', coverTone: 'sand', status: 'DRAFT', publishedAt: null, updatedAt: '2026-09-20T08:00:00.000Z', prices: {},
|
||||
translations: { en: { title: 'Building a makeup business', description: 'Pricing, bookings and social media for freelance artists.' }, am: { title: 'የሜካፕ ሥራ መገንባት', description: 'ለግል ባለሙያዎች ዋጋ አወጣጥ፣ ቀጠሮና ማኅበራዊ ሚዲያ።' } },
|
||||
chapters: [ch('ch-x1', { en: 'Pricing your work' }, {}, [L('les-x1', 12, { en: { title: 'What to charge in Addis' } }, { isPublished: false, videoStatus: 'NONE' })])] }));
|
||||
|
|
|
|||
|
|
@ -67,10 +67,16 @@ function SignInGate({ children }: { children: ReactNode }) {
|
|||
|
||||
export function StudentApp() {
|
||||
const t = useTranslations();
|
||||
const { route, locale, nav, signedIn, inbox, settings, setLocale } = useApp();
|
||||
const { route, locale, nav, signedIn, inbox, settings } = useApp();
|
||||
const section = route[1] ?? '';
|
||||
const unread = signedIn ? inbox.filter((n) => !n.readAt).length : 0;
|
||||
const mainRef = useRef<HTMLElement>(null);
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
useEffect(() => {
|
||||
const on = () => setScrolled(scrollY > 24);
|
||||
on(); addEventListener('scroll', on, { passive: true });
|
||||
return () => removeEventListener('scroll', on);
|
||||
}, []);
|
||||
const go = (p: string) => nav(`/${locale}${p}`);
|
||||
const tabs: [string, string, string][] = [['', 'home', t('nav.home')], ['courses', 'grid', t('nav.courses')], ['my', 'book', t('nav.myCourses')], ['help', 'help', t('nav.help')], ['profile', 'user', t('nav.profile')]];
|
||||
const links = tabs.filter(([p]) => p !== 'profile' && (p !== 'my' || signedIn));
|
||||
|
|
@ -78,8 +84,7 @@ export function StudentApp() {
|
|||
|
||||
return (
|
||||
<div lang={locale}>
|
||||
<div className="demo-strip">{t('common.demoBanner')}</div>
|
||||
<header className="s-top">
|
||||
<header className={`s-top${scrolled ? ' scrolled' : ''}`}>
|
||||
<div className="s-top-in">
|
||||
<button className="brand" onClick={() => go('')} aria-label={settings.brandName}><Logo size={36} /><Logo size={36} mark /></button>
|
||||
<nav className="s-nav" aria-label="Main">
|
||||
|
|
@ -88,11 +93,7 @@ export function StudentApp() {
|
|||
<div className="s-actions">
|
||||
<FeedbackButton label={t('common.feedback')} target={() => mainRef.current} />
|
||||
<ThemeToggle label={t('common.theme')} />
|
||||
<label className="lang-pick" title={t('common.language')}><Icon name="globe" size={16} /><span className="sr-only">{t('common.language')}</span>
|
||||
<select id="lang" value={locale} onChange={(e) => setLocale(e.target.value as Locale)}>
|
||||
{LOCALES.map((l) => <option key={l} value={l}>{LOCALE_NAMES[l]}{(DRAFT_LOCALES as readonly string[]).includes(l) ? ' (draft)' : ''}</option>)}
|
||||
</select>
|
||||
</label>
|
||||
<LangPick />
|
||||
{signedIn ? <>
|
||||
<button className="icon-btn" aria-label={`${t('nav.notifications')}${unread ? ` (${unread})` : ''}`} onClick={() => go('/notifications')}><Icon name="bell" />{unread > 0 && <span className="dot">{unread}</span>}</button>
|
||||
<UserMenu />
|
||||
|
|
@ -108,13 +109,25 @@ export function StudentApp() {
|
|||
<StudentRoutes />
|
||||
</main>
|
||||
<Footer />
|
||||
<nav className="s-tabs" aria-label="Main">
|
||||
{signedIn && section !== 'learn' && <nav className="s-tabs" aria-label="Main">
|
||||
{tabs.map(([p, icon, label]) => <button key={p} aria-current={current(p)} onClick={() => go(p ? '/' + p : '')}><Icon name={icon} size={22} />{label}</button>)}
|
||||
</nav>
|
||||
</nav>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LangPick() {
|
||||
const t = useTranslations();
|
||||
const { locale, setLocale } = useApp();
|
||||
return (
|
||||
<label className="lang-pick" title={t('common.language')}><Icon name="globe" size={16} /><span className="sr-only">{t('common.language')}</span>
|
||||
<select value={locale} onChange={(e) => setLocale(e.target.value as Locale)}>
|
||||
{LOCALES.map((l) => <option key={l} value={l}>{LOCALE_NAMES[l]}{(DRAFT_LOCALES as readonly string[]).includes(l) ? ' (draft)' : ''}</option>)}
|
||||
</select>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
|
||||
// The choice lives in localStorage; apps/demo/app/layout.tsx applies it before first paint.
|
||||
function ThemeToggle({ label }: { label: string }) {
|
||||
const [dark, setDark] = useState(false);
|
||||
|
|
@ -157,18 +170,19 @@ function UserMenu() {
|
|||
|
||||
function Footer() {
|
||||
const t = useTranslations();
|
||||
const { settings, locale, nav, setLocale, categories, courses, signedIn, me, route } = useApp();
|
||||
const { settings, locale, nav, categories, courses, signedIn, me, route } = useApp();
|
||||
// Big marketing footer on the landing page and catalog only; app screens get one quiet line (audit 2026-10-16, Q1).
|
||||
const full = (route[1] === undefined && !signedIn) || route[1] === 'courses';
|
||||
const langs = LOCALES.map((l) => <button key={l} lang={l} aria-current={l === locale} onClick={() => setLocale(l)}>{LOCALE_NAMES[l]}</button>);
|
||||
const langs = <LangPick />;
|
||||
if (!full) return (
|
||||
<footer className="foot foot-compact">
|
||||
<div className="foot-base">
|
||||
<Logo size={22} mark /><span>© {new Date().getFullYear()} {settings.brandName}</span>
|
||||
<a href={settings.telegramLink} target="_blank" rel="noreferrer">{t('help.telegram')}</a>
|
||||
<span className="num">{settings.supportPhone}</span>
|
||||
<nav className="foot-langs" aria-label={t('common.language')}>{langs}</nav>
|
||||
<div className="foot-langs">{langs}</div>
|
||||
</div>
|
||||
<p className="powered">{t.rich('footer.poweredBy', { name: () => <a className="shine" href="https://yaltopia.com" target="_blank" rel="noreferrer">Yaltopia Tech</a> })}</p>
|
||||
</footer>
|
||||
);
|
||||
const go = (p: string) => nav(`/${locale}${p}`);
|
||||
|
|
@ -223,6 +237,7 @@ function Footer() {
|
|||
<p>{PHOTO_CREDITS.map(([who, lic, url], k) => <span key={url}>{k > 0 && ' · '}<a href={url} target="_blank" rel="noreferrer">{who}</a> ({lic})</span>)} · Wikimedia Commons, Pexels. Icons: IconPark (Apache-2.0).</p>
|
||||
</details>
|
||||
</div>
|
||||
<p className="powered">{t.rich('footer.poweredBy', { name: () => <a className="shine" href="https://yaltopia.com" target="_blank" rel="noreferrer">Yaltopia Tech</a> })}</p>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
|
@ -261,7 +276,7 @@ const PHOTO_CREDITS: [string, string, string][] = [
|
|||
['T.Voekler', 'CC BY-SA 3.0', 'https://commons.wikimedia.org/wiki/File:Eritrean_woman.jpg'],
|
||||
];
|
||||
const WORK_PHOTOS = ['glam.jpg', 'habesha-harari.jpg', 'bridal.jpg', 'hero.jpg', 'skin.jpg', 'habesha-trad.jpg', 'foundations.jpg', 'habesha-eritrean.jpg', 'clients.jpg', 'habesha-bride.jpg'];
|
||||
const PAY_GROUPS: [string, string[]][] = [['payLocal', ['TELEBIRR', 'CBE_BIRR']], ['payCards', ['VISA', 'MASTERCARD']], ['payAbroad', ['PAYPAL', 'ZELLE']]];
|
||||
const PAY_IDS = ['TELEBIRR', 'CBE_BIRR', 'VISA', 'MASTERCARD', 'PAYPAL', 'ZELLE'];
|
||||
|
||||
function WaitPill({ label }: { label: string }) {
|
||||
const [i, setI] = useState(0);
|
||||
|
|
@ -296,7 +311,7 @@ function Landing() {
|
|||
return (
|
||||
<div className="landing">
|
||||
<section className="l-hero">
|
||||
<div className="l-collage" aria-hidden>{HERO_PHOTOS.map((p, i) => <img key={p} className={`lc lc${i + 1}`} src={`/photos/${p}`} alt="" />)}</div>
|
||||
<div className="reel" aria-hidden><div className="reel-track">{[...HERO_PHOTOS, ...HERO_PHOTOS].map((p, i) => <img key={i} src={`/photos/${p}`} alt="" />)}</div></div>
|
||||
<div className="hero-copy">
|
||||
<WaitPill label={t('landing.waitPill')} />
|
||||
<h1>{t('landing.title')}</h1>
|
||||
|
|
@ -330,25 +345,13 @@ function Landing() {
|
|||
{!catalogLoaded ? <Skeleton h={220} /> : featured.length ? <div className="grid-cards">{featured.map((c) => <CourseCard key={c.id} c={c} />)}</div> : <Empty>{t('catalog.emptyCategory')}</Empty>}
|
||||
</section>
|
||||
|
||||
<section className="how-pay">
|
||||
<div className="how">
|
||||
<h2>{t('landing.howTitle')}</h2>
|
||||
<ol className="how-steps">{['how1', 'how2', 'how3'].map((k) => <li key={k}>{t(`landing.${k}`)}</li>)}</ol>
|
||||
<button className="btn btn-accent btn-lg how-cta" onClick={() => nav(`/${locale}/courses`)}>{t('landing.browse')}<Icon name="chevron" size={16} /></button>
|
||||
</div>
|
||||
<div className="pay-panel">
|
||||
<div className="stack-sm">
|
||||
<h2>{t('landing.payTitle')}</h2>
|
||||
<p>{t('landing.payLead')}{Number.isFinite(minPrice) && <> <strong className="num">{t('landing.from', { price: formatMoney(minPrice, 'ETB') })}</strong></>}</p>
|
||||
</div>
|
||||
{PAY_GROUPS.map(([k, ids]) => (
|
||||
<div key={k} className="pay-group">
|
||||
<span className="pay-label">{t(`landing.${k}`)}</span>
|
||||
<div className="pay-row">{ids.map((id) => <span key={id} className="pay-chip"><PayLogo id={id} />{methodName(id)}</span>)}</div>
|
||||
</div>
|
||||
))}
|
||||
<p className="pay-note"><Icon name="lock" size={14} />{t('landing.payNote')}</p>
|
||||
</div>
|
||||
<section className="stack-lg">
|
||||
<div className="section-h"><div className="stack-sm"><h2>{t('landing.howTitle')}</h2><p className="muted">{t('landing.payLead')}{Number.isFinite(minPrice) && <> <strong className="num">{t('landing.from', { price: formatMoney(minPrice, 'ETB') })}</strong></>}</p></div></div>
|
||||
<ol className="steps3">
|
||||
<li className="step"><img src="/photos/habesha-bride.jpg" alt="" loading="lazy" /><strong>{t('landing.how1')}</strong></li>
|
||||
<li className="step"><img src="/photos/habesha-harari.jpg" alt="" loading="lazy" /><strong>{t('landing.how2')}</strong><div className="step-pay">{PAY_IDS.map((id) => <span key={id} title={methodName(id)}><PayLogo id={id} /></span>)}</div></li>
|
||||
<li className="step"><img src="/photos/habesha-eritrean.jpg" alt="" loading="lazy" /><strong>{t('landing.how3')}</strong></li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section className="cta-photo">
|
||||
|
|
@ -739,6 +742,11 @@ function Player({ slug, lessonId }: { slug?: string; lessonId?: string }) {
|
|||
</aside>
|
||||
</div>
|
||||
{viewer && !viewer.id && <p className="small muted">{t('auth.noIdentity')}</p>}
|
||||
<nav className="l-bar" aria-label={t('player.contents')}>
|
||||
<button disabled={idx === 0} onClick={() => nav(`/${locale}/learn/${c.slug}/${lessons[idx - 1].id}`)}><Icon name="back" size={18} />{t('player.prev')}</button>
|
||||
<button onClick={() => document.querySelector('.p-side')?.scrollIntoView({ behavior: 'smooth' })}><Icon name="list" size={18} /><span className="num">{idx + 1} / {lessons.length}</span></button>
|
||||
<button className="l-next" disabled={!next} onClick={() => nav(`/${locale}/learn/${c.slug}/${next.id}`)}>{t('player.next')}<Icon name="chevron" size={18} /></button>
|
||||
</nav>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ textarea.input { min-height: 110px; resize: vertical; }
|
|||
.modal { background: var(--paper); border-radius: var(--r-lg); padding: 24px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 16px; }
|
||||
.feedback-btn { white-space: nowrap; }
|
||||
@media (max-width: 700px) { .feedback-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .feedback-btn { padding: 0; width: 36px; } }
|
||||
.demo-strip { background: var(--ink); color: var(--on-ink) !important; color: var(--ink); font-size: 12px; text-align: center; padding: 4px 16px; }
|
||||
|
||||
/* ---------- student shell ---------- */
|
||||
.s-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
|
||||
|
|
@ -200,6 +199,12 @@ textarea.input { min-height: 110px; resize: vertical; }
|
|||
|
||||
/* player */
|
||||
.p-wrap { display: grid; gap: 20px; }
|
||||
/* lesson bar replaces the app tabs inside a course on phones/tablets */
|
||||
.l-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--paper); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
|
||||
.l-bar button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: var(--r-pill); padding: 0 14px; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; }
|
||||
.l-bar .l-next { background: var(--ink); color: var(--paper); border-color: var(--ink); }
|
||||
.l-bar button:disabled { opacity: .4; cursor: default; }
|
||||
@media (min-width: 1024px) { .l-bar { display: none; } }
|
||||
@media (min-width: 1024px) { .p-wrap { grid-template-columns: 340px 1fr; align-items: start; } .p-side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; } .p-side-order { order: -1; } }
|
||||
.screen { position: relative; background: #111; color: #fff; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; max-width: 100%; }
|
||||
.screen video { width: 100%; height: 100%; object-fit: contain; background: #000; }
|
||||
|
|
@ -597,39 +602,33 @@ fieldset[disabled] .quiz-opt { cursor: default; }
|
|||
.statbar strong { white-space: nowrap; }
|
||||
@media (max-width: 599px) { .statbar strong { font-size: var(--fs-lg); } }
|
||||
|
||||
/* ---------- landing hero, 2026-10-19: dark stage, photo cards around a centered pitch (waitlist page twin) ---------- */
|
||||
.l-hero { --ink: #F5F5F5; --ink-2: #C9C9C9; --ink-3: #8A8A8A; --paper: #141414; --mist: #1C1C1C; --line: #3A3A3A; --accent: #FFFFFF; --accent-ink: #0A0A0A; --brand-2: #FFFFFF;
|
||||
color: var(--ink); background: #0A0A0A; margin: -12px calc(50% - 50vw + 12px) 0; padding: clamp(96px, 12vw, 150px) 16px clamp(150px, 15vw, 190px); border-radius: 28px; display: grid; place-items: center; text-align: center; isolation: isolate; min-height: min(86svh, 860px); }
|
||||
/* ---------- landing hero, 2026-10-20 (inspo: Hyper Effekt, Ferrari): headline set straight onto a moving reel of portraits ---------- */
|
||||
.l-hero { --ink: #F5F5F5; --ink-2: #D6D6D6; --ink-3: #9A9A9A; --paper: #141414; --mist: #1C1C1C; --line: #3A3A3A; --accent: #FFFFFF; --accent-ink: #0A0A0A; --brand-2: #FFFFFF;
|
||||
position: relative; overflow: hidden; isolation: isolate; color: var(--ink); background: #0A0A0A; margin: -12px calc(50% - 50vw + 12px) 0; border-radius: 28px;
|
||||
min-height: min(88svh, 820px); display: flex; align-items: flex-end; padding: 0 clamp(20px, 5vw, 64px) clamp(28px, 5vw, 64px); }
|
||||
.l-hero::before, .l-hero::after { display: none; }
|
||||
.l-hero .hero-copy { align-items: center; max-width: 680px; gap: 22px; }
|
||||
.l-hero .eyebrow-pill { align-self: center; background: rgba(10, 10, 10, .6); border: 1px solid var(--line); box-shadow: none; backdrop-filter: blur(8px); font-weight: 600; }
|
||||
.l-hero .eyebrow-pill svg { color: #fff; }
|
||||
.l-hero h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1; letter-spacing: -.045em; max-width: 14ch; text-wrap: balance; }
|
||||
.l-hero h1:lang(am), .l-hero h1:lang(ti) { line-height: 1.3; letter-spacing: 0; }
|
||||
.l-hero .lead { max-width: 40ch; text-wrap: pretty; }
|
||||
.l-hero .hero-ctas { justify-content: center; }
|
||||
.reel { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
|
||||
.reel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 10, .55), rgba(10, 10, 10, .05) 30%, rgba(10, 10, 10, .35) 55%, #0A0A0A 96%), linear-gradient(90deg, rgba(10, 10, 10, .7), transparent 60%); }
|
||||
.reel-track { display: flex; gap: 12px; height: 100%; width: max-content; padding: 12px 0; animation: reel 60s linear infinite; }
|
||||
.reel-track img { height: 100%; aspect-ratio: 3 / 4.4; object-fit: cover; object-position: center 22%; border-radius: 18px; flex: none; }
|
||||
.reel-track img:nth-child(odd) { margin-top: 48px; height: calc(100% - 48px); }
|
||||
.l-hero .hero-copy { align-items: flex-start; text-align: left; max-width: 720px; gap: 18px; }
|
||||
.l-hero .live-pill { align-self: flex-start; }
|
||||
.l-hero h1 { font-size: clamp(44px, 7.2vw, 96px); line-height: .96; letter-spacing: -.05em; max-width: 12ch; text-wrap: balance; }
|
||||
.l-hero h1:lang(am), .l-hero h1:lang(ti) { line-height: 1.25; letter-spacing: 0; }
|
||||
.l-hero .lead { max-width: 40ch; text-wrap: pretty; color: var(--ink-2); }
|
||||
.l-hero .btn-ghost { background: rgba(10, 10, 10, .45); backdrop-filter: blur(8px); }
|
||||
.l-hero .btn-ghost:hover { background: #1C1C1C; }
|
||||
.l-hero .play-dot { background: #fff; color: #0A0A0A; }
|
||||
.l-hero .facts { justify-content: center; }
|
||||
.l-collage { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
|
||||
.l-collage::after { content: ''; position: absolute; inset: 0; background: radial-gradient(46% 48% at 50% 50%, rgba(10, 10, 10, .92), rgba(10, 10, 10, 0)); }
|
||||
.lc { position: absolute; width: clamp(120px, 12vw, 210px); aspect-ratio: 9 / 16; object-fit: cover; object-position: center 22%; border-radius: 14px; opacity: 0;
|
||||
animation: lc-rise 900ms var(--ease-out) forwards, lc-drift 9s ease-in-out infinite alternate; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 900ms); }
|
||||
.lc1 { left: -1.5%; top: 20%; --d: 120ms; } .lc2 { left: 18%; top: -8%; } .lc3 { left: 9%; bottom: -10%; aspect-ratio: 4 / 5; --d: 240ms; }
|
||||
.lc4 { right: 12%; top: 38%; --d: 180ms; } .lc5 { right: -1%; top: 6%; --d: 60ms; } .lc6 { right: 7%; bottom: -16%; --d: 300ms; }
|
||||
@keyframes lc-rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
|
||||
@keyframes lc-drift { from { translate: 0 0; } to { translate: 0 -10px; } }
|
||||
@media (max-width: 1100px) { .lc2, .lc4 { display: none; } }
|
||||
.l-hero + .statbar { margin-top: 16px; }
|
||||
@media (max-width: 760px) {
|
||||
.l-hero { display: block; padding: 24px 16px 40px; min-height: 0; margin-top: -8px; border-radius: 22px; }
|
||||
.l-collage { position: relative; inset: auto; overflow: visible; display: flex; justify-content: center; gap: 10px; height: 196px; margin: 0 -16px 20px; z-index: 0; }
|
||||
.l-collage::after, .lc3 { display: none; }
|
||||
.lc { position: relative; inset: auto; width: 96px; flex: none; }
|
||||
.lc1 { rotate: -6deg; top: 16px; } .lc5 { top: 0; } .lc6 { rotate: 6deg; top: 16px; }
|
||||
.l-hero { margin-top: -8px; border-radius: 22px; min-height: 86svh; padding: 0 18px 24px; }
|
||||
.reel-track { animation-duration: 40s; gap: 8px; }
|
||||
.reel-track img { border-radius: 14px; }
|
||||
.reel-track img:nth-child(odd) { margin-top: 28px; height: calc(100% - 28px); }
|
||||
.reel::after { background: linear-gradient(180deg, rgba(10, 10, 10, .5), transparent 22%, rgba(10, 10, 10, .55) 48%, #0A0A0A 82%); }
|
||||
}
|
||||
.l-hero + .statbar { margin-top: calc(-1 * clamp(72px, 8vw, 104px) - 64px); margin-inline: clamp(0px, 4vw, 48px); z-index: 1; }
|
||||
@media (max-width: 899px) { .l-hero + .statbar { margin-top: calc(-1 * clamp(72px, 8vw, 104px) + 16px); margin-inline: 0; } }
|
||||
@media (prefers-reduced-motion: reduce) { .lc { animation: none; opacity: 1; } }
|
||||
@media (prefers-reduced-motion: reduce) { .reel-track { animation: none; } }
|
||||
|
||||
/* ---------- landing 2026-10-20: one font, Habesha photos, live language pill, photo categories, payment stage, both themes ---------- */
|
||||
:root[data-theme="dark"] .l-hero { box-shadow: inset 0 0 0 1px #1F1F1F; }
|
||||
|
|
@ -657,28 +656,22 @@ fieldset[disabled] .quiz-opt { cursor: default; }
|
|||
.look:hover .look-go { transform: translateX(3px); }
|
||||
@media (max-width: 520px) { .look { aspect-ratio: 4 / 5; } .look-copy strong { font-size: var(--fs-base); } }
|
||||
|
||||
.how-pay { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; }
|
||||
@media (max-width: 900px) { .how-pay { grid-template-columns: 1fr; } }
|
||||
.how { display: flex; flex-direction: column; gap: 24px; padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--canvas); }
|
||||
.how h2, .pay-panel h2 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.03em; }
|
||||
.how-cta { align-self: flex-start; margin-top: auto; }
|
||||
.how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; counter-reset: s; }
|
||||
.how-steps li { counter-increment: s; display: flex; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); font-weight: 600; font-size: var(--fs-lg); line-height: 1.3; }
|
||||
.how-steps li::before { content: '0' counter(s); flex: none; font-family: var(--f-head); font-weight: 700; font-size: var(--fs-sm); color: var(--ink-3); width: 28px; }
|
||||
.pay-panel { --ink: #F5F5F5; --ink-3: #9A9A9A; --line: #2A2A2A; color: var(--ink); background: #0A0A0A; border-radius: 24px; padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; isolation: isolate; }
|
||||
.pay-panel::before { content: ''; position: absolute; z-index: -1; width: 360px; height: 360px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%); }
|
||||
:root[data-theme="dark"] .pay-panel { background: #141414; box-shadow: inset 0 0 0 1px #222; }
|
||||
.pay-panel p { color: #C9C9C9; }
|
||||
.pay-panel p strong { color: #fff; }
|
||||
.pay-group { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
|
||||
.pay-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
|
||||
.pay-row { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.pay-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 14px; background: #1A1A1A; border: 1px solid #262626; font-weight: 600; font-size: var(--fs-sm); transition: background 160ms; }
|
||||
.pay-chip:hover { background: #222; }
|
||||
.pay-chip .pay-mark { width: 52px; height: 34px; border-radius: 9px; background: #fff; padding: 4px 6px; }
|
||||
.pay-chip .pay-mark img { width: 100%; height: 100%; }
|
||||
.pay-note { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: auto; }
|
||||
.pay-note svg { flex: none; }
|
||||
/* steps: three photo cards; payment marks live inside step 2 instead of a whole panel */
|
||||
.steps3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; counter-reset: s; }
|
||||
.step { counter-increment: s; position: relative; isolation: isolate; overflow: hidden; border-radius: 22px; min-height: 360px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; color: #fff; background: #141414; }
|
||||
.step > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; z-index: -2; transition: transform 700ms var(--ease-out); }
|
||||
.step::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 30%, rgba(0, 0, 0, .85)); }
|
||||
.step:hover > img { transform: scale(1.04); }
|
||||
.step::before { content: '0' counter(s); position: absolute; top: 16px; left: 18px; font-family: var(--f-head); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(10, 10, 10, .55); backdrop-filter: blur(6px); }
|
||||
.step strong { font-size: clamp(20px, 2vw, 24px); line-height: 1.15; letter-spacing: -.02em; }
|
||||
.step-pay { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.step-pay .pay-mark { width: 44px; height: 28px; border-radius: 7px; background: #fff; padding: 3px 5px; }
|
||||
.step-pay .pay-mark img { width: 100%; height: 100%; }
|
||||
@media (max-width: 760px) {
|
||||
.steps3 { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; scrollbar-width: none; }
|
||||
.steps3::-webkit-scrollbar { display: none; }
|
||||
.step { scroll-snap-align: start; min-height: 320px; }
|
||||
}
|
||||
|
||||
.cta-photo { position: relative; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-end; min-height: 340px; padding: clamp(28px, 4vw, 48px); border-radius: 28px; overflow: hidden; color: #fff; isolation: isolate; }
|
||||
.cta-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; z-index: -2; }
|
||||
|
|
@ -693,10 +686,15 @@ fieldset[disabled] .quiz-opt { cursor: default; }
|
|||
:root[data-theme="dark"] .logo img, .auth-side .logo img { filter: invert(1); }
|
||||
.brand .logo img { max-height: 44px; }
|
||||
.foot-word .logo img { max-width: min(100%, 360px); height: auto !important; }
|
||||
/* header: wordmark on wide screens, the "Sm" monogram on phones (older rules hid the brand's last span) */
|
||||
.brand > .logo { display: inline-grid !important; max-width: none; overflow: visible; }
|
||||
.brand > .logo + .logo { display: none !important; }
|
||||
@media (max-width: 600px) { .brand > .logo:first-child { display: none !important; } .brand > .logo + .logo { display: inline-grid !important; } .brand > .logo + .logo img { height: 46px !important; max-height: none; margin: -6px 0; } }
|
||||
/* header: full wordmark at the top of the page, crossfades to the "Sm" monogram once scrolled (.s-top.scrolled) */
|
||||
.brand { display: grid !important; place-items: center start; }
|
||||
.brand > .logo { grid-area: 1 / 1; display: inline-grid !important; max-width: none; overflow: visible; transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-out); transform-origin: left center; }
|
||||
.brand > .logo + .logo { opacity: 0; transform: scale(.85); pointer-events: none; }
|
||||
.brand > .logo + .logo img { height: 40px !important; max-height: none; }
|
||||
.s-top.scrolled .brand > .logo:first-child { opacity: 0; transform: scale(.9) translateY(-4px); }
|
||||
.s-top.scrolled .brand > .logo + .logo { opacity: 1; transform: none; }
|
||||
@media (max-width: 600px) { .brand > .logo:first-child img { height: 34px !important; } }
|
||||
@media (prefers-reduced-motion: reduce) { .brand > .logo { transition: none; } }
|
||||
|
||||
/* ---------- footer 2026-10-20 (inspo: Little Amps Coffee): framed card, starter-kit card in place of a player, student-work reel ---------- */
|
||||
.foot-full { --frame: #0A0A0A; background: var(--frame); border: 0; margin-top: 64px; padding: 16px 16px 0; color: var(--ink); }
|
||||
|
|
@ -858,3 +856,23 @@ fieldset[disabled] .quiz-opt { cursor: default; }
|
|||
.cd-pane h2 { font-size: var(--fs-lg); }
|
||||
.co .cd-preview { display: none; }
|
||||
}
|
||||
|
||||
/* ---------- mobile-first pass 2026-10-20 (inspo: Coursera / Babbel phone rails) ---------- */
|
||||
@media (max-width: 560px) {
|
||||
/* categories: a swipeable rail instead of a 2-up grid that orphans the third card */
|
||||
.look-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; scrollbar-width: none; }
|
||||
.look-grid::-webkit-scrollbar { display: none; }
|
||||
.look { scroll-snap-align: start; }
|
||||
/* stats: one row of three, icon over number */
|
||||
.l-hero + .statbar { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; }
|
||||
.statbar > div { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 10px; }
|
||||
.statbar .stat-ic { width: 36px; height: 36px; border-radius: 10px; }
|
||||
}
|
||||
/* narrow phones: header actions must fit 360-390px signed out (feedback, theme, language, Get started) */
|
||||
@media (max-width: 420px) { .s-actions { gap: 2px; } .s-actions .lang-pick > svg { display: none; } .s-actions .lang-pick { padding-left: 8px; } .s-top-in { gap: 6px; } }
|
||||
/* "Powered by Yaltopia Tech": a light band sweeps across the name every few seconds */
|
||||
.powered { text-align: center; font-size: 12px; color: var(--ink-3); padding: 18px 16px 4px; letter-spacing: .04em; }
|
||||
.shine { font-weight: 700; text-decoration: none; color: transparent; background: linear-gradient(110deg, var(--ink-2) 40%, #fff 50%, var(--ink-2) 60%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; animation: shine 3.2s linear infinite; }
|
||||
:root:not([data-theme="dark"]) .shine { background-image: linear-gradient(110deg, var(--ink) 40%, #B9B9B9 50%, var(--ink) 60%); }
|
||||
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
|
||||
@media (prefers-reduced-motion: reduce) { .shine { animation: none; color: var(--ink); background: none; } }
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@
|
|||
"alreadyOwned": "ይህ ኮርስ አስቀድሞ የእርስዎ ነው።"
|
||||
},
|
||||
"player": {
|
||||
"prev": "ቀዳሚ",
|
||||
"back": "ወደ ኮርሱ ይመለሱ",
|
||||
"notes": "የትምህርቱ ማስታወሻ",
|
||||
"next": "ቀጣይ ትምህርት",
|
||||
|
|
@ -331,6 +332,7 @@
|
|||
"wellDone": "በጣም ጥሩ — አልፈዋል።"
|
||||
},
|
||||
"footer": {
|
||||
"poweredBy": "በ<name></name> የተሠራ",
|
||||
"tagline": "ሙያውን ይማሩ። ለዘላለም ያቆዩት።",
|
||||
"instructors": "አሠልጣኝ",
|
||||
"learn": "ትምህርት",
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@
|
|||
"alreadyOwned": "You already own this course."
|
||||
},
|
||||
"player": {
|
||||
"prev": "Previous",
|
||||
"back": "Back to course",
|
||||
"notes": "Lesson notes",
|
||||
"next": "Next lesson",
|
||||
|
|
@ -331,6 +332,7 @@
|
|||
"wellDone": "Well done — you passed."
|
||||
},
|
||||
"footer": {
|
||||
"poweredBy": "Powered by <name></name>",
|
||||
"tagline": "Learn the craft. Keep it for life.",
|
||||
"instructors": "Instructor",
|
||||
"learn": "Learn",
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@
|
|||
"alreadyOwned": "Koorsiin kun duraanuu kan keeti."
|
||||
},
|
||||
"player": {
|
||||
"prev": "Kan duraa",
|
||||
"back": "Gara koorsiitti deebi'i",
|
||||
"notes": "Yaadannoo barnootaa",
|
||||
"next": "Barnoota itti aanu",
|
||||
|
|
@ -331,6 +332,7 @@
|
|||
"wellDone": "Baay'ee gaarii — darbiteetta."
|
||||
},
|
||||
"footer": {
|
||||
"poweredBy": "<name></name>n kan hojjetame",
|
||||
"tagline": "Ogummaa baradhu. Bara baraan qabadhu.",
|
||||
"instructors": "Leenjisaa",
|
||||
"learn": "Barnoota",
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@
|
|||
"alreadyOwned": "እዚ ኮርስ ድሮ ናትካ እዩ።"
|
||||
},
|
||||
"player": {
|
||||
"prev": "ዝሓለፈ",
|
||||
"back": "ናብ ኮርስ ተመለስ",
|
||||
"notes": "መዘኻኸሪ ትምህርቲ",
|
||||
"next": "ዝቕጽል ትምህርቲ",
|
||||
|
|
@ -331,6 +332,7 @@
|
|||
"wellDone": "ጽቡቕ — ሓሊፍካ።"
|
||||
},
|
||||
"footer": {
|
||||
"poweredBy": "ብ<name></name> ዝተሰርሐ",
|
||||
"tagline": "ሞያ ተማሃር። ንሓዋሩ ሓዞ።",
|
||||
"instructors": "መምህር",
|
||||
"learn": "ትምህርቲ",
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ await new Promise((r) => setTimeout(r, 2000));
|
|||
for (const route of ['#/am', '#/am/courses', '#/en/help']) { w.location.hash = route; await new Promise((r) => setTimeout(r, 300)); }
|
||||
// React can re-insert hoisted <link>/<script> tags at hydration; jsdom doesn't fetch them, so scan the DOM too.
|
||||
for (const el of w.document.querySelectorAll('link[href],script[src]')) network.push(`${el.tagName.toLowerCase()} ${el.getAttribute('href') ?? el.getAttribute('src')}`);
|
||||
const allowed = (u) => /^link https:\/\/fonts\.(googleapis|gstatic)\.com/.test(u) || /cdnjs\.cloudflare\.com|cdn\.jsdelivr\.net\/npm|fonts\.googleapis\.com|fonts\.gstatic\.com/.test(u);
|
||||
const allowed = (u) => /^(link|script) data:/.test(u) || /^link https:\/\/fonts\.(googleapis|gstatic)\.com/.test(u) || /cdnjs\.cloudflare\.com|cdn\.jsdelivr\.net\/npm|fonts\.googleapis\.com|fonts\.gstatic\.com/.test(u);
|
||||
const bad = network.filter((n) => !allowed(n));
|
||||
console.log({ networkAttempts: bad, errors });
|
||||
process.exit(bad.length || errors.length ? 1 : 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user