Skip to content

改进 index.html 的现代化风格#2

Open
James-Qi wants to merge 1 commit intomainfrom
codex/improve-index.html-for-modern-design-smcgiw
Open

改进 index.html 的现代化风格#2
James-Qi wants to merge 1 commit intomainfrom
codex/improve-index.html-for-modern-design-smcgiw

Conversation

@James-Qi
Copy link
Copy Markdown
Owner

Summary

  • 使用现代化玻璃拟态风格与响应式布局重新设计首页
  • 将站点链接分组为模块化卡片栅格,提升桌面与移动端体验
  • 保留现有分析脚本并优化文字与配色的可读性

Testing

  • 未运行(无相关测试)

https://chatgpt.com/codex/tasks/task_e_68ccb5b7d7f483278625d2935885a266

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @James-Qi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取請求旨在徹底現代化 index.html 頁面,透過引入玻璃擬態設計和響應式佈局來提升網站的整體外觀和跨裝置功能。這些變更旨在改善用戶介面和導航,同時確保重要的分析功能和內容可讀性得到維持和增強。

Highlights

  • 現代化設計: 首頁已使用現代玻璃擬態風格和響應式佈局進行了全面重新設計,以提供更具吸引力的視覺體驗。
  • 優化用戶體驗: 網站連結被分組為模組化卡片網格,顯著提升了桌面和行動裝置上的導航和用戶體驗。
  • 可讀性與分析: 保留了現有的分析腳本,同時優化了文字和配色的可讀性,確保資訊傳達清晰有效。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

這是一次出色的現代化重構。您成功地將一個過時的頁面轉變為一個具有響應式設計、玻璃擬態風格和深色模式支持的現代化網頁。代碼結構清晰,使用了 CSS 變量、Grid 和 Flexbox 等現代技術,大大提升了用戶體驗和可維護性。我提出了一些關於可維護性和可訪問性的小建議,希望能讓這個頁面更加完美。

