选题

那自然是模之屋啦,一个3D模型资源网站,主要提供角色模型、场景模型、动作数据分享和文件格式转换服务。

首页搭建

head配置

1
2
<!--引入css文件-->
<link rel="stylesheet" href="css/style.css">

导航栏搭建

html搭建

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<header class="navbar">
<div class="nav-container">
<div class="nav-left">
<div class="logo">
<img src="./img/title-icon.png" alt="模之屋">
</div>
</div>
<nav class="nav-center">
<ul class="nav-menu">
<li><a href="index.html" class="active">首页</a></li>
<li><a href="models.html">模型</a></li>
<li><a href="articles.html">文章</a></li>
<li><a href="authors.html">作者</a></li>
<li><a href="illustrations.html">插画</a></li>
</ul>
</nav>
<div class="nav-right">
<div class="search-box">
<input type="text" placeholder="搜索模型、作者、文章..." class="search-input">
<button class="search-btn"><i class="fas fa-search"></i></button>
</div>
<div class="user-actions">
<button class="btn-login">登录</button>
</div>
</div>
</div>
</header>

css样式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* 背景样式 */
.navbar {
background: white;
color: #2c3e50;
padding: 0;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* 容器样式 */
.nav-container {
max-width: 1400px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
height: 60px;
}
/* 标题字体(弃用) */
.nav-left .logo {
display: flex;
align-items: center;
gap: 10px;
font-size: 20px;
font-weight: bold;
color: #2c3e50;
}
/* 标题图片 */
.logo img {
height: 40px;
width: auto;
object-fit: contain;
border-radius: 8px;
}

.nav-center {
flex: 1;
display: flex;
justify-content: center;
}
/* 导航菜单列表 */
.nav-menu {
display: flex;
list-style: none;
gap: 30px;
align-items: center;
}
/* 文本链接样式不变色 */
.nav-menu a {
color: #2c3e50;
text-decoration: none;
padding: 8px 16px;
border-radius: 6px;
transition: all 0.3s ease;
font-size: 14px;
}

.nav-menu a:hover,
.nav-menu a.active {
color: #667eea;
background: rgba(102, 126, 234, 0.1);
}
/* 搜索框部分样式 */
.nav-right {
display: flex;
align-items: center;
gap: 20px;
}

实现效果:

轮播图

html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<section class="hero-carousel">
<div class="carousel-container">
<div class="carousel-track">
<div class="carousel-slide active" data-bg="img/gundong1.png">
<div class="slide-background"></div>
<div class="slide-content">
<div class="slide-text">
</div>
</div>
</div>

<div class="carousel-slide" data-bg="img/gundong2.jpg">
<div class="slide-background"></div>
<div class="slide-content">
<div class="slide-text">
</div>
</div>
</div>

<div class="carousel-slide" data-bg="img/gundong3.png">
<div class="slide-background"></div>
<div class="slide-content">
<div class="slide-text">
</div>
</div>
</div>

<div class="carousel-slide" data-bg="img/gundong4.jpg">
<div class="slide-background"></div>
<div class="slide-content">
<div class="slide-text">
</div>
</div>
</div>
</div>

<!-- 导航按钮 -->
<button class="carousel-nav prev" onclick="changeSlide(-1)">
<i class="fas fa-chevron-left"></i>
</button>
<button class="carousel-nav next" onclick="changeSlide(1)">
<i class="fas fa-chevron-right"></i>
</button>

<!-- 指示器 -->
<div class="carousel-indicators">
<button class="indicator active" onclick="goToSlide(0)"></button>
<button class="indicator" onclick="goToSlide(1)"></button>
<button class="indicator" onclick="goToSlide(2)"></button>
<button class="indicator" onclick="goToSlide(3)"></button>
</div>
</div>
</section>

css样式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.hero-carousel {
max-width: 1360px; /* 与content-wrapper对齐,减去左右padding 20px */
margin: 30px auto 30px auto; /* 居中对齐,上下间距30px */
padding: 0 20px; /* 与content-wrapper保持一致的左右边距 */
position: relative;
overflow: hidden;
border-radius: 20px;
/* 使用aspect-ratio保持999:249.750的比例 (约4:1) */
aspect-ratio: 999 / 249.750;
/* 最小和最大高度限制 */
min-height: 200px;
max-height: 350px;
}
.carousel-container {
width: 100%;
height: 100%;
position: relative;
}

.carousel-track {
display: flex;
width: 400%;
height: 100%;
transition: transform 0.5s ease-in-out;
}

.carousel-slide {
width: 25%;
height: 100%;
position: relative;
overflow: hidden;
}

.carousel-slide.active {
/* 当前激活的轮播图 */
}

.slide-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}

