|
|
@ -30,6 +30,67 @@ |
|
|
})(); |
|
|
})(); |
|
|
//#endregion
|
|
|
//#endregion
|
|
|
//#region js/common.js
|
|
|
//#region js/common.js
|
|
|
|
|
|
const UI_I18N = { |
|
|
|
|
|
zh: { |
|
|
|
|
|
"video.play": "视频播放", |
|
|
|
|
|
"filter.by_product": "按产品筛选", |
|
|
|
|
|
"about.expand_more": "展开更多", |
|
|
|
|
|
"about.collapse": "收起", |
|
|
|
|
|
"brand.short": "睿能科技", |
|
|
|
|
|
"stock.delay_note": "截止 {time}*报价有十五分钟或以上延迟。", |
|
|
|
|
|
"contact.name_required": "请输入姓名", |
|
|
|
|
|
"contact.phone_required": "请输入手机号", |
|
|
|
|
|
"contact.company_required": "请输入公司名称", |
|
|
|
|
|
"contact.email_required": "请输入邮箱", |
|
|
|
|
|
"contact.submitting": "提交中...", |
|
|
|
|
|
"contact.submit": "提交", |
|
|
|
|
|
"contact.success": "提交成功,我们会尽快与您联系!", |
|
|
|
|
|
"contact.fail": "提交失败,请稍后重试", |
|
|
|
|
|
"contact.network_error": "网络错误,请稍后重试", |
|
|
|
|
|
"earth.hq_fuzhou_html": "全球总部<br>福州" |
|
|
|
|
|
}, |
|
|
|
|
|
en: { |
|
|
|
|
|
"video.play": "Video", |
|
|
|
|
|
"filter.by_product": "Filter by product", |
|
|
|
|
|
"about.expand_more": "Show more", |
|
|
|
|
|
"about.collapse": "Show less", |
|
|
|
|
|
"brand.short": "RAYNEN", |
|
|
|
|
|
"stock.delay_note": "As of {time}* Quotes delayed by 15 minutes or more.", |
|
|
|
|
|
"contact.name_required": "Please enter your name", |
|
|
|
|
|
"contact.phone_required": "Please enter your phone number", |
|
|
|
|
|
"contact.company_required": "Please enter your company name", |
|
|
|
|
|
"contact.email_required": "Please enter your email", |
|
|
|
|
|
"contact.submitting": "Submitting...", |
|
|
|
|
|
"contact.submit": "Submit", |
|
|
|
|
|
"contact.success": "Submitted successfully. We will contact you soon.", |
|
|
|
|
|
"contact.fail": "Submission failed. Please try again later.", |
|
|
|
|
|
"contact.network_error": "Network error. Please try again later.", |
|
|
|
|
|
"earth.hq_fuzhou_html": "Global HQ<br>Fuzhou" |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function getUiLang() { |
|
|
|
|
|
const fromHeader = document.querySelector(".site-header__lang")?.getAttribute("data-lang-current"); |
|
|
|
|
|
if (fromHeader === "en" || fromHeader === "zh") return fromHeader; |
|
|
|
|
|
const seg = location.pathname.replace(/^\//, "").split("/")[0] || ""; |
|
|
|
|
|
return seg === "en" ? "en" : "zh"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function t(key, vars) { |
|
|
|
|
|
const lang = getUiLang(); |
|
|
|
|
|
const table = UI_I18N[lang] || UI_I18N.zh; |
|
|
|
|
|
let str = table[key] ?? UI_I18N.zh[key] ?? key; |
|
|
|
|
|
if (vars && typeof vars === "object") { |
|
|
|
|
|
Object.keys(vars).forEach((k) => { |
|
|
|
|
|
str = str.replace(new RegExp(`\\{${k}\\}`, "g"), String(vars[k])); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return str; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
window.getUiLang = getUiLang; |
|
|
|
|
|
window.t = t; |
|
|
|
|
|
|
|
|
$(function() { |
|
|
$(function() { |
|
|
AOS.init({ duration: 800 }); |
|
|
AOS.init({ duration: 800 }); |
|
|
const lenis = new Lenis(); |
|
|
const lenis = new Lenis(); |
|
|
@ -41,69 +102,6 @@ $(function() { |
|
|
}); |
|
|
}); |
|
|
gsap.ticker.lagSmoothing(0); |
|
|
gsap.ticker.lagSmoothing(0); |
|
|
|
|
|
|
|
|
const UI_I18N = { |
|
|
|
|
|
zh: { |
|
|
|
|
|
"video.play": "视频播放", |
|
|
|
|
|
"filter.by_product": "按产品筛选", |
|
|
|
|
|
"about.expand_more": "展开更多", |
|
|
|
|
|
"about.collapse": "收起", |
|
|
|
|
|
"brand.short": "睿能科技", |
|
|
|
|
|
"stock.delay_note": "截止 {time}*报价有十五分钟或以上延迟。", |
|
|
|
|
|
"contact.name_required": "请输入姓名", |
|
|
|
|
|
"contact.phone_required": "请输入手机号", |
|
|
|
|
|
"contact.company_required": "请输入公司名称", |
|
|
|
|
|
"contact.email_required": "请输入邮箱", |
|
|
|
|
|
"contact.submitting": "提交中...", |
|
|
|
|
|
"contact.submit": "提交", |
|
|
|
|
|
"contact.success": "提交成功,我们会尽快与您联系!", |
|
|
|
|
|
"contact.fail": "提交失败,请稍后重试", |
|
|
|
|
|
"contact.network_error": "网络错误,请稍后重试", |
|
|
|
|
|
"earth.hq_fuzhou": "全球总部福州", |
|
|
|
|
|
"earth.hq_fuzhou_html": "全球总部<br>福州" |
|
|
|
|
|
}, |
|
|
|
|
|
en: { |
|
|
|
|
|
"video.play": "Video", |
|
|
|
|
|
"filter.by_product": "Filter by product", |
|
|
|
|
|
"about.expand_more": "Show more", |
|
|
|
|
|
"about.collapse": "Show less", |
|
|
|
|
|
"brand.short": "RAYNEN", |
|
|
|
|
|
"stock.delay_note": "As of {time}* Quotes delayed by 15 minutes or more.", |
|
|
|
|
|
"contact.name_required": "Please enter your name", |
|
|
|
|
|
"contact.phone_required": "Please enter your phone number", |
|
|
|
|
|
"contact.company_required": "Please enter your company name", |
|
|
|
|
|
"contact.email_required": "Please enter your email", |
|
|
|
|
|
"contact.submitting": "Submitting...", |
|
|
|
|
|
"contact.submit": "Submit", |
|
|
|
|
|
"contact.success": "Submitted successfully. We will contact you soon.", |
|
|
|
|
|
"contact.fail": "Submission failed. Please try again later.", |
|
|
|
|
|
"contact.network_error": "Network error. Please try again later.", |
|
|
|
|
|
"earth.hq_fuzhou": "Global HQ Fuzhou", |
|
|
|
|
|
"earth.hq_fuzhou_html": "Global HQ<br>Fuzhou" |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function getUiLang() { |
|
|
|
|
|
const fromHeader = document.querySelector(".site-header__lang")?.getAttribute("data-lang-current"); |
|
|
|
|
|
if (fromHeader === "en" || fromHeader === "zh") return fromHeader; |
|
|
|
|
|
const seg = location.pathname.replace(/^\//, "").split("/")[0] || ""; |
|
|
|
|
|
return seg === "en" ? "en" : "zh"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function t(key, vars) { |
|
|
|
|
|
const lang = getUiLang(); |
|
|
|
|
|
const table = UI_I18N[lang] || UI_I18N.zh; |
|
|
|
|
|
let str = table[key] ?? UI_I18N.zh[key] ?? key; |
|
|
|
|
|
if (vars && typeof vars === "object") { |
|
|
|
|
|
Object.keys(vars).forEach((k) => { |
|
|
|
|
|
str = str.replace(new RegExp(`\\{${k}\\}`, "g"), String(vars[k])); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return str; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
window.getUiLang = getUiLang; |
|
|
|
|
|
window.t = t; |
|
|
|
|
|
|
|
|
|
|
|
const $header = $(".site-header"); |
|
|
const $header = $(".site-header"); |
|
|
const $mask = $(".mask"); |
|
|
const $mask = $(".mask"); |
|
|
const $targets = $("[data-header-dark]"); |
|
|
const $targets = $("[data-header-dark]"); |
|
|
|