Comment on lines +10 to +247
<style>
:root {
color-scheme: light dark;
--bg: linear-gradient(135deg, #f8fafc, #eef2ff);
--card-bg: rgba(255, 255, 255, 0.88);
--card-border: rgba(148, 163, 184, 0.35);
--text-primary: #1f2937;
--text-secondary: #475569;
--accent: #f97316;
--accent-dark: #ea580c;
--divider: rgba(148, 163, 184, 0.25);
font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>18DAO 一把刀實用查詢</title>
<meta name="keywords" content="一把刀,實用查詢,國語辭典,中文字典,漢語詞典,外文詞典">
<meta name="description" content="多語言一把刀實用查詢系列網站,始於2005年,致力於提供各類實用查詢信息,不斷為網民提供更優質的資訊服務。">
<meta name="verify-v1" content="Qsep+eu1kdIVOBIgH1zRTyFBcO1aZyQ87mdh37E/FWQ=" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="cleartype" content="on" />
<!--
<script data-ad-client="ca-pub-8670212889350560" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
-->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7763986334422934" crossorigin="anonymous" type="5ecfac430f60c5e43243e923-text/javascript"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-241337-5" type="5ecfac430f60c5e43243e923-text/javascript"></script>
<script type="5ecfac430f60c5e43243e923-text/javascript">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-241337-5');
</script>
</head>
<body style="text-align: center">
<p align=center>
<br />
<img alt="18dao logo" src="18dao.gif" border="0px" width="64px" height="64px" />
<br />
</p>
<p>多語言一把刀實用查詢系列網站,始於2005年,致力於提供各類實用查詢信息,不斷為網民提供更優質的資訊服務。</p>
<hr color="#FF0000" width="80%">
<p align=center>
一把刀實用查詢
[ <a href="https://tw.18dao.net">💻繁體中文</a> ]
[ <a href="https://tw.m.18dao.net">📱行動版本</a> ]
</p>
<hr color="#FF0000" width="80%">
<p align=center>
新推出:國語辭典系列 (中華民國教育部釋出官方資料)
</p>
<p align=center>
《<a href="https://zidian.18dao.net">📗國語小字典</a>》
《<a href="https://cidian.18dao.net">📙國語辭典簡編本</a>》
《<a href="https://dacidian.18dao.net">📘重編國語辭典修訂本</a>》
《<a href="https://chengyu.18dao.net">📕成語典</a>》
</p>
<hr color="#FF0000" width="80%">
<p align=center>
《<a href="https://luanma.18dao.net">💩亂碼糾正詞典</a>》
《<a href="https://bishun.18dao.net">✍️筆順字典</a>》
《<a href="https://www.emojiall.com/zh-hant">Emoji😄表情百科</a>》
《<a href="https://copy.emojiall.com/zh-hant">Emoji✂複製粘貼</a>》
《<a href="https://zh-hant.ipshu.com/">IP地址搜尋定位</a>》
</p>
<hr color="#FF0000" width="80%">
<p align=center>
原18dao.cn系列
</p>
<p align=center>
《<a href="https://zhongwenzidian.18dao.net/zh-hant">中文字典</a>》
《<a href="https://chengyucidian.18dao.net/zh-hant">成語詞典</a>》
《<a href="https://yinghancidian.18dao.net/zh-hant">英漢詞典 (English-Chinese Dictionary)</a>》
《<a href="https://hanyingcidian.18dao.net/zh-hant">漢英詞典 (Chinese-English Dictionary)</a>》

《<a href="https://hanyucidian.18dao.net/zh-hant">漢語詞典</a>》
《<a href="https://zhonghuachengyu.18dao.net/">中華成語大詞典</a>》

《<a href="https://rihancidian.18dao.net/zh-hant">日漢詞典 (日本語-中国語 辞書)</a>》
</p>
<hr color="#FF0000" width="80%">
<p align="center">1998-2024 v1.10 网站备案号:<a href="https://beian.miit.gov.cn/#/Integrated/index" rel="nofollow" target="new">鄂B2-20110095-6</a>、公安备案号:<a href="http://www.beian.gov.cn/" rel="nofollow" target="new">42010302000316</a></p>
<p><a href="http://www.027.net/">武汉市劲捷电子信息有限公司</a> 版权所有</p>
<p>注意:为遵守用户所在地区法律法规,本站部分内容只针对部分国家和地区开放访问,敬请谅解。</p>
<p align=center>
18dao.com |
18dao.net |
18dao.org |
18dao.info |
18dao.cn
</p>
<!-- Not Drupal, Not MediaWiki, Only HTML -->
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="5ecfac430f60c5e43243e923-|49" defer></script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"rayId":"9810dea018fddf07","serverTiming":{"name":{"cfExtPri":true,"cfEdge":true,"cfOrigin":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}},"version":"2025.8.0","token":"dd214a768b354170bfb6ed42ef130967"}' crossorigin="anonymous"></script>
@media (prefers-color-scheme: dark) {
:root {
--bg: radial-gradient(circle at 20% 20%, #10172a, #0f172a 60%, #020617 100%);
--card-bg: rgba(15, 23, 42, 0.75);
--card-border: rgba(148, 163, 184, 0.2);
--text-primary: #e2e8f0;
--text-secondary: #cbd5f5;
--divider: rgba(148, 163, 184, 0.18);
}
}

* {
box-sizing: border-box;
}

body {
margin: 0;
min-height: 100vh;
background: var(--bg);
color: var(--text-primary);
display: flex;
align-items: center;
justify-content: center;
padding: 48px 16px 64px;
}

.page {
width: min(960px, 100%);
background: var(--card-bg);
backdrop-filter: blur(18px);
border: 1px solid var(--card-border);
border-radius: 24px;
padding: clamp(24px, 4vw, 48px);
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

header {
text-align: center;
margin-bottom: clamp(24px, 5vw, 48px);
}

.logo {
width: 84px;
height: 84px;
border-radius: 50%;
background: rgba(249, 115, 22, 0.08);
padding: 12px;
box-shadow: 0 12px 24px rgba(249, 115, 22, 0.18);
margin-bottom: 16px;
}

h1 {
font-size: clamp(1.8rem, 2.6vw, 2.4rem);
margin: 0 0 12px;
letter-spacing: 0.04em;
}

.tagline {
margin: 0 auto 20px;
max-width: 640px;
line-height: 1.7;
color: var(--text-secondary);
font-size: 1rem;
}

.cta-group {
display: flex;
justify-content: center;
gap: 12px;
flex-wrap: wrap;
}

.cta-group a {
text-decoration: none;
color: #fff;
background: var(--accent);
padding: 10px 18px;
border-radius: 999px;
font-size: 0.95rem;
display: inline-flex;
align-items: center;
gap: 6px;
transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
box-shadow: 0 12px 24px rgba(249, 115, 22, 0.25);
}

.cta-group a:hover,
.cta-group a:focus-visible {
background: var(--accent-dark);
transform: translateY(-2px);
}

main {
display: flex;
flex-direction: column;
gap: clamp(24px, 5vw, 40px);
}

section h2 {
font-size: 1.25rem;
margin: 0 0 14px;
display: flex;
align-items: center;
gap: 10px;
}

section h2::after {
content: "";
flex: 1;
height: 1px;
background: var(--divider);
}

.link-grid {
display: grid;
gap: 16px;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.link-card {
position: relative;
padding: 18px 20px;
border-radius: 18px;
background: rgba(255, 255, 255, 0.85);
border: 1px solid var(--card-border);
text-decoration: none;
color: var(--text-primary);
font-weight: 600;
line-height: 1.5;
overflow: hidden;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.link-card::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(135deg, rgba(249, 115, 22, 0) 0%, rgba(249, 115, 22, 0.12) 100%);
opacity: 0;
transition: opacity 0.2s ease;
}

.link-card span {
position: relative;
z-index: 1;
}

.link-card:hover,
.link-card:focus-visible {
transform: translateY(-4px);
box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
border-color: rgba(249, 115, 22, 0.4);
}

.link-card:hover::after,
.link-card:focus-visible::after {
opacity: 1;
}

.notice {
background: rgba(59, 130, 246, 0.12);
color: var(--text-secondary);
border-radius: 16px;
padding: 18px 20px;
font-size: 0.95rem;
line-height: 1.6;
border: 1px solid rgba(59, 130, 246, 0.18);
}

footer {
margin-top: clamp(20px, 4vw, 32px);
padding-top: clamp(16px, 3vw, 24px);
border-top: 1px solid var(--divider);
font-size: 0.9rem;
color: var(--text-secondary);
line-height: 1.7;
}

footer a {
color: inherit;
text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
color: var(--accent-dark);
}

.domain-list {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 12px 0 0;
}

.domain-pill {
padding: 6px 12px;
border-radius: 999px;
border: 1px solid var(--divider);
background: rgba(255, 255, 255, 0.6);
color: var(--text-primary);
font-size: 0.85rem;
}

@media (max-width: 640px) {
body {
padding: 24px 12px 48px;
}

.page {
border-radius: 18px;
padding: 24px;
}

.link-grid {
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.cta-group a {
width: 100%;
justify-content: center;
}
}
</style>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

為了提升可維護性和網站性能,建議將 <style> 標籤內的 CSS 代碼提取到一個獨立的外部樣式表文件(例如 styles.css)中。

  • 可維護性: 將結構(HTML)與樣式(CSS)分離,使代碼庫更清晰,更易於管理。
  • 性能: 外部 CSS 文件可以被瀏覽器緩存。當用戶再次訪問或導航到其他使用相同樣式表的頁面時,無需重新下載,從而加快頁面加載速度。
  • 可讀性: index.html 文件將變得更加簡潔,只專注於內容和結構。

您可以在 <head> 中使用 <link> 標籤來引入外部樣式表:

<link rel="stylesheet" href="styles.css">

<body>
<div class="page">
<header>
<img src="18dao.gif" alt="18DAO Logo" class="logo" width="84" height="84">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

為了提升可訪問性,建議將 Logo 圖片的 alt 屬性設置為空字符串 (alt="")。由於圖片緊鄰的 <h1> 標題已經包含了網站名稱「18DAO 一把刀實用查詢」,這個 Logo 圖片可以被視為裝飾性元素。將 alt 設為空可以避免螢幕閱讀器重複讀出「18DAO Logo」,為輔助技術用戶提供更流暢的瀏覽體驗。

Suggested change
<img src="18dao.gif" alt="18DAO Logo" class="logo" width="84" height="84">
<img src="18dao.gif" alt="" class="logo" width="84" height="84">

Comment on lines +265 to +268
<a class="link-card" href="https://zidian.18dao.net" target="_blank" rel="noopener"><span>📗 國語小字典</span></a>
<a class="link-card" href="https://cidian.18dao.net" target="_blank" rel="noopener"><span>📙 國語辭典簡編本</span></a>
<a class="link-card" href="https://dacidian.18dao.net" target="_blank" rel="noopener"><span>📘 重編國語辭典修訂本</span></a>
<a class="link-card" href="https://chengyu.18dao.net" target="_blank" rel="noopener"><span>📕 成語典</span></a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

連結中的表情符號(如 📗, 📙 等)雖然在視覺上很吸引人,但螢幕閱讀器會讀出它們的名稱(例如「綠皮書」),這可能會對使用者造成不必要的干擾。為了改善可訪問性,建議將這些裝飾性的表情符號用 <span> 包裹,並添加 aria-hidden="true" 屬性。這樣螢幕閱讀器就會忽略它們,同時保留視覺效果。此建議也適用於頁面中其他使用表情符號的連結。

Suggested change
<a class="link-card" href="https://zidian.18dao.net" target="_blank" rel="noopener"><span>📗 國語小字典</span></a>
<a class="link-card" href="https://cidian.18dao.net" target="_blank" rel="noopener"><span>📙 國語辭典簡編本</span></a>
<a class="link-card" href="https://dacidian.18dao.net" target="_blank" rel="noopener"><span>📘 重編國語辭典修訂本</span></a>
<a class="link-card" href="https://chengyu.18dao.net" target="_blank" rel="noopener"><span>📕 成語典</span></a>
<a class="link-card" href="https://zidian.18dao.net" target="_blank" rel="noopener"><span><span aria-hidden="true">📗</span> 國語小字典</span></a>
<a class="link-card" href="https://cidian.18dao.net" target="_blank" rel="noopener"><span><span aria-hidden="true">📙</span> 國語辭典簡編本</span></a>
<a class="link-card" href="https://dacidian.18dao.net" target="_blank" rel="noopener"><span><span aria-hidden="true">📘</span> 重編國語辭典修訂本</span></a>
<a class="link-card" href="https://chengyu.18dao.net" target="_blank" rel="noopener"><span><span aria-hidden="true">📕</span> 成語典</span></a>


<footer>
<p>1998-2024 v1.10 網站備案號:<a href="https://beian.miit.gov.cn/#/Integrated/index" rel="nofollow noopener" target="_blank">鄂B2-20110095-6</a>、公安備案號:<a href="http://www.beian.gov.cn/" rel="nofollow noopener" target="_blank">42010302000316</a></p>
<p><a href="http://www.027.net/" target="_blank" rel="noopener">武漢市勁捷電子信息有限公司</a> 版權所有</p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

此外部連結已正確使用 rel="noopener" 以增強安全性。為遵循 SEO 最佳實踐,建議同時添加 nofollow 屬性。rel="nofollow" 會告知搜尋引擎不要將當前頁面的權重傳遞給連結的目標頁面,這對於所有非自有或不希望為其「背書」的外部連結來說是個好習慣。

Suggested change
<p><a href="http://www.027.net/" target="_blank" rel="noopener">武漢市勁捷電子信息有限公司</a> 版權所有</p>
<p><a href="http://www.027.net/" target="_blank" rel="noopener nofollow">武漢市勁捷電子信息有限公司</a> 版權所有</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant