This commit is contained in:
恍兮惚兮 2024-09-27 16:21:54 +08:00
parent bddb3c7ddb
commit 0b6000ccaf
2 changed files with 30 additions and 23 deletions

View File

@ -18,7 +18,7 @@
<body> <body>
<div class="header"> <div class="header">
<div class="buttons"> <div class="buttons">
<div class="buttonitem buttonsize"><a class="goodlink buttonsize" href="javascript:;" onclick="tohomeurl()" <div class="buttonitem buttonsize"><a class="goodlink buttonsize" href="" target="_blank"
id="homepage">官方网站</a></div> id="homepage">官方网站</a></div>
<div class="buttonitem buttonsize"> <div class="buttonitem buttonsize">
<div class="dropdown buttonsize"> <div class="dropdown buttonsize">
@ -33,21 +33,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="buttonitem buttonsize"><a class="goodlink buttonsize" <div class="buttonitem buttonsize"><a class="goodlink buttonsize" href="" target="_blank"
href="https://space.bilibili.com/592120404/video" target="_blank" id="vediotutorial">视频教学</a> id="vediotutorial">.</a>
</div> </div>
<div class="buttonitem buttonsize"> <div class="buttonitem buttonsize"><a class="goodlink buttonsize" href="" target="_blank"
<div class="dropdown buttonsize"> id="contactme">.</a>
<span class="goodlinknormal" id="contactme">
交流群
</span>
<div class="dropdown-content ">
<a class="goodlink buttonsize" target="_blank"
href="https://qm.qq.com/q/I5rr3uEpi2">QQ群963119821<br></a>
<a class="goodlink buttonsize" target="_blank"
href="https://discord.com/invite/ErtDwVeAbB">Discord<br></a>
</div>
</div>
</div> </div>
<div class="buttonitem buttonsize"> <div class="buttonitem buttonsize">
<div class="dropdown buttonsize"> <div class="dropdown buttonsize">

View File

@ -119,19 +119,34 @@ const navitexts = {
homepage: '官方网站', homepage: '官方网站',
downloadlink: '软件下载', downloadlink: '软件下载',
vediotutorial: '视频教学', vediotutorial: '视频教学',
contactme: '交流群' contactme: 'QQ群963119821'
}, },
ru: { ru: {
homepage: 'HomePage', homepage: 'HomePage',
downloadlink: 'Download', downloadlink: 'Download',
vediotutorial: 'Vedio Tutorial', vediotutorial: 'Vedio Tutorial',
contactme: 'Chat Groups' contactme: 'Discord'
}, },
en: { en: {
homepage: 'HomePage', homepage: 'HomePage',
downloadlink: 'Download', downloadlink: 'Download',
vediotutorial: 'Vedio Tutorial', vediotutorial: 'Vedio Tutorial',
contactme: 'Chat Groups' contactme: 'Discord'
}
}
const languagelinks = {
contactme: {
zh: 'https://qm.qq.com/q/I5rr3uEpi2',
ru: 'https://discord.com/invite/ErtDwVeAbB',
en: 'https://discord.com/invite/ErtDwVeAbB',
},
vediotutorial: {
zh: 'https://space.bilibili.com/592120404/video',
ru: 'https://www.youtube.com/results?search_query=LunaTranslator',
en: 'https://www.youtube.com/results?search_query=LunaTranslator',
},
homepage: {
zh: window.location.protocol + '//' + window.location.hostname.substring(5)
} }
} }
function getcurrlang(url) { function getcurrlang(url) {
@ -172,12 +187,14 @@ window.onpopstate = function (event) {
} }
} }
};
function tohomeurl() { for (let _id in languagelinks) {
var hostname = window.location.hostname; let link = languagelinks[_id][currentlang]
window.open(window.location.protocol + '//' + hostname.substring(5), '_blank'); if (link === undefined)
} link = languagelinks[_id].zh
document.getElementById(_id).href = link
}
};
function copyToClipboard(text) { function copyToClipboard(text) {
let url = window.location.href; let url = window.location.href;