Skip to content

Commit b5ff932

Browse files
committed
update layout
1 parent fa84824 commit b5ff932

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

assets/css/style.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,16 @@ html[lang="en"] #resources .resource-card h3 {
10061006

10071007
.footer-grid {
10081008
display: grid;
1009-
grid-template-columns: 0.4fr 1.3fr 1.3fr;
1009+
grid-template-columns: 0.3fr 1.4fr 1.3fr;
10101010
gap: 24px;
10111011
width: 100%;
10121012
}
10131013

1014+
/* 中文版页脚第一列调整 - 给"联系方式"更多空间 */
1015+
html[lang="zh-CN"] .footer-grid {
1016+
grid-template-columns: 0.6fr 1.3fr 1.1fr;
1017+
}
1018+
10141019
.footer h4 {
10151020
color: var(--white);
10161021
font-weight: 500;

assets/js/i18n.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// 首页 Hero
1515
'hero.title': 'OpenMOSS 团队',
16-
'hero.p1': 'OpenMOSS 团队隶属于上海创智学院,并与复旦大学及模思智能保持紧密合作。在邱锡鹏教授的带领下,团队围绕大语言模型(LLMs)开展前沿研究,重点推进模型架构、评测方法与应用场景等方向,致力于打造开放、协作且具有实际影响力的人工智能创新成果。',
16+
'hero.p1': 'OpenMOSS 团队隶属于上海创智学院,并与复旦大学及模思智能保持紧密合作。在邱锡鹏教授的带领下,团队围绕大语言模型开展前沿研究,重点推进模型架构、评测方法与应用场景等方向,致力于打造开放、协作且具有实际影响力的人工智能创新成果。',
1717
'hero.p2': '团队成员在人工智能领域具有坚实积累,培养的毕业生任职或深造于 MIT、UC Berkeley、CMU、FDU、SJTU 等世界顶尖高校,或加入 ByteDance、Alibaba、Tencent、AWS、Google、Microsoft、Optiver 等领先企业,或投身创新创业,形成了充满活力的学术与创新生态。',
1818
'hero.btn.highlights': '最新亮点',
1919
'hero.btn.join': '加入我们',
@@ -277,13 +277,13 @@
277277
// Footer
278278
'footer.contact': 'Contact',
279279
'footer.address': 'Address',
280-
'footer.address1': '3 Lane 699, Huafa Road, Xuhui District',
281-
'footer.address2': 'Building X2, No. 2005 Songhu Road, Yangpu District',
280+
'footer.address1': 'Shanghai Innovation Institute, 3 Lane 699, Huafa Road, Xuhui District',
281+
'footer.address2': 'Building X2, Fudan University, No. 2005 Songhu Road, Yangpu District',
282282
'footer.address3': 'Shanghai, China',
283283
'footer.partners': 'Affiliations',
284284
'footer.fudan': 'School of Computer Science and Innovation, Fudan University',
285285
'footer.teai': 'Institute of Trustworthy Embodied Intelligence, Fudan University',
286-
'footer.nlp': 'Fudan NLP Lab',
286+
'footer.nlp': 'The Fudan University Natural Language Processing Group',
287287

288288
// Webmaster
289289
'webmaster.title': 'Webmaster',

assets/js/spa.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@
2121
console.error('SPA_DATA 未加载');
2222
return;
2323
}
24-
// 从 localStorage 读取语言设置
25-
currentLang = localStorage.getItem('language') || 'zh';
24+
// 从 localStorage 读取语言设置,或检测浏览器语言
25+
let savedLang = localStorage.getItem('language');
26+
if (!savedLang) {
27+
// 检测浏览器语言
28+
const browserLang = navigator.language || navigator.userLanguage;
29+
// 如果浏览器语言是中文(zh, zh-CN, zh-TW 等),使用中文,否则使用英文
30+
savedLang = browserLang.toLowerCase().startsWith('zh') ? 'zh' : 'en';
31+
}
32+
currentLang = savedLang;
2633
window.currentLang = currentLang;
34+
// 设置 html lang 属性
35+
document.documentElement.lang = currentLang === 'zh' ? 'zh-CN' : 'en';
2736
renderShell();
2837
window.addEventListener('hashchange', handleRoute);
2938
handleRoute();
@@ -83,6 +92,8 @@
8392
currentLang = currentLang === 'zh' ? 'en' : 'zh';
8493
localStorage.setItem('language', currentLang);
8594
window.currentLang = currentLang;
95+
// 更新 html lang 属性
96+
document.documentElement.lang = currentLang === 'zh' ? 'zh-CN' : 'en';
8697
// 重新渲染整个应用
8798
renderShell();
8899
handleRoute();
@@ -94,12 +105,12 @@
94105

95106
// 地址列表,支持内嵌链接
96107
const addresses = currentLang === 'zh' ? [
97-
'杨浦区淞沪路2005号 <a href="https://www.fudan.edu.cn/" target="_blank" class="footer-inline-link">复旦大学</a> 二号交叉学科楼',
98108
'徐汇区华发路699弄3号 <a href="https://www.sii.edu.cn/" target="_blank" class="footer-inline-link">上海创智学院</a>',
109+
'杨浦区淞沪路2005号 <a href="https://www.fudan.edu.cn/" target="_blank" class="footer-inline-link">复旦大学</a> 二号交叉学科楼',
99110
'中国 上海'
100111
] : [
101-
'Building X2, No. 2005 Songhu Road, <a href="https://www.fudan.edu.cn/" target="_blank" class="footer-inline-link">Fudan University</a>, Yangpu District',
102-
'3 Lane 699, Huafa Road, <a href="https://www.sii.edu.cn/" target="_blank" class="footer-inline-link">Shanghai Innovation Institute</a>, Xuhui District',
112+
'<a href="https://www.sii.edu.cn/" target="_blank" class="footer-inline-link">Shanghai Innovation Institute</a>, 3 Lane 699, Huafa Road, Xuhui District',
113+
'Building X2, <a href="https://www.fudan.edu.cn/" target="_blank" class="footer-inline-link">Fudan University</a>, No. 2005 Songhu Road, Yangpu District',
103114
'Shanghai, China'
104115
];
105116

0 commit comments

Comments
 (0)