Skip to content

Commit 57402aa

Browse files
authored
Merge pull request #22 from nowscott:development
🌈 style: 重写了基础模板
2 parents 74a17d2 + 81e8fed commit 57402aa

File tree

7 files changed

+92
-78
lines changed

7 files changed

+92
-78
lines changed

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/src/assets/favicon.ico" />
6+
<link href="https://fonts.cdnfonts.com/css/sofia-pro" rel="stylesheet" crossorigin="anonymous"/>
67
<link rel="stylesheet" href="https://chinese-fonts-cdn.deno.dev/packages/lxgwmanhei/dist/LXGWMarkerGothic/result.css" crossorigin="anonymous" />
78
<link rel="stylesheet" href="https://chinese-fonts-cdn.deno.dev/packages/hwmct/dist/汇文明朝体/result.css" crossorigin="anonymous" />
89
<link rel="stylesheet" href="https://chinese-fonts-cdn.deno.dev/packages/mzxst/dist/MZPXorig/result.css" crossorigin="anonymous" />

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "reposhare",
33
"private": true,
4-
"version": "0.8.9",
4+
"version": "0.8.10",
55
"type": "module",
66
"scripts": {
77
"dev": "vite --host",

src/config/templates.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import {BgColorsOutlined, CreditCardOutlined, BulbFilled, CrownOutlined, BuildFilled, SketchOutlined} from '@ant-design/icons';
3-
// import BasicTemplate from '../templates/Basic';
2+
import {BgColorsOutlined, CreditCardOutlined, BulbFilled, CrownOutlined, BuildFilled, SketchOutlined, GithubOutlined} from '@ant-design/icons';
3+
import BasicTemplate from '../templates/Basic';
44
import InkTemplate from '../templates/Ink';
55
import PixelTemplate from '../templates/Pixel';
66
import CardTemplate from '../templates/Card';
@@ -17,6 +17,7 @@ export interface TemplateConfig {
1717
}
1818

1919
const templates: TemplateConfig[] = [
20+
2021
{
2122
id: 'card',
2223
name: 'Card',
@@ -38,6 +39,13 @@ const templates: TemplateConfig[] = [
3839
description: '像素风格设计,为代码仓库增添复古感',
3940
component: PixelTemplate
4041
},
42+
{
43+
id: 'basic',
44+
name: 'Basic',
45+
icon: <GithubOutlined />,
46+
description: 'Github风格的基础模板,简洁实用',
47+
component: BasicTemplate
48+
},
4149
{
4250
id: 'modern',
4351
name: 'Modern',

src/templates/Basic/index.tsx

+7-12
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,24 @@ export const BasicTemplate: React.FC<BasicTemplateProps> = ({
3232
<div className="stats-group">
3333
{showStars && (
3434
<div className="stat-item">
35-
<span className="stat-label">Stars:</span>
36-
<span className="stat-value">{repoStars}</span>
35+
<span className="stat-value">{repoStars}</span>
3736
</div>
3837
)}
3938
{showForks && (
4039
<div className="stat-item">
41-
<span className="stat-label">Forks:</span>
42-
<span className="stat-value">{repoForks}</span>
40+
<span className="stat-value">{repoForks}</span>
4341
</div>
4442
)}
4543
</div>
46-
<div className="stat-item languages">
47-
<span className="stat-label">Languages:</span>
48-
<div className="language-tags">
49-
{repoLanguages.map((lang, index) => (
50-
<span key={index} className="language-tag">{lang}</span>
51-
))}
52-
</div>
44+
<div className="language-tags">
45+
{repoLanguages.map((lang, index) => (
46+
<span key={index} className="language-tag">{lang}</span>
47+
))}
5348
</div>
5449
</div>
5550
{showAuthorName && authorName && (
5651
<div className="author-info">
57-
<span className="copyright">©</span>
52+
<span className="copyright">Created by</span>
5853
<span className="author-name">{authorName}</span>
5954
</div>
6055
)}

src/templates/Basic/style.css

+67-57
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,138 @@
11
.basic-template {
2-
background: linear-gradient(135deg, #003153 0%, #f5f7fa 100%);
2+
background-color: #f0f4f8;
33
position: relative;
44
width: 100%;
55
height: 100%;
6-
min-height: 400px;
6+
min-height: 360px;
77
display: flex;
88
justify-content: center;
99
align-items: center;
1010
padding: 2rem;
11-
font-family:'Huiwen-mincho';
12-
font-weight:'400'
11+
font-family: 'Sofia Pro', sans-serif;;
1312
}
1413

1514
.basic-template .watermark {
1615
position: absolute;
1716
top: 10px;
1817
left: 50%;
1918
transform: translateX(-50%);
20-
color: rgba(255, 255, 255, 0.6);
21-
font-size: 0.8rem;
22-
font-weight: 500;
19+
color: #2d3748;
20+
font-size: 0.75rem;
21+
font-weight: 400;
2322
pointer-events: none;
2423
user-select: none;
2524
}
2625

2726
.basic-template .content-wrapper {
28-
backdrop-filter: blur(10px);
29-
width: 96%;
3027
padding: 32px;
31-
background: linear-gradient(135deg, #f5f7fa 0%, #003153 100%);
32-
border-radius: 20px;
28+
background: #ffffff;
29+
border: 1px solid #4a90e2;
30+
border-radius: 12px;
3331
display: flex;
3432
flex-direction: column;
35-
gap: 20px;
33+
gap: 24px;
3634
box-sizing: border-box;
37-
box-shadow: 0 10px 30px rgba(0, 49, 83, 0.15);
38-
}
39-
40-
.basic-template .author-info {
41-
display: flex;
42-
align-items: center;
43-
justify-content: center;
44-
font-size: 0.8rem;
45-
color: #78b4dc;
46-
gap: 6px;
47-
}
48-
49-
.basic-template .author-name {
50-
font-weight: 600;
51-
color: #78b4dc;
5235
}
5336

5437
.basic-template .header {
5538
display: flex;
5639
justify-content: space-between;
5740
align-items: center;
58-
margin-bottom: 20px;
41+
margin-bottom: 8px;
5942
}
6043

6144
.basic-template .repo-name {
62-
font-size: 2.8rem;
63-
color: #2c3e50;
45+
font-size: 36px;
46+
color: #1a365d;
6447
margin: 0;
65-
font-weight: bold;
48+
font-weight: 600;
6649
}
6750

6851
.basic-template .repo-homepage {
69-
color: #78b4dc;
52+
color: #4a90e2;
7053
text-decoration: none;
71-
font-size: 1.1rem;
72-
pointer-events: none;
54+
font-size: 16px;
55+
}
56+
57+
.basic-template .repo-homepage:hover {
58+
text-decoration: underline;
7359
}
7460

7561
.basic-template .repo-description {
76-
color: #2c3e50;
77-
font-size: 1.2rem;
62+
color: #2d3748;
63+
font-size: 16px;
7864
line-height: 1.5;
7965
margin: 0;
80-
flex-grow: 1;
8166
}
8267

8368
.basic-template .repo-stats {
8469
display: flex;
8570
justify-content: space-between;
86-
padding-top: 24px;
87-
border-top: 2px solid rgba(44, 62, 80, 0.1);
71+
padding-top: 16px;
72+
border-top: 1px solid #4a90e2;
8873
}
8974

9075
.basic-template .stats-group {
9176
display: flex;
92-
gap: 30px;
77+
gap: 24px;
78+
align-items: center;
9379
}
9480

9581
.basic-template .stat-item {
9682
display: flex;
97-
flex-direction: column;
98-
gap: 5px;
83+
flex-direction: row;
84+
align-items: center;
85+
gap: 8px;
9986
}
10087

101-
.basic-template .stat-label {
102-
font-size: 0.9rem;
103-
color: rgba(255, 255, 255, 0.8);
104-
text-transform: uppercase;
88+
.basic-template .stat-value {
89+
color: #E7A102;
90+
font-weight: 600;
91+
font-size: 20px;
92+
line-height: 1.2;
10593
}
10694

107-
.basic-template .stat-value {
108-
font-size: 1.5rem;
109-
color: #2c3e50;
110-
font-weight: bold;
95+
.basic-template .stat-label {
96+
color: #718096;
97+
font-size: 14px;
98+
text-transform: uppercase;
99+
letter-spacing: 0.05em;
111100
}
112101

113102
.basic-template .language-tags {
114103
display: flex;
115104
flex-wrap: wrap;
116105
gap: 8px;
117-
margin-top: 5px;
106+
justify-content: flex-end;
118107
}
119108

120109
.basic-template .language-tag {
121-
background-color: #f49958;
122-
color: #2c3e50;
123-
padding: 4px 10px;
124-
border-radius: 12px;
125-
font-size: 13px;
126-
display: inline-block;
110+
background-color: #0988FF;
111+
border: 1px solid #0063bf;
112+
border-radius: 2em;
113+
color: #ffffff;
114+
font-size: 14px;
127115
font-weight: 500;
116+
padding: 4px 12px;
117+
line-height: 1;
118+
display: inline-flex;
119+
align-items: center;
120+
}
121+
122+
.basic-template .author-info {
123+
display: flex;
124+
align-items: center;
125+
justify-content: center;
126+
font-size: 14px;
127+
color: #57606a;
128+
gap: 4px;
129+
}
130+
131+
.basic-template .copyright {
132+
color: #2d3748;
133+
}
134+
135+
.basic-template .author-name {
136+
color: #4a90e2;
137+
font-weight: 600;
128138
}

src/templates/Card/style.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
display: flex;
8484
justify-content: space-between;
8585
align-items: center;
86-
margin-bottom: 24px;
86+
margin-bottom: 12px;
8787
width: 100%;
8888
}
8989

@@ -128,7 +128,7 @@
128128
font-size: 1.1rem;
129129
color: rgba(255, 255, 255, 0.8);
130130
line-height: 1.6;
131-
margin: 0 0 16px;
131+
margin: 0;
132132
letter-spacing: 0.01em;
133133
max-width: 70%;
134134
}
@@ -174,8 +174,8 @@
174174
display: flex;
175175
justify-content: space-between;
176176
align-items: center;
177-
margin-top: 32px;
178-
padding-top: 24px;
177+
margin-top: 12px;
178+
padding-top: 12px;
179179
border-top: 1px solid var(--card-border-color);
180180
}
181181

0 commit comments

Comments
 (0)