全书知识点的大阅兵 | 课型:实习课 | 建议课时:4节
海南文旅题材完整官网:导航变色、滚动显现、响应式三栏——教材第26章完整实现。
新窗口运行 下载源码<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>椰风工作室 | 海南文旅视觉设计</title>
<meta name="description" content="椰风工作室:专注海南文旅品牌的视觉设计与网站开发">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: "Microsoft YaHei", sans-serif; color: #1f2a33; }
.navbar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
align-items: center; padding: 18px 40px; transition: all .4s; z-index: 100; }
.navbar.scrolled { background: rgba(14,42,60,.95); padding: 12px 40px; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.logo { color: #fff; font-size: 22px; font-weight: bold; text-decoration: none; }
.logo span { color: #38d6c4; }
nav ul { display: flex; gap: 28px; list-style: none; }
nav a { color: #fff; text-decoration: none; transition: color .3s; }
nav a:hover { color: #38d6c4; }
.hero { min-height: 100vh; background: linear-gradient(135deg, #0e2a3c 0%, #1b5a7a 60%, #0f8c7f 100%);
display: flex; flex-direction: column; justify-content: center; align-items: center;
text-align: center; color: #fff; padding: 20px; }
.hero h1 { font-size: 48px; margin-bottom: 16px; letter-spacing: 2px; }
.hero p { font-size: 18px; color: #b8d8e4; margin-bottom: 30px; }
.btn { background: #38d6c4; color: #0e2a3c; padding: 14px 40px; border-radius: 30px;
text-decoration: none; font-weight: bold; transition: transform .3s; }
.btn:hover { transform: scale(1.06); }
section { padding: 90px 40px; max-width: 1100px; margin: 0 auto; }
h2 { text-align: center; font-size: 32px; color: #123a52; margin-bottom: 40px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #f7fafb; border-radius: 14px; padding: 30px; transition: all .4s;
opacity: 0; transform: translateY(30px); }
.card.show { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(18,58,82,.12); }
.card h3 { color: #0f8c7f; margin-bottom: 10px; }
footer { background: #0e2a3c; color: #7fa8bc; text-align: center; padding: 30px; }
@media (max-width: 768px) {
.cards { grid-template-columns: 1fr; }
.hero h1 { font-size: 30px; }
.navbar { padding: 14px 20px; }
}
</style>
</head>
<body>
<header class="navbar" id="navbar">
<a class="logo" href="#top">椰风<span>工作室</span></a>
<nav aria-label="主导航"><ul>
<li><a href="#services">服务</a></li>
<li><a href="#works">作品</a></li>
<li><a href="#contact">联系</a></li>
</ul></nav>
</header>
<main id="top">
<section class="hero">
<h1>把海南的美,讲给世界听</h1>
<p>文旅品牌视觉设计 · 网站开发 · 世赛获奖团队</p>
<a class="btn" href="#contact">开始合作</a>
</section>
<section class="services" id="services">
<h2>我们的服务</h2>
<div class="cards">
<article class="card"><h3>品牌设计</h3><p>LOGO、VI与视觉系统,讲好品牌故事。</p></article>
<article class="card"><h3>网站开发</h3><p>响应式官网与小程序页面,性能与美感兼得。</p></article>
<article class="card"><h3>竞赛培训</h3><p>世赛网站设计与开发项目集训,冠军教练团队。</p></article>
</div>
</section>
<section id="works">
<h2>精选案例</h2>
<div class="cards">
<article class="card"><h3>三亚湾文旅</h3><p>城市文旅官网,上线三个月流量增长240%。</p></article>
<article class="card"><h3>黎锦文化</h3><p>非遗数字展厅,获省级文化项目支持。</p></article>
<article class="card"><h3>海岛民宿</h3><p>预订系统前端,转化率提升35%。</p></article>
</div>
</section>
<section id="contact">
<h2>联系我们</h2>
<p style="text-align:center">邮箱:hello@yefeng.example · 地址:海南省三亚市</p>
</section>
</main>
<footer>© 2026 椰风工作室 · 琼ICP备00000000号</footer>
<script>
const navbar = document.getElementById('navbar');
addEventListener('scroll', () => navbar.classList.toggle('scrolled', scrollY > 60));
const io = new IntersectionObserver(es => es.forEach(e => {
if (e.isIntersecting) { e.target.classList.add('show'); io.unobserve(e.target); }
}), { threshold: 0.15 });
document.querySelectorAll('.card').forEach(el => io.observe(el));
</script>
</body>
</html>任务目标:独立完成企业官网首页并完成知识复盘
| 任务内容与评分 |
|---|
| 任务1:画出官网信息架构图(10分) |
| 任务2:完成语义化HTML骨架(20分) |
| 任务3:完成CSS样式与响应式(30分) |
| 任务4:实现导航变色+滚动显现(20分) |
| 任务5:填写知识映射表并Lighthouse跑分(20分) |