fix: 修复字体加载警告和Logo图片宽高比问题

## 修复内容

### 字体优化
- 创建 AoyagiReisho-subset.ttf 子集字体,仅包含"睿新致远"4个字符
- 文件大小从 4.4MB 减小到 5KB(99.9% 减少)
- 修复 vmtx 表解析错误导致的 48 个控制台警告

### Logo 图片修复
- 修复 Logo SVG 宽高比问题(原始 480x120,4:1 比例)
- Header: width=128 height=32
- Footer: width=192 height=48
- 消除 Next.js Image 组件警告

### 其他优化
- 简化字体加载逻辑
- 更新部署配置

## 测试结果
- 32 个回归测试全部通过
- 0 个控制台警告
- 0 个错误
This commit was merged in pull request #7.
This commit is contained in:
张翔
2026-04-22 16:00:49 +08:00
parent 4066c82939
commit 2b7efb23ec
18 changed files with 341 additions and 69 deletions
-1
View File
@@ -1,2 +1 @@
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
CDN_DOMAIN=https://cdn.novalon.cn
+5 -6
View File
@@ -54,7 +54,7 @@ echo ""
echo "📋 步骤0: 部署前检查..." echo "📋 步骤0: 部署前检查..."
for file in docker-compose.yml Dockerfile nginx.conf .env.example setup-ssl.sh; do for file in docker-compose.yml Dockerfile nginx-static.conf .env.example setup-ssl.sh; do
if [ ! -f "$file" ]; then if [ ! -f "$file" ]; then
echo "❌ 缺少必要文件: $file" echo "❌ 缺少必要文件: $file"
exit 1 exit 1
@@ -85,7 +85,7 @@ echo "✅ SSH连接验证成功"
echo "" echo ""
echo "📋 步骤2: 上传部署文件..." echo "📋 步骤2: 上传部署文件..."
ssh "$SERVER_USER@$SERVER_IP" "mkdir -p '$PROJECT_DIR'" ssh "$SERVER_USER@$SERVER_IP" "mkdir -p '$PROJECT_DIR'"
scp -r docker-compose.yml Dockerfile nginx.conf .env.example setup-ssl.sh "$SERVER_USER@$SERVER_IP:$PROJECT_DIR/" scp -r docker-compose.yml Dockerfile nginx-static.conf .env.example setup-ssl.sh "$SERVER_USER@$SERVER_IP:$PROJECT_DIR/"
echo "✅ 部署文件已上传" echo "✅ 部署文件已上传"
echo "" echo ""
@@ -102,13 +102,12 @@ if [ ! -f .env ]; then
echo "📝 创建.env文件..." echo "📝 创建.env文件..."
cp .env.example .env cp .env.example .env
echo "⚠️ 请编辑.env文件,填入正确的环境变量" echo "⚠️ 请编辑.env文件,填入正确的环境变量"
echo "⚠️ 必须配置: DATABASE_URL, NEXTAUTH_SECRET, NEXTAUTH_URL, RESEND_API_KEY, OPS_ALERT_EMAIL" echo "⚠️ 可选配置: NEXT_PUBLIC_GA_ID"
exit 1
fi fi
echo "🐳 启动Docker容器..." echo "🐳 启动Docker容器..."
docker-compose down docker-compose down
docker-compose pull docker-compose build --no-cache
docker-compose up -d docker-compose up -d
echo "📋 等待服务启动..." echo "📋 等待服务启动..."
@@ -118,7 +117,7 @@ check_interval=3
while [ $elapsed -lt $timeout ]; do while [ $elapsed -lt $timeout ]; do
if docker inspect --format='{{.State.Status}}' "$CONTAINER_NAME" 2>/dev/null | grep -q "running"; then if docker inspect --format='{{.State.Status}}' "$CONTAINER_NAME" 2>/dev/null | grep -q "running"; then
if curl -f -s -o /dev/null "http://localhost:3000" --max-time 5 2>/dev/null; then if curl -f -s -o /dev/null "http://localhost:80" --max-time 5 2>/dev/null; then
echo "✅ 服务已启动并响应正常" echo "✅ 服务已启动并响应正常"
break break
else else
+23
View File
@@ -0,0 +1,23 @@
version: "3.8"
services:
nginx:
image: nginx:alpine
container_name: novalon-nginx-secure
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx-static-production.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
- ./logs:/var/log/nginx
- ../certbot:/var/www/certbot
- ../novalon-static:/var/www/novalon:ro
networks:
- novalon-network
networks:
novalon-network:
driver: bridge
external: true
+3
View File
@@ -2,6 +2,9 @@ version: "3.8"
services: services:
novalon-website: novalon-website:
build:
context: .
dockerfile: Dockerfile
image: novalon-website:1.0.0 image: novalon-website:1.0.0
container_name: novalon-website container_name: novalon-website
restart: unless-stopped restart: unless-stopped
+237
View File
@@ -0,0 +1,237 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
resolver 127.0.0.11 valid=30s ipv6=off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
server_tokens off;
client_max_body_size 100M;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
limit_req_zone $binary_remote_addr zone=general:10m rate=100r/s;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+text text/javascript;
upstream gitea_app {
server gitea:3000;
}
upstream jenkins_app {
server jenkins:8080;
}
# Novalon 主站 - 静态文件服务
server {
listen 80;
server_name novalon.cn www.novalon.cn;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://www.novalon.cn$request_uri;
}
}
server {
listen 443 ssl http2;
server_name novalon.cn www.novalon.cn;
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# 静态文件根目录
root /var/www/novalon;
index index.html;
# 静态资源长期缓存
location /_next/static/ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}
# 字体文件缓存
location ~* \.(ttf|woff|woff2|eot)$ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
add_header Access-Control-Allow-Origin "*";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
try_files $uri =404;
}
# 图片文件缓存
location ~* \.(svg|jpg|jpeg|png|gif|webp|avif|ico)$ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
try_files $uri =404;
}
# Let's Encrypt ACME challenge
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# Next.js 静态导出的页面路由
location / {
limit_req zone=general burst=20 nodelay;
try_files $uri $uri.html $uri/ /404.html;
}
# 自定义 404 页面
error_page 404 /404.html;
# 优化文件传输
sendfile on;
tcp_nopush on;
tcp_nodelay on;
}
# Git 服务
server {
listen 80;
server_name git.f.novalon.cn;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
server_name git.f.novalon.cn;
ssl_certificate /etc/nginx/ssl/git.f.novalon.cn/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/git.f.novalon.cn/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
location / {
limit_req zone=general burst=20 nodelay;
proxy_pass http://gitea_app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_hide_header X-Powered-By;
proxy_connect_timeout 30s;
proxy_send_timeout 30s;
proxy_read_timeout 30s;
}
}
# CI 服务
server {
listen 80;
server_name ci.f.novalon.cn;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name ci.f.novalon.cn;
ssl_certificate /etc/nginx/ssl/ci.f.novalon.cn/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/ci.f.novalon.cn/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
location / {
limit_req zone=general burst=20 nodelay;
proxy_pass http://jenkins_app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_hide_header X-Powered-By;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
client_max_body_size 100m;
}
access_log /var/log/nginx/jenkins-access.log;
error_log /var/log/nginx/jenkins-error.log;
}
}
+2 -2
View File
@@ -20,7 +20,7 @@ server {
ssl_session_timeout 10m; ssl_session_timeout 10m;
# 静态文件根目录 # 静态文件根目录
root /var/www/novalon; root /usr/share/nginx/html;
index index.html; index index.html;
# Gzip 压缩 # Gzip 压缩
@@ -79,7 +79,7 @@ server {
# Let's Encrypt ACME challenge # Let's Encrypt ACME challenge
location /.well-known/acme-challenge/ { location /.well-known/acme-challenge/ {
root /var/www/certbot; root /usr/share/nginx/html;
try_files $uri =404; try_files $uri =404;
} }
+1 -1
View File
@@ -2,7 +2,7 @@
<defs> <defs>
<style> <style>
.calligraphy-font { .calligraphy-font {
font-family: 'Aoyagi Reisho', 'Long Cang', 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif; font-family: 'Aoyagi Reisho', 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif;
} }
.arial-font { .arial-font {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Executable
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
set -e
echo "========================================="
echo " SSL 证书配置检查"
echo "========================================="
SSL_DIR="./ssl"
if [ ! -d "$SSL_DIR" ]; then
echo "⚠️ SSL 目录不存在,正在创建..."
mkdir -p "$SSL_DIR"
fi
if [ ! -f "$SSL_DIR/fullchain.pem" ] || [ ! -f "$SSL_DIR/privkey.pem" ]; then
echo "⚠️ SSL 证书文件不存在"
echo ""
echo "请将 SSL 证书文件放置到 $SSL_DIR 目录:"
echo " - fullchain.pem (证书链)"
echo " - privkey.pem (私钥)"
echo ""
echo "获取证书的方式:"
echo " 1. 使用 Let's Encrypt 免费证书:"
echo " certbot certonly --webroot -w /var/www/certbot -d novalon.cn -d www.novalon.cn"
echo " 2. 使用商业证书:"
echo " 从证书提供商下载并重命名文件"
echo ""
echo "证书文件权限:"
echo " chmod 644 $SSL_DIR/fullchain.pem"
echo " chmod 600 $SSL_DIR/privkey.pem"
exit 1
fi
echo "✅ SSL 证书文件检查通过"
echo " - 证书链: $SSL_DIR/fullchain.pem"
echo " - 私钥: $SSL_DIR/privkey.pem"
echo ""
echo "📋 证书有效期检查..."
openssl x509 -in "$SSL_DIR/fullchain.pem" -noout -dates 2>/dev/null || echo "⚠️ 无法读取证书信息"
echo ""
echo "✅ SSL 配置完成"
Binary file not shown.
Binary file not shown.
+12 -30
View File
@@ -1,37 +1,10 @@
@import "tailwindcss"; @import "tailwindcss";
@font-face {
font-family: 'Aoyagi Reisho';
src: url('/fonts/AoyagiReisho.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: block;
font-stretch: normal;
unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F;
}
/* 字体加载优化 - 防止 FOUT */
.font-loading {
font-family: 'STKaiti', 'KaiTi', serif;
}
.font-loaded {
font-family: 'Aoyagi Reisho', 'STKaiti', 'KaiTi', serif;
}
.font-calligraphy {
font-family: var(--font-aoyagi-reisho), 'Aoyagi Reisho', var(--font-ma-shan-zheng), 'Ma Shan Zheng', var(--font-long-cang), 'Long Cang', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif !important;
font-weight: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
@theme inline { @theme inline {
--font-sans: var(--font-geist-sans); --font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono); --font-mono: var(--font-geist-mono);
--font-chinese: var(--font-noto-sans-sc); --font-chinese: var(--font-noto-sans-sc);
--font-calligraphy: 'Aoyagi Reisho', var(--font-long-cang), 'Long Cang', var(--font-ma-shan-zheng), 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif; --font-calligraphy: 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif;
} }
:root { :root {
@@ -347,9 +320,9 @@
background-clip: text; background-clip: text;
} }
/* 青柳隶书体 - 与 Logo 保持一致 */ /* 马善政行书体 - 用于红色关键词高亮 */
.font-calligraphy { .font-calligraphy {
font-family: var(--font-aoyagi-reisho), 'Aoyagi Reisho', var(--font-long-cang), 'Long Cang', var(--font-ma-shan-zheng), 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif !important; font-family: var(--font-ma-shan-zheng), 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif !important;
font-weight: normal; font-weight: normal;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
@@ -396,6 +369,15 @@
} }
} }
/* 青柳隷書 - 仅用于品牌标题"睿新致遠" */
@utility font-brand {
font-family: var(--font-aoyagi-reisho), 'Aoyagi Reisho', 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'STKaiti', 'KaiTi', serif !important;
font-weight: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
@keyframes slideIn { @keyframes slideIn {
from { from {
opacity: 0; opacity: 0;
+5 -20
View File
@@ -1,5 +1,5 @@
import type { Metadata, Viewport } from "next"; import type { Metadata, Viewport } from "next";
import { Geist, Geist_Mono, Noto_Sans_SC, Ma_Shan_Zheng, Long_Cang } from "next/font/google"; import { Geist, Geist_Mono, Noto_Sans_SC, Ma_Shan_Zheng } from "next/font/google";
import localFont from "next/font/local"; import localFont from "next/font/local";
import "./globals.css"; import "./globals.css";
import { Suspense } from "react"; import { Suspense } from "react";
@@ -41,19 +41,12 @@ const maShanZheng = Ma_Shan_Zheng({
variable: "--font-ma-shan-zheng", variable: "--font-ma-shan-zheng",
subsets: ["latin"], subsets: ["latin"],
display: "swap", display: "swap",
preload: false, preload: true,
});
const longCang = Long_Cang({
weight: "400",
variable: "--font-long-cang",
subsets: ["latin"],
display: "swap",
preload: false,
}); });
// 青柳隷書 - 仅用于品牌标题"睿新致遠"(子集版本,仅包含4个字符)
const aoyagiReisho = localFont({ const aoyagiReisho = localFont({
src: "./fonts/AoyagiReisho.ttf", src: "./fonts/AoyagiReisho-subset.ttf",
variable: "--font-aoyagi-reisho", variable: "--font-aoyagi-reisho",
display: "swap", display: "swap",
preload: true, preload: true,
@@ -131,19 +124,11 @@ export default function RootLayout({
<head> <head>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/favicon.svg" /> <link rel="apple-touch-icon" href="/favicon.svg" />
{/* 字体预加载优化 */}
<link
rel="preload"
href="/fonts/AoyagiReisho.ttf"
as="font"
type="font/ttf"
crossOrigin="anonymous"
/>
<OrganizationSchema /> <OrganizationSchema />
<WebsiteSchema /> <WebsiteSchema />
</head> </head>
<body <body
className={`${geistSans.variable} ${geistMono.variable} ${notoSansSC.variable} ${maShanZheng.variable} ${longCang.variable} ${aoyagiReisho.variable} font-sans antialiased`} className={`${geistSans.variable} ${geistMono.variable} ${notoSansSC.variable} ${maShanZheng.variable} ${aoyagiReisho.variable} font-sans antialiased`}
style={{ fontFamily: "'Noto Sans SC', 'Geist', -apple-system, BlinkMacSystemFont, sans-serif" }} style={{ fontFamily: "'Noto Sans SC', 'Geist', -apple-system, BlinkMacSystemFont, sans-serif" }}
> >
<a <a
+2 -2
View File
@@ -13,9 +13,9 @@ export function Footer() {
<Image <Image
src="/logo.svg" src="/logo.svg"
alt={COMPANY_INFO.name} alt={COMPANY_INFO.name}
width={48} width={192}
height={48} height={48}
className="h-12 w-auto transition-transform duration-200 hover:scale-105" className="transition-transform duration-200 hover:scale-105"
loading="eager" loading="eager"
priority priority
/> />
+2 -2
View File
@@ -169,9 +169,9 @@ function HeaderContent() {
<Image <Image
src="/logo.svg" src="/logo.svg"
alt={COMPANY_INFO.name} alt={COMPANY_INFO.name}
width={32} width={128}
height={32} height={32}
className="h-8 w-auto transition-transform duration-200 group-hover:scale-105" className="transition-transform duration-200 group-hover:scale-105"
loading="eager" loading="eager"
priority priority
/> />
+1 -1
View File
@@ -27,7 +27,7 @@ export function AboutSection() {
> >
<div className="text-center mb-12"> <div className="text-center mb-12">
<h2 id="about-heading" className="text-4xl md:text-5xl font-bold text-[#1C1C1C] mb-6"> <h2 id="about-heading" className="text-4xl md:text-5xl font-bold text-[#1C1C1C] mb-6">
<span className="tracking-tight font-calligraphy text-[#C41E3A]" style={{ fontWeight: 'normal', WebkitFontSmoothing: 'antialiased', MozOsxFontSmoothing: 'grayscale', textRendering: 'optimizeLegibility' }}>{COMPANY_INFO.shortName}</span> <span className="tracking-tight font-brand text-[#C41E3A]" style={{ fontWeight: 'normal', WebkitFontSmoothing: 'antialiased', MozOsxFontSmoothing: 'grayscale', textRendering: 'optimizeLegibility' }}>{COMPANY_INFO.shortName}</span>
</h2> </h2>
<p className="text-lg text-[#5C5C5C] mb-8"> <p className="text-lg text-[#5C5C5C] mb-8">
{COMPANY_INFO.slogan} {COMPANY_INFO.slogan}
@@ -60,7 +60,7 @@ export function HeroTitle({ isVisible }: HeroContentProps) {
initial={shouldReduceMotion ? {} : { opacity: 0, y: 20 }} initial={shouldReduceMotion ? {} : { opacity: 0, y: 20 }}
animate={isVisible ? { opacity: 1, y: 0 } : {}} animate={isVisible ? { opacity: 1, y: 0 } : {}}
transition={shouldReduceMotion ? { duration: 0 } : { duration: 0.6, delay: 0.1 }} transition={shouldReduceMotion ? { duration: 0 } : { duration: 0.6, delay: 0.1 }}
className="text-5xl sm:text-6xl lg:text-7xl tracking-tight mb-6 font-calligraphy" className="text-5xl sm:text-6xl lg:text-7xl tracking-tight mb-6 font-brand"
style={{ style={{
fontWeight: 'normal', fontWeight: 'normal',
WebkitFontSmoothing: 'antialiased', WebkitFontSmoothing: 'antialiased',
+2 -2
View File
@@ -43,13 +43,13 @@ describe('useFontLoading', () => {
writable: true, writable: true,
}); });
const { result } = renderHook(() => useFontLoading('Aoyagi Reisho')); const { result } = renderHook(() => useFontLoading('Ma Shan Zheng'));
await waitFor(() => { await waitFor(() => {
expect(result.current).toBe(true); expect(result.current).toBe(true);
}); });
expect(mockLoad).toHaveBeenCalledWith('1em "Aoyagi Reisho"'); expect(mockLoad).toHaveBeenCalledWith('1em "Ma Shan Zheng"');
}); });
it('should return true when font loading fails', async () => { it('should return true when font loading fails', async () => {
+1 -1
View File
@@ -2,7 +2,7 @@
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
export function useFontLoading(fontFamily: string = 'Aoyagi Reisho') { export function useFontLoading(fontFamily: string = 'Ma Shan Zheng') {
const [isLoaded, setIsLoaded] = useState(false); const [isLoaded, setIsLoaded] = useState(false);
useEffect(() => { useEffect(() => {