我们将创建一个单页应用,包含以下核心部分:

(图片来源网络,侵删)
- 导航栏: 固定在顶部,方便用户在不同版块间跳转。
- 首页/英雄区: 以震撼的视觉冲击展示玉器之美,包含主标题、副标题和行动号召按钮。
- 产品展示区: 以网格或瀑布流形式展示不同系列的玉器,支持筛选和查看详情。
- 工艺故事区: 讲述玉器的雕刻工艺、文化内涵和历史传承,增加品牌深度。
- 关于我们/品牌故事: 建立信任,展示品牌理念、大师团队或店铺历史。
- 页脚: 包含联系方式、社交媒体链接、版权信息等。
网页设计思路
-
色彩方案:
- 主色调: 墨绿 / 翠绿 (#1A4D3A, #2E7D57) - 代表翡翠的深邃与高贵。
- 辅助色: 暖金 / 鎏金 (#D4AF37, #F4E4C1) - 用于点缀,象征玉器的温润与价值。
- 背景色: 米白 / 暖灰 (#F9F6F0, #E8E2D5) - 营造典雅、舒适的阅读氛围。
- 文字色: 深灰 / 黑色 (#333333, #000000) - 保证良好的可读性。
-
字体:
- 思源宋体 或 Noto Serif SC - 具有浓厚的中国风韵味。
- 思源黑体 或 Noto Sans SC - 现代且清晰易读。
-
视觉元素:
- 背景: 使用带有细微纹理的纸张或宣纸背景。
- 图片: 所有玉器产品图都必须是高清、多角度、有质感的,最好有光影效果。
- 图标: 使用线条简洁、风格统一的图标。
HTML 代码 (yuanma.html)
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">琢玉轩 - 精品翡翠与和田玉玉器</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* --- 全局样式 --- */
:root {
--primary-green: #1A4D3A;
--accent-gold: #D4AF37;
--bg-light: #F9F6F0;
--bg-medium: #E8E2D5;
--text-dark: #333333;
--text-light: #666666;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Sans SC', sans-serif;
color: var(--text-dark);
background-color: var(--bg-light);
line-height: 1.6;
}
h1, h2, h3 {
font-family: 'Noto Serif SC', serif;
font-weight: 700;
color: var(--primary-green);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.section {
padding: 80px 0;
}
.section-title {
text-align: center;
font-size: 2.5rem;
margin-bottom: 50px;
position: relative;
}
.section-title::after {
content: '';
display: block;
width: 80px;
height: 3px;
background-color: var(--accent-gold);
margin: 15px auto 0;
}
/* --- 导航栏 --- */
nav {
position: fixed;
top: 0;
width: 100%;
background-color: rgba(250, 250, 250, 0.95);
backdrop-filter: blur(10px);
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
z-index: 1000;
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
}
.logo {
font-family: 'Noto Serif SC', serif;
font-size: 1.8rem;
font-weight: 700;
color: var(--primary-green);
text-decoration: none;
}
.nav-links {
display: flex;
list-style: none;
}
.nav-links a {
color: var(--text-dark);
text-decoration: none;
padding: 10px 20px;
font-weight: 500;
transition: color 0.3s ease;
}
.nav-links a:hover {
color: var(--accent-gold);
}
/* --- 首页/英雄区 --- */
#home {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1594736797933-d0eb1ff2e2d6?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
color: white;
text-align: center;
}
.hero-content h1 {
font-size: 4rem;
margin-bottom: 20px;
text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}
.hero-content p {
font-size: 1.5rem;
margin-bottom: 40px;
font-weight: 300;
}
.cta-button {
display: inline-block;
padding: 15px 40px;
background-color: var(--accent-gold);
color: var(--primary-green);
text-decoration: none;
border-radius: 50px;
font-weight: 700;
font-size: 1.1rem;
transition: all 0.3s ease;
border: 2px solid var(--accent-gold);
}
.cta-button:hover {
background-color: transparent;
color: var(--accent-gold);
transform: translateY(-3px);
box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
/* --- 产品展示区 --- */
#products {
background-color: white;
}
.filter-buttons {
display: flex;
justify-content: center;
margin-bottom: 40px;
flex-wrap: wrap;
}
.filter-btn {
padding: 10px 25px;
margin: 5px;
border: 1px solid var(--primary-green);
background-color: transparent;
color: var(--primary-green);
border-radius: 25px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
}
.filter-btn.active, .filter-btn:hover {
background-color: var(--primary-green);
color: white;
}
.product-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
}
.product-card {
background-color: var(--bg-light);
border-radius: 10px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
}
.product-card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}
.product-img {
width: 100%;
height: 250px;
object-fit: cover;
}
.product-info {
padding: 20px;
}
.product-info h3 {
font-size: 1.3rem;
margin-bottom: 10px;
}
.product-info p {
color: var(--text-light);
margin-bottom: 15px;
}
.product-price {
font-size: 1.5rem;
color: var(--accent-gold);
font-weight: 700;
}
/* --- 工艺故事区 --- */
#craftsmanship {
background-color: var(--bg-medium);
}
.craft-content {
display: flex;
align-items: center;
gap: 50px;
}
.craft-text {
flex: 1;
}
.craft-img {
flex: 1;
}
.craft-img img {
width: 100%;
border-radius: 10px;
box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
/* --- 关于我们 --- */
#about {
background-color: white;
text-align: center;
}
.about-content {
max-width: 800px;
margin: 0 auto;
}
.about-content p {
font-size: 1.1rem;
color: var(--text-light);
margin-bottom: 20px;
}
/* --- 页脚 --- */
footer {
background-color: var(--primary-green);
color: white;
padding: 40px 0 20px;
}
.footer-content {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
margin-bottom: 30px;
}
.footer-section h4 {
margin-bottom: 15px;
color: var(--accent-gold);
}
.footer-section p, .footer-section a {
color: rgba(255,255,255,0.8);
text-decoration: none;
line-height: 1.8;
}
.footer-section a:hover {
color: var(--accent-gold);
}
.social-links {
display: flex;
gap: 20px;
justify-content: center;
}
.social-links a {
color: white;
font-size: 1.5rem;
}
.copyright {
text-align: center;
padding-top: 20px;
border-top: 1px solid rgba(255,255,255,0.2);
color: rgba(255,255,255,0.6);
}
/* --- 响应式设计 --- */
@media (max-width: 768px) {
.hero-content h1 {
font-size: 2.5rem;
}
.craft-content {
flex-direction: column;
}
.nav-links {
display: none; /* 可以替换为移动端菜单 */
}
}
</style>
</head>
<body>
<!-- 导航栏 -->
<nav>
<div class="nav-container container">
<a href="#home" class="logo">琢玉轩</a>
<ul class="nav-links">
<li><a href="#home">首页</a></li>
<li><a href="#products">精品展示</a></li>
<li><a href="#craftsmanship">工艺传承</a></li>
<li><a href="#about">关于我们</a></li>
<li><a href="#contact">联系我们</a></li>
</ul>
</div>
</nav>
<!-- 首页/英雄区 -->
<section id="home">
<div class="hero-content">
<h1>温润如玉,匠心独运</h1>
<p>探索千年玉文化,品味东方雅致生活</p>
<a href="#products" class="cta-button">鉴赏臻品</a>
</div>
</section>
<!-- 产品展示区 -->
<section id="products" class="section">
<div class="container">
<h2 class="section-title">精品玉器</h2>
<div class="filter-buttons">
<button class="filter-btn active" data-filter="all">全部</button>
<button class="filter-btn" data-filter="jadeite">翡翠</button>
<button class="filter-btn" data-filter="nephrite">和田玉</button>
<button class="filter-btn" data-filter="carving">摆件</button>
<button class="filter-btn" data-filter="jewelry">首饰</button>
</div>
<div class="product-grid">
<div class="product-card" data-category="jadeite">
<img src="https://images.unsplash.com/photo-1594736797933-d0eb1ff2e2d6?q=80&w=2070&auto=format&fit=crop" alt="冰种翡翠手镯" class="product-img">
<div class="product-info">
<h3>冰种翡翠手镯</h3>
<p>通透无瑕,水头十足,寓意平安圆满。</p>
<div class="product-price">¥88,000</div>
</div>
</div>
<div class="product-card" data-category="nephrite">
<img src="https://images.unsplash.com/photo-1618008787830-3f3a0b5af7d7?q=80&w=2070&auto=format&fit=crop" alt="羊脂白玉佩" class="product-img">
<div class="product-info">
<h3>羊脂白玉平安佩</h3>
<p>温润细腻,洁白如脂,大师手工雕刻。</p>
<div class="product-price">¥36,000</div>
</div>
</div>
<div class="product-card" data-category="jewelry">
<img src="https://images.unsplash.com/photo-1618008787830-3f3a0b5af7d7?q=80&w=2070&auto=format&fit=crop" alt="翡翠吊坠" class="product-img">
<div class="product-info">
<h3">满绿翡翠如意吊坠</h3>
<p>帝王绿,雕工精湛,尽显高贵典雅。</p>
<div class="product-price">¥128,000</div>
</div>
</div>
<div class="product-card" data-category="carving">
<img src="https://images.unsplash.com/photo-1618008787830-3f3a0b5af7d7?q=80&w=2070&auto=format&fit=crop" alt="玉雕摆件" class="product-img">
<div class="product-info">
<h3">瑞兽貔貅摆件</h3>
<p>和田玉籽料,寓意招财纳福,镇宅辟邪。</p>
<div class="product-price">¥58,000</div>
</div>
</div>
<div class="product-card" data-category="jadeite">
<img src="https://images.unsplash.com/photo-1618008787830-3f3a0b5af7d7?q=80&w=2070&auto=format&fit=crop" alt="翡翠戒指" class="product-img">
<div class="product-info">
<h3">紫罗兰翡翠戒指</h3>
<p>浪漫紫罗兰,戒面饱满,镶嵌精致。</p>
<div class="product-price">¥45,000</div>
</div>
</div>
<div class="product-card" data-category="nephrite">
<img src="https://images.unsplash.com/photo-1618008787830-3f3a0b5af7d7?q=80&w=2070&auto=format&fit=crop" alt="玉镯" class="product-img">
<div class="product-info">
<h3">碧玉平安镯</h3>
<p>菠菜绿,质地均匀,佩戴舒适。</p>
<div class="product-price">¥22,000</div>
</div>
</div>
</div>
</div>
</section>
<!-- 工艺故事区 -->
<section id="craftsmanship" class="section">
<div class="container">
<h2 class="section-title">工艺传承</h2>
<div class="craft-content">
<div class="craft-text">
<h3>一脉相承的匠心精神</h3>
<p>玉不琢,不成器,每一件玉器都凝聚着匠人的心血与智慧,琢玉轩的雕刻师们,承袭千年古法,结合现代审美,以刀为笔,以玉为纸,将冰冷的玉石赋予生命与灵魂。</p>
<p>从选料、设计、粗雕、细磨到抛光,每一步都倾注了极致的专注与耐心,我们坚信,唯有如此,才能让玉石的天然之美与人文内涵完美融合,成就传世之作。</p>
</div>
<div class="craft-img">
<img src="https://images.unsplash.com/photo-1599054378797-6ddadcc56b46?q=80&w=2070&auto=format&fit=crop" alt="玉雕工艺师">
</div>
</div>
</div>
</section>
<!-- 关于我们 -->
<section id="about" class="section">
<div class="container">
<h2 class="section-title">关于琢玉轩</h2>
<div class="about-content">
<p>琢玉轩始创于2010年,是一家集玉器设计、制作、销售于一体的专业机构,我们致力于传播和弘扬中国悠久的玉文化,为全球藏家和爱好者提供高品质的玉器珍品。</p>
<p>我们坚持“诚信为本,品质至上”的经营理念,每一件作品都经过严格筛选和专业鉴定,确保其天然、真实、优质,琢玉轩不仅是玉器的交易场所,更是玉文化的交流平台,我们期待与您一同,在玉的世界里,发现美,感受美,传承美。</p>
</div>
</div>
</section>
<!-- 页脚 -->
<footer id="contact">
<div class="container">
<div class="footer-content">
<div class="footer-section">
<h4>联系我们</h4>
<p><i class="fas fa-map-marker-alt"></i> 北京市朝阳区某某大厦一层</p>
<p><i class="fas fa-phone"></i> +86 10 1234 5678</p>
<p><i class="fas fa-envelope"></i> info@zhuoyuxuan.com</p>
</div>
<div class="footer-section">
<h4>营业时间</h4>
<p>周一至周日: 10:00 - 20:00</p>
<p>节假日: 预约到访</p>
</div>
<div class="footer-section">
<h4>关注我们</h4>
<div class="social-links">
<a href="#"><i class="fab fa-weixin"></i></a>
<a href="#"><i class="fab fa-weibo"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
</div>
</div>
</div>
<div class="copyright">
<p>© 2025 琢玉轩 版权所有 | 京ICP备12345678号</p>
</div>
</div>
</footer>
<script>
// 平滑滚动
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// 产品筛选功能
const filterButtons = document.querySelectorAll('.filter-btn');
const productCards = document.querySelectorAll('.product-card');
filterButtons.forEach(button => {
button.addEventListener('click', () => {
// 更新按钮的激活状态
filterButtons.forEach(btn => btn.classList.remove('active'));
button.classList.add('active');
// 筛选产品
const filter = button.getAttribute('data-filter');
productCards.forEach(card => {
if (filter === 'all' || card.getAttribute('data-category') === filter) {
card.style.display = 'block';
} else {
card.style.display = 'none';
}
});
});
});
// 导航栏滚动效果
window.addEventListener('scroll', function() {
const nav = document.querySelector('nav');
if (window.scrollY > 50) {
nav.style.backgroundColor = 'rgba(250, 250, 250, 0.98)';
} else {
nav.style.backgroundColor = 'rgba(250, 250, 250, 0.95)';
}
});
</script>
</body>
</html>
代码解析与使用说明
-
HTML 结构 (
yuanma.html):
(图片来源网络,侵删)- 代码结构清晰,使用了语义化标签
<section>,<nav>,<footer>等。 - 每个版块都有一个
id,方便导航链接定位。 - 产品卡片结构完整,包含了图片、标题、描述和价格,并为每个卡片添加了
data-category属性,用于筛选功能。 - 使用了
<link>标签引入了 Google Fonts (思源宋体、思源黑体) 和 Font Awesome 图标库,无需额外下载。
- 代码结构清晰,使用了语义化标签
-
CSS 样式 (
<style>标签内):- 变量定义: 使用
root定义了颜色变量,方便全局统一修改主题色。 - 布局: 主要使用 Flexbox 和 CSS Grid 布局,确保了响应式设计的灵活性。
- 响应式: 通过媒体查询
@media (max-width: 768px)对移动端进行了适配,例如调整字体大小和布局方向。 - 交互效果: 添加了
hover效果,如按钮变色、卡片悬浮上浮等,提升了用户体验。 - 视觉美化: 使用了
backdrop-filter实现导航栏的毛玻璃效果,使用text-shadow和box-shadow增加层次感。
- 变量定义: 使用
-
JavaScript 功能 (
<script>标签内):- 平滑滚动: 点击导航链接时,页面会平滑滚动到对应版块,而不是瞬间跳转。
- 产品筛选: 点击筛选按钮,可以动态隐藏或显示对应类别的产品卡片,这是通过修改元素的
style.display属性实现的。 - 导航栏样式变化: 当页面滚动超过一定距离时,会微调导航栏的背景透明度,使其更好地融入页面。
如何使用
- 保存代码: 将上面的全部代码复制并粘贴到一个文本编辑器中(如 VS Code, Sublime Text, Notepad++)。
- 保存文件: 将文件另存为
yuanma.html。 - 替换图片: 代码中使用了 Unsplash 的示例图片,你需要将这些
src替换成你自己的玉器产品图片,建议使用高清、风格统一的图片。 - : 根据你的品牌信息,修改
logo、联系方式、产品描述、关于我们等文本内容。 - 预览: 用任何现代浏览器(如 Chrome, Firefox, Edge)打开
yuanma.html文件,即可看到网页效果。
这个网页设计既体现了玉器的古典韵味,又具备现代电商网站的功能性,可以直接作为玉器品牌展示或在线销售的基础模板。

(图片来源网络,侵删)
