Skip to content

Commit 3584986

Browse files
committed
chore: 兼容微信内置浏览器
1 parent f128bb6 commit 3584986

File tree

2 files changed

+71
-52
lines changed

2 files changed

+71
-52
lines changed

components/index-page/index.module.css

Lines changed: 68 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,66 +9,86 @@
99
.container {
1010
width: 100%;
1111
margin: 0 auto;
12+
font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", -apple-system,
13+
BlinkMacSystemFont, sans-serif;
1214
}
1315

1416
.hero {
15-
padding-top: 4rem;
16-
padding-bottom: 8rem;
17+
padding: 4rem 1rem 8rem;
1718
text-align: center;
1819
background: #4039e9;
19-
color: white;
20+
background: linear-gradient(to bottom, #4039e9, #3632d1);
21+
color: #fff;
2022
margin-bottom: 4rem;
23+
}
2124

22-
.title {
23-
font-size: 4rem;
24-
font-weight: 700;
25-
margin-bottom: 1.5rem;
26-
display: flex;
27-
justify-content: center;
28-
align-items: center;
29-
color: #fff;
30-
font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", -apple-system,
31-
BlinkMacSystemFont, sans-serif;
25+
.hero .title {
26+
font-size: clamp(2rem, 5vw, 4rem);
27+
font-weight: 700;
28+
margin-bottom: 1.5rem;
29+
display: flex;
30+
justify-content: center;
31+
align-items: center;
32+
color: #fff;
33+
font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
34+
BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
35+
}
3236

33-
/* font-family: 'YuanYingHeiTi', sans-serif; */
34-
/* -webkit-text-stroke: 12px black;
35-
paint-order: stroke fill; */
36-
/* text-shadow: 4px 4px 0px black; */
37-
}
38-
.subtitle {
39-
font-size: 18px;
40-
max-width: 800px;
41-
margin: 0 auto 2rem;
42-
line-height: 1.6;
43-
font-weight: 700;
37+
.hero .subtitle {
38+
font-size: max(16px, min(18px, 2vw));
39+
max-width: min(800px, 90%);
40+
margin: 0 auto 2rem;
41+
line-height: 1.6;
42+
font-weight: 700;
43+
}
44+
45+
.hero .buttonGroup {
46+
display: flex;
47+
gap: 1rem;
48+
justify-content: center;
49+
flex-wrap: wrap;
50+
}
4451

45-
/* -webkit-text-stroke: 6px black;
46-
paint-order: stroke fill;
47-
text-shadow: 4px 4px 0px black; */
52+
.hero .primaryButton,
53+
.hero .secondaryButton {
54+
display: inline-flex;
55+
padding: 0.75rem 2rem;
56+
justify-content: center;
57+
align-items: center;
58+
gap: 0.625rem;
59+
border-radius: 50px;
60+
border: 2px solid #000;
61+
background-color: #6eea29;
62+
color: #000;
63+
font-weight: 700;
64+
font-size: 1rem;
65+
-webkit-filter: drop-shadow(4px 6px 0px #000);
66+
filter: drop-shadow(4px 6px 0px #000);
67+
transition: background-color 0.3s ease, transform 0.2s ease;
68+
}
69+
70+
.hero .primaryButton:hover {
71+
background-color: #62c829;
72+
transform: translateY(2px);
73+
}
74+
75+
@media screen and (max-width: 768px) {
76+
.hero .title {
77+
font-size: 32px;
4878
}
49-
.buttonGroup {
50-
display: flex;
51-
gap: 1rem;
52-
justify-content: center;
79+
80+
.hero .subtitle {
81+
font-size: 16px;
5382
}
54-
55-
.primaryButton,
56-
.secondaryButton {
57-
display: inline-flex;
58-
padding: 12px 32px;
59-
justify-content: center;
83+
84+
.hero .buttonGroup {
85+
flex-direction: column;
6086
align-items: center;
61-
gap: 10px;
62-
border-radius: 50px;
63-
border: 2px solid #000;
64-
background: #6eea29;
65-
color: #000;
66-
font-weight: 700;
67-
font-size: 16px;
68-
filter: drop-shadow(4px 6px 0px #000);
6987
}
70-
71-
.primaryButton:hover {
72-
background: #62c829;
88+
89+
.hero .primaryButton,
90+
.hero .secondaryButton {
91+
width: 80%;
92+
max-width: 300px;
7393
}
7494
}

components/index-page/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ import { Contributors } from "../contributors";
77
import { Testimonials } from "../testimonials";
88
import Footer from "../footer";
99
import { useTranslation } from "../../hooks/useTranslation";
10-
import { useRouter } from 'next/router';
11-
import Image from 'next/image';
10+
import { useRouter } from "next/router";
11+
import Image from "next/image";
1212

1313
const IndexPage: React.FC = () => {
1414
const { t } = useTranslation();
15-
const { basePath } = useRouter();
1615

1716
return (
1817
<>
1918
<div className={styles.container}>
2019
<div className={styles.hero}>
21-
<h1 className={styles.title}>{t("common.title")}</h1>
20+
<div className={styles.title}>{t("common.title")}</div>
2221

2322
<p className={styles.subtitle}>{t("common.subtitle")}</p>
2423
<div className={styles.buttonGroup}>

0 commit comments

Comments
 (0)