atlas-study/grid-study/index.html
Coldin04 5b79d2179f feat: 完善 Grid 布局主页的所有卡片内容与样式
- **Profile**: 完成个人信息展示,适配桌面(居中)与移动端(左图右文)布局。
- **RSS**: 接入少数派文章数据(静态模拟),优化列表视觉效果及底部“查看更多”按钮。
- **Task**: 实现待办事项列表样式,优化间距与交互反馈,清理无用标签。
- **Hitokoto**: 集成一言 API(内联 JS),支持出处展示与跳转。
- **Photos**: 替换为本地图片资源,去除边框以提升沉浸感,并限制高度以防止布局变形。
- **Layout**: 全局添加 `box-sizing: border-box`,微调 Grid 行高、间距及边距,解决垂直滚动条问题。
- **Mobile**: 优化移动端响应式表现,确保内容在不同设备上的可读性。
2026-01-23 14:57:23 +08:00

113 lines
5.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid布局主页</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="top-bar">
<div class="top-bar__brand">
<img src="src/avatar_48.png" alt="Logo" class="top-bar__logo">
<span>Coldin04 WorkSpace</span>
</div>
<div class="top-bar__actions">
<button class="top-bar__button">主页</button>
<button class="top-bar__button">退出</button>
</div>
</header>
<div class="main-content">
<main class="dashboard-grid">
<section class="card card__profile">
<div class="profile">
<img src="src/avatar_240.webp" alt="头像" class="profile__avatar">
<div class="profile__content">
<h2 class="profile__name">Coldin04</h2>
<p class="profile__signature">Stay hungry, stay foolish.</p>
</div>
</div>
</section>
<section class="card card__rss">
<div class="rss-wrapper">
<div class="rss-header">
<h3>少数派 Prime</h3>
<span class="rss-status">sspai.com</span>
</div>
<div class="rss-list">
<article class="rss-item">
<div class="rss-meta">
<span class="rss-tag">SamWanng</span>
<time>Jan 23</time>
</div>
<h4><a href="https://sspai.com/post/105578" target="_blank">一日一技 | 老 Mac 系统恢复指北</a></h4>
<p>不能用 Wi-Fi 和 U 盘恢复系统的 Mac你还能试试这个重装方法。</p>
</article>
<article class="rss-item">
<div class="rss-meta">
<span class="rss-tag">少数派编辑部</span>
<time>Jan 23</time>
</div>
<h4><a href="https://sspai.com/post/105695" target="_blank">派早报realme 真我发布新品、Xbox 应用登陆 Arm PC 等</a></h4>
<p>索尼发布 LinkBuds Clip 开放式耳机、Adobe 将支持把 PDF 转换成播客等。</p>
</article>
</article>
</div>
<div class="rss-footer">
<a href="https://sspai.com" target="_blank" class="rss-more-btn">查看更多内容 →</a>
</div>
</div>
</section>
<section class="card card__task">
<div class="task-container">
<div class="task-header">
<h3>待办事项</h3>
<span class="task-count">4 items</span>
</div>
<ul class="task-list">
<li class="task-item">
<input type="checkbox" id="task1" checked>
<label for="task1" class="task-content">完成 Grid 布局学习</label>
</li>
<li class="task-item">
<input type="checkbox" id="task2">
<label for="task2" class="task-content">完善个人主页样式</label>
</li>
<li class="task-item">
<input type="checkbox" id="task3">
<label for="task3" class="task-content">其实这些只是测试文本</label>
</li>
<li class="task-item">
<input type="checkbox" id="task4">
<label for="task4" class="task-content">优化移动端体验</label>
</li>
</ul>
</div>
</section>
<section class="card card__hitokoto">
<div class="hitokoto-content">
<a href="#" id="hitokoto_text" class="hitokoto__text" target="_blank" style="text-decoration: none; color: inherit; display: block;">:D 获取中...</a>
<p id="hitokoto_from" class="hitokoto__from"></p>
</div>
</section>
<section class="card card__photos" style="border: none;">
<img src="src/wallpaper/desert.webp" alt="Photo" loading="lazy">
</section>
</main>
</div>
<script>
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
const hitokoto = document.querySelector('#hitokoto_text')
const from = document.querySelector('#hitokoto_from')
hitokoto.href = `https://hitokoto.cn/?uuid=${data.uuid}`
hitokoto.innerText = data.hitokoto
if (from) from.innerText = `—— ${data.from}`
})
.catch(console.error)
</script>
</body>
</html>