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
8 changes: 4 additions & 4 deletions src/components/CookieConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function CookieConsent({ lang }: { lang: Lang }) {
useEffect(() => {
initConsentMode();
if (choice === 'accepted') grantAnalyticsConsent();
return () => window.clearTimeout(timerRef.current);
return () => { window.clearTimeout(timerRef.current); };
}, [choice]);

const showBanner = choice === null || visible;
Expand All @@ -31,7 +31,7 @@ export function CookieConsent({ lang }: { lang: Lang }) {
setVisible(true);
};
window.addEventListener(COOKIE_SETTINGS_EVENT, onOpen);
return () => window.removeEventListener(COOKIE_SETTINGS_EVENT, onOpen);
return () => { window.removeEventListener(COOKIE_SETTINGS_EVENT, onOpen); };
}, []);

if (!showBanner) return null;
Expand Down Expand Up @@ -66,10 +66,10 @@ export function CookieConsent({ lang }: { lang: Lang }) {
</p>
</div>
<div className="cookie-banner-actions">
<Button className="cookie-banner-btn cookie-banner-decline" onClick={() => decide('declined')}>
<Button className="cookie-banner-btn cookie-banner-decline" onClick={() => { decide('declined'); }}>
{t.decline}
</Button>
<Button className="cookie-banner-btn cookie-banner-accept" onClick={() => decide('accepted')}>
<Button className="cookie-banner-btn cookie-banner-accept" onClick={() => { decide('accepted'); }}>
{t.accept}
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function Footer({ disclaimer, cookieSettingsLabel }: { disclaimer?: strin
<p className="footer-copyright">
© 2026 熵序前言(上海)教育科技有限公司. All Rights Reserved.
</p>
<a href="https://beian.miit.gov.cn/" className="footer-link" target="_blank" rel="noopener">
<a href="https://beian.miit.gov.cn/" className="footer-link" target="_blank" rel="noopener noreferrer">
沪ICP备2026033811号
</a>
{cookieSettingsLabel && (
Expand Down
8 changes: 4 additions & 4 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function Nav({
if (!e.matches) setMenuOpen(false);
};
mq.addEventListener('change', onChange);
return () => mq.removeEventListener('change', onChange);
return () => { mq.removeEventListener('change', onChange); };
}, []);

useEffect(() => {
Expand Down Expand Up @@ -97,7 +97,7 @@ export function Nav({
?.querySelector<HTMLAnchorElement>('.nav-overlay-link')
?.focus({ preventScroll: true });
});
return () => cancelAnimationFrame(id);
return () => { cancelAnimationFrame(id); };
}
if (wasOpenRef.current) {
wasOpenRef.current = false;
Expand Down Expand Up @@ -127,7 +127,7 @@ export function Nav({
href={logoHref}
className="nav-logo"
aria-label="Entropy"
onClick={() => setMenuOpen(false)}
onClick={() => { setMenuOpen(false); }}
>
<img src="assets/entropy_logo.svg" alt="Entropy" />
</a>
Expand Down Expand Up @@ -166,7 +166,7 @@ export function Nav({
aria-label={menuOpen ? '关闭菜单' : '打开菜单'}
aria-expanded={menuOpen}
aria-controls="nav-overlay"
onClick={() => setMenuOpen((open) => !open)}
onClick={() => { setMenuOpen((open) => !open); }}
>
<span></span>
<span></span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScrollTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function ScrollTop({ visible }: { visible: boolean }) {
<Button
className={`scroll-top${visible ? ' visible' : ''}`}
aria-label="回到顶部"
onClick={() => scrollToTarget(0)}
onClick={() => { scrollToTarget(0); }}
>
<ArrowUpIcon />
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function ToastProvider({ children }: { children: React.ReactNode }) {
onOpenChange={(open) => {
if (!open) closeToast(toast.id);
}}
onSwipeEnd={() => closeToast(toast.id)}
onSwipeEnd={() => { closeToast(toast.id); }}
onAnimationEnd={() => {
if (!toast.open) removeToast(toast.id);
}}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function TeamCard({
return (
<div
className={`team-card reveal${active ? ' is-active' : ''}${interactive ? ' has-sign' : ''}`}
onClick={interactive ? () => onToggle(active ? null : member.avatar) : undefined}
onClick={interactive ? () => { onToggle(active ? null : member.avatar); } : undefined}
onKeyDown={
interactive
? (e) => {
Expand All @@ -121,7 +121,7 @@ function TeamCard({
alt={nickname}
loading="lazy"
decoding="async"
onError={() => setImgFailed(true)}
onError={() => { setImgFailed(true); }}
/>
)}
</div>
Expand Down Expand Up @@ -160,7 +160,7 @@ export function Team() {
// Lenis 的 scrollTo 自动应用 scroll-margin-top;refresh=true 确保滚动上限已更新
scrollToTarget(target, 0, true);
}, 120);
return () => clearTimeout(timer);
return () => { clearTimeout(timer); };
}, [ready]);

const handleToggleLang = () => {
Expand Down
12 changes: 6 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ function mpa404Fallback(): Plugin {
configureServer(server) {
const { root, publicDir } = server.config;
server.middlewares.use(async (req: IncomingMessage, res: ServerResponse, next: Next) => {
if (!isHtmlNavigation(req)) return next();
if (!isHtmlNavigation(req)) { next(); return; }
const urlPath = requestPath(req);
if (knownPages.includes(urlPath)) return next();
if (publicDir && fs.existsSync(path.join(publicDir, urlPath))) return next();
if (knownPages.includes(urlPath)) { next(); return; }
if (publicDir && fs.existsSync(path.join(publicDir, urlPath))) { next(); return; }
const source = path.join(root, '404.html');
if (!fs.existsSync(source)) return next();
if (!fs.existsSync(source)) { next(); return; }
const html = fs.readFileSync(source, 'utf-8');
res.statusCode = 404;
res.setHeader('Content-Type', 'text/html');
Expand All @@ -76,9 +76,9 @@ function mpa404Fallback(): Plugin {
if (!isHtmlNavigation(req)) return next();
const urlPath = requestPath(req);
if (knownPages.includes(urlPath)) return next();
if (fs.existsSync(path.join(outDir, urlPath))) return next();
if (fs.existsSync(path.join(outDir, urlPath))) { next(); return; }
const file = path.join(outDir, '404.html');
if (!fs.existsSync(file)) return next();
if (!fs.existsSync(file)) { next(); return; }
res.statusCode = 404;
res.setHeader('Content-Type', 'text/html');
res.end(fs.readFileSync(file, 'utf-8'));
Expand Down
Loading