.slide-background::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
z-index: 1;
}
.slide-content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 0 60px;
z-index: 2;
}

.slide-text {
color: white;
max-width: 600px;
text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.slide-text h1 {
font-size: 48px;
font-weight: bold;
margin-bottom: 20px;
line-height: 1.2;
text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.slide-text .highlight {
color: #ff6b9d;
background: linear-gradient(45deg, #ff6b9d, #c44569);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: none;
filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.slide-text p {
font-size: 18px;
margin-bottom: 30px;
opacity: 0.95;
line-height: 1.6;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

实现效果

推荐栏

html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<div class="content-wrapper">
<!-- 左侧主要内容 -->
<div class="main-section">
<!-- 推荐作者区域 -->
<section class="recommended-authors">
<div class="section-header">
<h2><img src="./img/auther-icon.png" alt="作者图标" class="section-icon"> 推荐作者</h2>
<div class="header-actions">
<button class="filter-btn" id="refresh-authors-btn">换一批</button>
<button class="more-btn" id="more-authors-btn">更多 →</button>
</div>
</div>
<div class="authors-grid" id="authors-grid">
<!-- 作者数据将动态加载 -->
<div style="text-align: center; padding: 40px; color: #999;">正在加载推荐作者...</div>
</div>
</section>
<!-- 模型精选区域 -->
<section class="featured-models">
<div class="section-header">
<h2><img src="./img/model-icon.png" alt="模型图标" class="section-icon"> 模型精选</h2>
<div class="header-actions">
<button class="filter-btn">换一批</button>
<button class="more-btn">更多 →</button>
</div>
</div>
<div class="models-grid" id="featured-models-grid">
<!-- 模型将动态加载 -->
</div>
</section>
</div>

css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
.content-wrapper {
display: flex;
gap: 30px;
padding: 0 20px;
margin-bottom: 40px;
}

.main-section {
flex: 1;
}

.sidebar {
width: 300px;
}

/* 区域标题 */
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
font-size: 24px;
color: #2c3e50;
display: flex;
align-items: center;
gap: 10px;
}

.section-header h2 i {
color: #667eea;
}

/* 章节图标样式 */
.section-header h2 .section-icon {
width: 20px;
height: 20px;
object-fit: contain;
margin-right: 5px;
}

.header-actions {
display: flex;
gap: 10px;
}

.filter-btn, .more-btn {
background: #f8f9fa;
border: 1px solid #dee2e6;
padding: 6px 12px;
border-radius: 6px;
font-size: 12px;
cursor: pointer;
transition: all 0.3s ease;
}

.filter-btn:hover, .more-btn:hover {
background: #e9ecef;
}

.more-btn {
color: #667eea;
border-color: #667eea;
}

/* 推荐作者网格 */
.authors-grid {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 20px;
margin-bottom: 40px;
max-width: 100%;
overflow: hidden;
transition: opacity 0.3s ease;
}

.author-card {
background: white;
padding: 20px;
border-radius: 12px;
text-align: center;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
cursor: pointer;
position: relative;
overflow: hidden;
opacity: 0;
transform: translateY(20px);
animation: authorCardFadeIn 0.6s ease forwards;
}

.author-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.author-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.author-avatar {
position: relative;
display: inline-block;
margin-bottom: 15px;
}

.author-card img {
width: 80px;
height: 80px;
border-radius: 50%;
object-fit: cover;
border: 3px solid #f8f9fa;
transition: border-color 0.3s ease;
}

.author-card:hover img {
border-color: #667eea;
}

.verified-badge {
position: absolute;
bottom: -2px;
right: -2px;
background: #28a745;
color: white;
width: 20px;
height: 20px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-weight: bold;
border: 2px solid white;
}
.author-card h3 {
font-size: 16px;
color: #2c3e50;
margin-bottom: 5px;
font-weight: 600;
}

.author-level {
font-size: 12px;
color: #667eea;
margin-bottom: 10px;
font-weight: 500;
}

.author-stats {
display: flex;
justify-content: center;
gap: 15px;
margin: 10px 0;
font-size: 11px;
color: #6c757d;
}

.stat-item {
display: flex;
align-items: center;
gap: 3px;
}

.stat-item i {
color: #667eea;
font-size: 10px;
}

.author-tags {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 6px;
margin-top: 12px;
}

.author-tag {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 3px 8px;
border-radius: 12px;
font-size: 10px;
font-weight: 500;
text-transform: capitalize;
}

实现效果