886 lines
49 KiB
JavaScript
886 lines
49 KiB
JavaScript
/**
|
||
* Template Name: Logis - v1.0.1
|
||
* Template URL: https://bootstrapmade.com/logis-bootstrap-logistics-website-template/
|
||
* Author: BootstrapMade.com
|
||
* License: https://bootstrapmade.com/license/
|
||
*/
|
||
document.addEventListener('DOMContentLoaded', () => {
|
||
"use strict";
|
||
|
||
const pageBackgroundStorageKey = 'app-page-background-color';
|
||
const themeColorStorageKey = 'app-theme-color';
|
||
const DEFAULT_THEME_COLOR = '#054f74';
|
||
|
||
function hexToRgb(hex) {
|
||
const normalized = hex.replace(/^#/, '');
|
||
if (!/^[a-f\d]{6}$/i.test(normalized)) return null;
|
||
return {
|
||
r: parseInt(normalized.slice(0, 2), 16),
|
||
g: parseInt(normalized.slice(2, 4), 16),
|
||
b: parseInt(normalized.slice(4, 6), 16),
|
||
};
|
||
}
|
||
|
||
function darkenHex(hex, ratio) {
|
||
const rgb = hexToRgb(hex);
|
||
if (!rgb) return hex;
|
||
const toHex = (value) => Math.round(value).toString(16).padStart(2, '0');
|
||
return (
|
||
'#' +
|
||
toHex(rgb.r * (1 - ratio)) +
|
||
toHex(rgb.g * (1 - ratio)) +
|
||
toHex(rgb.b * (1 - ratio))
|
||
);
|
||
}
|
||
|
||
function lightenHex(hex, mixWhite) {
|
||
const rgb = hexToRgb(hex);
|
||
if (!rgb) return hex;
|
||
const mix = typeof mixWhite === 'number' ? mixWhite : 0.92;
|
||
const toHex = (value) => Math.round(value).toString(16).padStart(2, '0');
|
||
return (
|
||
'#' +
|
||
toHex(rgb.r * (1 - mix) + 255 * mix) +
|
||
toHex(rgb.g * (1 - mix) + 255 * mix) +
|
||
toHex(rgb.b * (1 - mix) + 255 * mix)
|
||
);
|
||
}
|
||
|
||
function applyStoredThemeColor() {
|
||
let color = '';
|
||
try {
|
||
color = localStorage.getItem(themeColorStorageKey) || '';
|
||
} catch {
|
||
return;
|
||
}
|
||
if (!color) color = DEFAULT_THEME_COLOR;
|
||
if (!color.startsWith('#')) color = `#${color}`;
|
||
|
||
const root = document.documentElement;
|
||
const hover = darkenHex(color, 0.05);
|
||
const soft = lightenHex(color, 0.9);
|
||
const rgb = hexToRgb(color);
|
||
const brandTokens = ['--kc-brand', '--kc-primary', '--kc-tertiary', '--color-primary', '--ai-action'];
|
||
brandTokens.forEach((token) => root.style.setProperty(token, color));
|
||
root.style.setProperty('--kc-brand-hover', hover);
|
||
root.style.setProperty('--ai-action-hover', hover);
|
||
root.style.setProperty('--kc-brand-soft', soft);
|
||
root.style.setProperty('--ai-primary-soft', soft);
|
||
if (rgb) {
|
||
const rgbStr = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
|
||
['--kc-brand-rgb', '--kc-primary-rgb', '--kc-tertiary-rgb', '--ai-action-rgb', '--ai-navy-rgb'].forEach(
|
||
(token) => root.style.setProperty(token, rgbStr),
|
||
);
|
||
}
|
||
}
|
||
|
||
function softenHex(hex, mixWhite) {
|
||
const normalized = hex.replace(/^#/, '');
|
||
if (!/^[a-f\d]{6}$/i.test(normalized)) return hex;
|
||
const r = parseInt(normalized.slice(0, 2), 16);
|
||
const g = parseInt(normalized.slice(2, 4), 16);
|
||
const b = parseInt(normalized.slice(4, 6), 16);
|
||
const mix = typeof mixWhite === 'number' ? mixWhite : 0.55;
|
||
const toHex = (value) => Math.round(value).toString(16).padStart(2, '0');
|
||
return (
|
||
'#' +
|
||
toHex(r * (1 - mix) + 255 * mix) +
|
||
toHex(g * (1 - mix) + 255 * mix) +
|
||
toHex(b * (1 - mix) + 255 * mix)
|
||
);
|
||
}
|
||
|
||
function applyStoredPageBackground() {
|
||
let color = '';
|
||
try {
|
||
color = localStorage.getItem(pageBackgroundStorageKey) || '';
|
||
} catch {
|
||
return;
|
||
}
|
||
if (!color) return;
|
||
if (!color.startsWith('#')) color = `#${color}`;
|
||
const root = document.documentElement;
|
||
const warmPageBgs = new Set(['#f6f1e7', '#f5f4f1', '#faf9f7']);
|
||
const soft = softenHex(color, warmPageBgs.has(color.toLowerCase()) ? 0.42 : 0.55);
|
||
root.style.setProperty('--ai-bg', color);
|
||
root.style.setProperty('--ai-canvas', color);
|
||
root.style.setProperty('--ai-bg-soft', soft);
|
||
root.style.setProperty('--ai-header-bg', `color-mix(in srgb, ${color} 94%, transparent)`);
|
||
root.style.setProperty('--kc-page-bg', color);
|
||
root.style.setProperty('--kc-neutral', soft);
|
||
}
|
||
|
||
applyStoredThemeColor();
|
||
applyStoredPageBackground();
|
||
|
||
const languageStorageKey = 'ide-language';
|
||
const pageTitleMap = {
|
||
'IDE - Cross-border Logistics, Delivered Globally': 'IDE - 跨境物流,全球即递',
|
||
'IDE | Global Digital One-Stop Cross-Border Logistics': 'IDE - 跨境物流,全球即递',
|
||
'IDE|Immediate Delivery Express — Cross-Border Logistics': 'IDE - 跨境物流,全球即递',
|
||
'Faster & Simpler': '更快 · 更简单',
|
||
'|Faster & Simpler': '更快 · 更简单',
|
||
'IDE - About': 'IDE - 关于我们',
|
||
'IDE - Services': 'IDE - 服务',
|
||
'IDE - Service Details': 'IDE - 服务详情',
|
||
'IDE - Pricing': 'IDE - 价格',
|
||
'IDE - Contact': 'IDE - 联系我们',
|
||
'IDE - Get a Quote': 'IDE - 获取报价',
|
||
'IDE - Sample Inner Page': 'IDE - 示例内页',
|
||
'IDE - Company Profile': 'IDE - 公司介绍',
|
||
'404 Not Found': '404 页面未找到'
|
||
};
|
||
|
||
const i18nTextNodes = new WeakMap();
|
||
|
||
const textMap = {
|
||
'Home': '首页',
|
||
'Routes': '线路',
|
||
'About': '关于我们',
|
||
'About us': '关于我们',
|
||
'About Us': '关于我们',
|
||
'Services': '服务',
|
||
'Our Services': '我们的服务',
|
||
'Pricing': '价格',
|
||
'Contact': '联系我们',
|
||
'Contact CN': '联系我们',
|
||
'Login': '登录',
|
||
'Ship now': '去发货',
|
||
'Enter': '进入系统',
|
||
'Sign In / Register': '注册/登录',
|
||
'Learn More': '了解更多',
|
||
'Search': '搜索',
|
||
'Track': '查询物流',
|
||
'Enter tracking number': '请输入跟踪单号',
|
||
'Your Name': '你的姓名',
|
||
'Your Email': '你的邮箱',
|
||
'Subject': '主题',
|
||
'Message': '留言内容',
|
||
'Name': '姓名',
|
||
'Email': '邮箱',
|
||
'Phone': '电话',
|
||
'City of Departure': '始发城市',
|
||
'Delivery City': '目的城市',
|
||
'Total Weight (kg)': '总重量 (kg)',
|
||
'Dimensions (cm)': '尺寸 (cm)',
|
||
'ZIP code or CitY': '邮编或城市',
|
||
'Call To Action': '立即行动',
|
||
'Frequently Asked Questions': '常见问题',
|
||
'Useful Links': '常用链接',
|
||
'Terms of service': '服务条款',
|
||
'Privacy policy': '隐私政策',
|
||
'Service Details': '服务详情',
|
||
'Sample Inner Page': '示例内页',
|
||
'Company Profile': '公司介绍',
|
||
'[Template] Sample Inner Page': '[模板] 示例内页',
|
||
'Our Team': '我们的团队',
|
||
'Horizontal Pricing': '横向价格',
|
||
'Your Personal Details': '您的个人信息',
|
||
'Send Message': '发送消息',
|
||
'Your quote request has been sent successfully. Thank you!': '您的询价请求已成功发送,感谢您!',
|
||
'Your message has been sent. Thank you!': '您的消息已发送,感谢您!',
|
||
'Loading': '加载中',
|
||
'Location:': '地址:',
|
||
'Phone:': '电话:',
|
||
'Call:': '电话:',
|
||
'Email:': '邮箱:',
|
||
'Address:': '地址:',
|
||
'Get a Quote': '获取报价',
|
||
'Get a quote': '获取报价',
|
||
'Copyright © 2020.SZJYH All rights reserved.': '版权 © 2020.SZJYH 保留所有权利。',
|
||
'About Us': '关于我们',
|
||
'Dolor iure expedita id fuga asperiores qui sunt consequatur minima. Quidem voluptas deleniti. Sit quia molestiae quia quas qui magnam itaque veritatis dolores. Corrupti totam ut eius incidunt reiciendis veritatis asperiores placeat.': '我们坚持高效、可靠、透明的服务理念,为客户提供稳定的跨境物流解决方案。',
|
||
'Ullamco laboris nisi ut aliquip consequat': '高效履约与稳定交付',
|
||
'Magni facilis facilis repellendus cum excepturi quaerat praesentium libre trade': '覆盖多场景物流需求,保障运输过程可追踪、可管理。',
|
||
'Magnam soluta odio exercitationem reprehenderi': '专业运营团队支持',
|
||
'Quo totam dolorum at pariatur aut distinctio dolorum laudantium illo direna pasata redi': '从下单到签收全流程跟进,及时响应客户问题。',
|
||
'Voluptatem et qui exercitationem': '持续优化时效与成本',
|
||
'Et velit et eos maiores est tempora et quos dolorem autem tempora incidunt maxime veniam': '通过线路与仓配优化,帮助客户获得更优履约体验。',
|
||
'Our Services': '我们的服务',
|
||
'Storage': '仓储',
|
||
'Logistics': '物流',
|
||
'Cargo': '货运',
|
||
'Trucking': '卡车运输',
|
||
'Packaging': '包装',
|
||
'Warehousing': '仓储',
|
||
'Cumque eos in qui numquam. Aut aspernatur perferendis sed atque quia voluptas quisquam repellendus temporibus itaqueofficiis odit': '提供灵活仓储与库存管理方案,支持多渠道订单履约。',
|
||
'Asperiores provident dolor accusamus pariatur dolore nam id audantium ut et iure incidunt molestiae dolor ipsam ducimus occaecati nisi': '整合头程、干线与末端配送,打造一体化物流服务。',
|
||
'Dicta quam similique quia architecto eos nisi aut ratione aut ipsum reiciendis sit doloremque oluptatem aut et molestiae ut et nihil': '针对不同货型与业务场景,定制高性价比运输方案。',
|
||
'Illo consequuntur quisquam delectus praesentium modi dignissimos facere vel cum onsequuntur maiores beatae consequatur magni voluptates': '提供标准化与定制化包装服务,降低运输破损风险。',
|
||
'Quas assumenda non occaecati molestiae. In aut earum sed natus eatae in vero. Ab modi quisquam aut nostrum unde et qui est non quo nulla': '多仓协同与库存可视化,提升发货效率与周转能力。',
|
||
'Call To Action': '立即行动',
|
||
'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.': '立即联系我们获取专属物流方案,我们将根据您的业务规模与线路需求快速报价并提供落地建议。',
|
||
'Frequently Asked Questions': '常见问题',
|
||
'Non consectetur a erat nam at lectus urna duis?': '你们支持哪些物流线路?',
|
||
'Feugiat pretium nibh ipsum consequat. Tempus iaculis urna id volutpat lacus laoreet non curabitur gravida. Venenatis lectus magna fringilla urna porttitor rhoncus dolor purus non.': '我们支持多国跨境线路,可根据目的地、时效和成本为您推荐合适渠道。',
|
||
'Feugiat scelerisque varius morbi enim nunc faucibus a pellentesque?': '是否支持订单追踪?',
|
||
'Dolor sit amet consectetur adipiscing elit pellentesque habitant morbi. Id interdum velit laoreet id donec ultrices. Fringilla phasellus faucibus scelerisque eleifend donec pretium. Est pellentesque elit ullamcorper dignissim. Mauris ultrices eros in cursus turpis massa tincidunt dui.': '支持全流程节点追踪与状态更新,您可随时查看运输进展。',
|
||
'Dolor sit amet consectetur adipiscing elit pellentesque habitant morbi?': '如何获取报价?',
|
||
'Eleifend mi in nulla posuere sollicitudin aliquam ultrices sagittis orci. Faucibus pulvinar elementum integer enim. Sem nulla pharetra diam sit amet nisl suscipit. Rutrum tellus pellentesque eu tincidunt. Lectus urna duis convallis convallis tellus. Urna molestie at elementum eu facilisis sed odio morbi quis': '可在报价页面提交需求,我们会根据货量、线路、时效快速回复。',
|
||
'Ac odio tempor orci dapibus. Aliquam eleifend mi in nulla?': '支持企业定制方案吗?',
|
||
'Tempus quam pellentesque nec nam aliquam sem et tortor consequat?': '售后如何对接?',
|
||
'Molestie a iaculis at erat pellentesque adipiscing commodo. Dignissim suspendisse in est ante in. Nunc vel risus commodo viverra maecenas accumsan. Sit amet nisl suscipit adipiscing bibendum est. Purus gravida quis blandit turpis cursus in': '支持企业级定制服务,包含对账、异常处理与专属客服协同。',
|
||
'Useful Links': '常用链接',
|
||
'Our Services': '我们的服务',
|
||
'Web Design': '网站设计',
|
||
'Web Development': '网站开发',
|
||
'Product Management': '产品管理',
|
||
'Marketing': '市场推广',
|
||
'Graphic Design': '平面设计',
|
||
'IDE|Faster & Simpler': 'IDE|更快 · 更简单',
|
||
'Faster & Simpler': '更快 · 更简单',
|
||
'|Faster & Simpler': '更快 · 更简单',
|
||
'We provide end-to-end international logistics for cross-border sellers and brands. From first mile to final delivery, IDE makes shipping faster and simpler.': '我们为跨境卖家与品牌提供端到端国际物流服务,从揽收到妥投全链路可控。IDE物流,让发货更快更简单。',
|
||
'IDE focuses on international logistics operations with stable timelines, clear tracking, and transparent pricing to make global fulfillment faster and simpler.': 'IDE专注国际物流运营,以稳定时效、清晰轨迹和透明报价,帮助全球履约更快更简单。',
|
||
'Reliable global delivery network': '稳定可靠的全球配送网络',
|
||
'Integrated routes and carriers help us keep lead times short and delivery quality consistent.': '通过整合线路与承运资源,我们在缩短时效的同时保持交付稳定性。',
|
||
'Real-time tracking and exception handling': '全程追踪与异常处理',
|
||
'Every shipment is visible from pickup to delivery, with proactive alerts for delays or issues.': '每一票货物从揽收到签收全程可视,延误与异常可主动预警。',
|
||
'Dedicated support for cross-border teams': '跨境团队专属支持',
|
||
'Our logistics specialists respond quickly so your operations stay smooth and simple.': '物流专家快速响应,保障你的运营流程顺畅且简单。',
|
||
'Built for international fulfillment at scale, with standard processes and reliable execution.': '面向国际履约规模化场景,提供标准化流程与稳定执行。',
|
||
'Flexible shipping channels for parcels, pallets, and B2B cargo.': '支持包裹、托盘与 B2B 货运的灵活运输通道。',
|
||
'Standardized workflows that reduce risk and improve delivery speed.': '标准化操作流程,降低风险并提升交付速度。',
|
||
'Multi-warehouse inventory and order orchestration for international operations.': '面向国际业务的多仓库存与订单协同。',
|
||
'Line-haul and last-mile coordination across regions with stable performance.': '跨区域干线与末端协同,保障稳定履约表现。',
|
||
'Cost-efficient cargo plans tailored by route, weight, and service level.': '按线路、重量与服务等级定制更高性价比的货运方案。',
|
||
'Protective packaging options designed for international transport.': '针对国际运输场景提供防护型包装方案。',
|
||
'Smart warehousing and fast dispatch to keep global orders moving.': '智能仓储与快速出库,保障全球订单持续流转。',
|
||
'Need a global logistics partner? Talk to IDE and launch a faster, simpler shipping plan for your business.': '需要国际物流合作伙伴?联系IDE,为你的业务启动更快更简单的发货方案。',
|
||
'A logistics system built for speed, visibility, and simplicity.': '为速度、可视化与简化而打造的物流体系。',
|
||
'From pickup to customs and final delivery, we connect every step with operational control.': '从揽收、清关到末端妥投,每个环节都在运营管控之中。',
|
||
'Standard operating procedures ensure stable service quality.': '标准作业流程保障服务质量稳定。',
|
||
'Route optimization improves both transit time and cost.': '线路优化同时改善时效与成本。',
|
||
'Exception workflows reduce delays and customer complaints.': '异常处理流程降低延误与客诉。',
|
||
'Optimized for cross-border growth': '为跨境增长场景优化',
|
||
'Whether DTC or B2B, we provide consistent logistics capacity and service-level execution.': '无论 DTC 还是 B2B,我们都能提供持续稳定的履约能力与服务水位。',
|
||
'Data-driven operations and reporting': '数据驱动的运营与报表',
|
||
'Operational dashboards help you monitor timeliness, costs, and fulfillment performance.': '通过运营看板实时监控时效、成本与履约表现。',
|
||
'Scale your logistics without adding operational complexity.': '在不增加运营复杂度的情况下扩展物流规模。',
|
||
'Secure, compliant, and dependable international shipping.': '安全、合规、可靠的国际运输服务。',
|
||
'Which countries and routes do you support?': '支持哪些国家与物流线路?',
|
||
'We support major cross-border routes and can recommend channels based on transit time and cost targets.': '我们覆盖主流跨境线路,并可根据时效与成本目标推荐最合适渠道。',
|
||
'Can I track every shipment in real time?': '是否支持全程实时追踪?',
|
||
'Yes. You get milestone updates from pickup to delivery, with clear status visibility for your team.': '支持。你可以从揽收到签收获取关键节点更新,团队可清晰查看状态。',
|
||
'How do I get a shipping quote?': '如何获取运输报价?',
|
||
'Share shipment details in the contact form and we will return a route-specific quote quickly.': '在联系表单提交货物信息后,我们会快速返回线路化报价。',
|
||
'Do you provide enterprise-level custom solutions?': '是否提供企业级定制方案?',
|
||
'How is after-sales support handled?': '售后支持如何对接?',
|
||
'Yes. We provide tailored SOPs, billing reconciliation, exception handling, and dedicated support teams.': '支持。我们提供定制 SOP、账单对账、异常处理与专属客服团队。',
|
||
'Faster and simpler logistics execution designed for growing international businesses.': '为成长型国际业务打造更快更简单的物流执行体系。',
|
||
'We align capacity, route planning, and exception management so your team can scale operations without process chaos.': '我们协同运力、线路规划与异常处理,让团队在规模增长时依然保持流程清晰。',
|
||
'International Logistics Expertise': '国际物流专业能力',
|
||
'We combine route planning, customs coordination, and fulfillment execution to keep cross-border delivery reliable and easy to manage.': '我们将线路规划、清关协同与履约执行整合在一起,让跨境交付稳定且易管理。',
|
||
'Service details built around faster and simpler global shipping': '围绕“更快更简单”打造的全球发运服务细节',
|
||
'IDE delivers practical international logistics with clear operating standards, stable timelines, and full shipment visibility.': 'IDE提供务实的国际物流服务,以清晰标准、稳定时效和全程可视化保障履约。',
|
||
'Route-specific transport plans for cost and speed balance.': '按线路定制运输方案,平衡成本与时效。',
|
||
'Milestone tracking with proactive exception alerts.': '关键节点跟踪并主动预警异常。',
|
||
'Dedicated support from booking to final delivery.': '从订舱到妥投提供专属支持。',
|
||
'Our teams coordinate warehouse, line-haul, customs, and last-mile partners to reduce delays and improve customer delivery experience.': '我们的团队协同仓储、干线、清关与末端伙伴,减少延误并提升客户签收体验。',
|
||
'If your business needs a dependable cross-border logistics partner, we can design and run a workflow that keeps shipping faster and simpler every day.': '如果你的业务需要可靠的跨境物流伙伴,我们可为你设计并运营一套每天都更快更简单的发运流程。',
|
||
'IDE is your international logistics partner for cross-border fulfillment, helping teams ship worldwide with faster execution and simpler operations.': 'IDE是全球数字化一站式跨境物流解决方案服务商,依托集团成熟物流产品和渠道,聚焦行业忽视的中小卖家与疑难订单赛道。以数字化智能系统、全流程顾问专属服务,解决中小跨境卖家发货烦琐、疑难单无人承接、售后无保障、行业资金风险高的普遍痛点。'
|
||
,'IDE is a global digital one-stop cross-border logistics solution provider. Built on the group\'s mature logistics products and channels, we focus on underserved SMB sellers and difficult-order segments. With digital intelligent systems and full-process dedicated advisory services, we solve common pain points: cumbersome shipping, difficult orders with no takers, lack of after-sales protection, and high industry financial risk.': 'IDE是全球数字化一站式跨境物流解决方案服务商,依托集团成熟物流产品和渠道,聚焦行业忽视的中小卖家与疑难订单赛道。以数字化智能系统、全流程顾问专属服务,解决中小跨境卖家发货烦琐、疑难单无人承接、售后无保障、行业资金风险高的普遍痛点。',
|
||
'Facere distinctio molestiae nisi fugit tenetur repellat non praesentium nesciunt optio quis sit odio nemo quisquam. eius quos reiciendis eum vel eum voluptatem eum maiores eaque id optio ullam occaecati odio est possimus vel reprehenderit': '我们提供稳定高效的国际物流服务,帮助卖家与企业在全球范围内更快完成履约。',
|
||
'Clients': '客户',
|
||
'Projects': '项目',
|
||
'Support': '支持',
|
||
'Workers': '员工',
|
||
'Staff': '员工',
|
||
'Delivered': '签收',
|
||
'Customers': '客户',
|
||
'Orders': '订单',
|
||
'Hours Of Support': '支持时长',
|
||
'Free Plan': '免费方案',
|
||
'Business Plan': '商业方案',
|
||
'Developer Plan': '开发者方案',
|
||
'Buy Now': '立即购买',
|
||
'Consult Now': '立即咨询',
|
||
'Customs Clearance': '清关',
|
||
'Warehousing': '仓储',
|
||
'International Logistics': '国际物流',
|
||
'Formal and express customs declaration support': '一般贸易与快件清关申报支持',
|
||
'Document review and compliance check': '单证预审与合规校验',
|
||
'Customs status updates and exception follow-up': '清关状态更新与异常跟进',
|
||
'Inbound, shelving, and inventory control': '入库、上架与库存管控',
|
||
'Order picking, packing, and same-day dispatch': '拣货、打包与当日出库',
|
||
'Multi-platform order integration and reconciliation': '多平台订单对接与账务对账',
|
||
'Air, sea, and truck route options': '空运、海运与卡航多线路可选',
|
||
'End-to-end tracking from pickup to delivery': '从揽收到签收的全程追踪',
|
||
'SLA-based operations and after-sales support': '基于 SLA 的运营保障与售后支持',
|
||
'/ month': '/ 月',
|
||
'Quam adipiscing vitae proin': '基础功能支持',
|
||
'Nec feugiat nisl pretium': '标准服务保障',
|
||
'Nulla at volutpat diam uteera': '多渠道履约能力',
|
||
'Global route coverage': '全球线路覆盖',
|
||
'Customs support and compliance': '清关支持与合规保障',
|
||
'Real-time shipment visibility': '运输轨迹实时可视',
|
||
'Pharetra massa massa ultricies': '高级扩展能力',
|
||
'Massa ultricies mi quis hendrerit': '专属团队支持',
|
||
'Core Services': '核心服务',
|
||
'Transport Network': '运输网络',
|
||
'Fulfillment Assurance': '履约保障',
|
||
'Voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident': '我们通过标准化流程与可视化系统,确保每一票货物稳定交付。',
|
||
'Minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat tarad limino ata': '多渠道承运资源整合,兼顾时效、成本与稳定性。',
|
||
'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur': '以客户体验为中心,持续优化运输与履约流程。',
|
||
'Voluptatem dignissimos provident quasi corporis voluptates sit assumenda.': '我们通过技术与运营协同,持续提升物流服务品质。',
|
||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.': '提供从仓储到配送的一站式解决方案,帮助业务稳步增长。',
|
||
'Ullamco laboris nisi ut aliquip ex ea commodo consequat.': '标准化操作流程,保障稳定履约。',
|
||
'Duis aute irure dolor in reprehenderit in voluptate velit.': '智能路由规划,优化整体成本。',
|
||
'Ullam est qui quos consequatur eos accusamus.': '异常可追踪可处理,交付更可靠。',
|
||
'Corporis temporibus maiores provident': '覆盖多场景运输能力',
|
||
'Ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum': '无论是 B2B 还是电商订单,我们都可提供稳定履约能力与售后支持。',
|
||
'Sunt consequatur ad ut est nulla consectetur reiciendis animi voluptas': '以数据驱动的运营优化',
|
||
'Cupiditate placeat cupiditate placeat est ipsam culpa. Delectus quia minima quod. Sunt saepe odit aut quia voluptatem hic voluptas dolor doloremque.': '通过节点数据分析持续优化时效、库存与配送效率。',
|
||
'Facilis ut et voluptatem aperiam. Autem soluta ad fugiat.': '支持业务规模增长过程中的灵活扩展。',
|
||
'Quas et necessitatibus eaque impedit ipsum animi consequatur incidunt in': '稳定、安全、可扩展的服务体系',
|
||
'You can duplicate this sample page and create any number of inner pages you like!': '您可以复制该示例页面并创建任意数量的内页。',
|
||
'Our Team': '我们的团队',
|
||
'Walter White': 'Walter White',
|
||
'Sarah Jhinson': 'Sarah Jhinson',
|
||
'William Anderson': 'William Anderson',
|
||
'Saul Goodman': 'Saul Goodman',
|
||
'Sara Wilsson': 'Sara Wilsson',
|
||
'Jena Karlis': 'Jena Karlis',
|
||
'Matt Brandon': 'Matt Brandon',
|
||
'John Larson': 'John Larson',
|
||
'Liam Chen': '陈亮',
|
||
'Sophie Lin': '林苏菲',
|
||
'David Wong': '王大卫',
|
||
'Amy Zhao': '赵安妮',
|
||
'Kevin Xu': '徐凯文',
|
||
'Ceo & Founder': '首席执行官 / 创始人',
|
||
'Designer': '设计师',
|
||
'Store Owner': '店主',
|
||
'Freelancer': '自由职业者',
|
||
'Entrepreneur': '企业家',
|
||
'Cross-border E-commerce Seller': '跨境电商卖家',
|
||
'Brand Operations Director': '品牌运营总监',
|
||
'B2B Trading Manager': 'B2B 贸易经理',
|
||
'Warehouse Operations Lead': '仓储运营负责人',
|
||
'International Business Owner': '国际业务负责人',
|
||
'A108 Adam Street, New York, NY 535022': 'A108 Adam Street, New York, NY 535022',
|
||
'404 Not Found': '404 页面未找到',
|
||
'nginx': 'nginx',
|
||
'We provide transparent pricing, stable transit timelines, and responsive support to help cross-border businesses ship with confidence.': '我们提供透明报价、稳定时效和快速响应支持,帮助跨境业务更安心地发货。',
|
||
'Our operations team standardizes every fulfillment step to improve predictability and customer satisfaction.': '我们的运营团队将履约环节标准化,提升交付可预测性与客户满意度。',
|
||
'Start Shipping': '开始发货',
|
||
'Products': '产品',
|
||
'Start Shipping with IDE': '开始用 IDE 发货',
|
||
'View full pricing →': '查看完整价格 →',
|
||
'Global routes with predictable transit times': '全球线路覆盖,时效可预测',
|
||
'Real-time tracking with proactive exception control': '全程追踪并主动控制异常',
|
||
'Dedicated account support and response SLA': '专属客户支持与响应 SLA',
|
||
'Our specialists respond fast with SLA-backed support so operations stay smooth and simple.': '我们的专家团队提供 SLA 保障的快速响应,让运营始终更顺畅更简单。',
|
||
'Built for high-volume international fulfillment with stable operations and measurable service quality.': '面向大规模国际履约,提供稳定运营与可量化服务质量。',
|
||
'Flexible channels for parcels, pallets, and B2B cargo with optimized cost-time balance.': '支持包裹、托盘与 B2B 货运,并优化时效与成本平衡。',
|
||
'Standard operating procedures that reduce delivery risk and improve on-time performance.': '标准作业流程降低交付风险并提升准时率。',
|
||
'Need a reliable international logistics partner? Get a route-specific plan with pricing, transit time, and SLA commitment within 24 hours.': '需要可靠的国际物流伙伴?24 小时内获取含报价、时效与 SLA 承诺的线路方案。',
|
||
'A commercial logistics system built for speed, visibility, and margin control.': '为速度、可视化与利润控制打造的商业物流体系。',
|
||
'From pickup to customs clearance and final delivery, every milestone is managed with operational controls.': '从揽收到清关再到妥投,每个里程碑都在运营管控下执行。',
|
||
'Optimized for cross-border growth and profitability': '为跨境增长与利润提升优化',
|
||
'Faster and simpler fulfillment designed to support growing international revenue.': '更快更简单的履约体系,支持国际业务持续增长。',
|
||
'We align capacity, routing, and exception management so your team can scale volume without losing control of service levels.': '我们协同运力、路由与异常管理,让团队扩量时仍能稳住服务水位。',
|
||
'Data-driven operations, billing, and KPI reporting': '数据驱动的运营、对账与 KPI 报表',
|
||
'Operational dashboards track on-time rate, logistics cost, and fulfillment KPIs in one view.': '运营看板一屏跟踪准时率、物流成本与履约 KPI。',
|
||
'Secure, compliant, and claim-ready international shipping': '安全、合规、可理赔的国际运输服务',
|
||
'How fast can I get a shipping quote?': '最快多久可以拿到报价?',
|
||
'Share shipment details and we return a route-specific quote with transit-time options quickly.': '提交货物信息后,我们会快速返回含多种时效选项的线路报价。',
|
||
'Do you support enterprise-level custom workflows?': '是否支持企业级定制流程?',
|
||
'How are claims and after-sales issues handled?': '理赔与售后问题如何处理?',
|
||
'Yes. We provide tailored SOPs, billing reconciliation, claims handling, and dedicated support teams.': '支持。我们提供定制 SOP、账单对账、理赔处理与专属支持团队。',
|
||
'Route-specific transport plans balancing cost, speed, and service reliability.': '按线路定制运输方案,平衡成本、时效与服务稳定性。',
|
||
'Milestone tracking with proactive delay and exception alerts.': '关键节点跟踪并主动预警延误与异常。',
|
||
'Dedicated support from booking to delivery with clear escalation paths.': '从订舱到妥投提供专属支持,并配备清晰升级路径。',
|
||
'Bldg. 36, Zone 5, Cuigang, Huaide, Fuyong, Baoan District, Shenzhen': '深圳宝安区福永怀德翠岗5区36栋',
|
||
'Copyright 2026 Immediate Delivery Express (Shenzhen) Co, Ltd. All Rights Reserved.': 'Copyright 2026 Immediate Delivery Express (Shenzhen) Co, Ltd. All Rights Reserved.',
|
||
'IDE logo': 'IDE标志',
|
||
'Immediate Delivery Express': 'Immediate Delivery Express'
|
||
,'IDE is a global digital one-stop cross-border logistics provider for SMB sellers and difficult orders — with smart systems and dedicated advisors at every step.': '体量不大、线路偏门?IDE 照样发。全球订单一站搞定,专属顾问从报价跟到签收,疑难单也有人管。'
|
||
,'IDE | Global one-stop cross-border logistics solution provider': 'IDE - 跨境物流,全球即递'
|
||
,'IDE - Cross-border Logistics, Delivered Globally': 'IDE - 跨境物流,全球即递'
|
||
,'Explore Services': '了解服务'
|
||
,'Quote Response': '报价响应'
|
||
,'Global Routes': '全球线路'
|
||
,'Active Clients': '活跃客户'
|
||
,'Why IDE': '为什么选择 IDE'
|
||
,'Three reasons cross-border teams choose Immediate Delivery Express.': '跨境团队选择 Immediate Delivery Express 的三大理由。'
|
||
,'Built for SMB sellers and difficult orders that others overlook.': '专为行业忽视的中小卖家与疑难订单而生。'
|
||
,'Immediate': '即时'
|
||
,'Integrated': '一体化'
|
||
,'Intelligent': '智能'
|
||
,'Digital': '数字化'
|
||
,'Dedicated': '专属顾问'
|
||
,'Specialized': '疑难专精'
|
||
,'Predictable transit times with SLA-backed operations.': 'SLA 保障运营,时效可预期。'
|
||
,'Route-specific quotes within 24 hours.': '24 小时内返回线路化报价。'
|
||
,'Smart systems streamline shipping for growing cross-border sellers.': '智能系统简化中小跨境卖家的发货流程。'
|
||
,'Less manual work, more visibility, faster execution.': '减少繁琐操作,提升可视化,加快履约执行。'
|
||
,'Full-process advisors from quote to after-sales support.': '从报价到售后,全流程顾问专属服务。'
|
||
,'One dedicated team — not a ticket queue.': '专属团队对接,不是工单排队。'
|
||
,'We take on difficult orders that others won\'t accept.': '承接其他渠道不愿接的疑难订单。'
|
||
,'Complex cargo, special routes, and edge cases welcome.': '复杂货型、特殊线路与边缘场景均可承接。'
|
||
,'Warehousing, customs, and line-haul in one flow.': '仓储、清关与干线一体化协同。'
|
||
,'IDE OMS + WMS connected end-to-end.': 'IDE OMS + WMS 端到端打通。'
|
||
,'Full shipment visibility from pickup to delivery.': '从揽收到签收全程可视。'
|
||
,'Proactive alerts before exceptions escalate.': '异常升级前主动预警。'
|
||
,'We provide transparent pricing, stable transit timelines, and responsive support to help SMB cross-border sellers ship with confidence.': '我们提供透明报价、稳定时效和快速响应支持,帮助中小跨境卖家更安心地发货。'
|
||
,'Everything you need to ship globally — built around IDE systems.': '全球发运所需的一切——围绕 IDE 系统构建。'
|
||
,'Inbound, inventory control, picking, packing, and same-day dispatch for global orders.': '入库、库存管控、拣货打包与全球订单当日出库。'
|
||
,'Air, sea, and truck routes with end-to-end tracking and SLA-based operations.': '空运、海运与卡航线路,全程追踪与 SLA 运营保障。'
|
||
,'Formal and express declaration, compliance review, and status follow-up.': '一般贸易与快件申报、合规预审与状态跟进。'
|
||
,'View all services →': '查看全部服务 →'
|
||
,'Tracking visibility is excellent. Our team handles exceptions faster with clearer operational ownership — and dedicated advisors keep everything on track.': '轨迹可视化非常出色。团队处理异常更快、责任更清晰——专属顾问全程跟进保障。'
|
||
,'Ready to ship with IDE?': '准备好用 IDE 发货了吗?'
|
||
,'Get a route-specific plan with pricing, transit time, and SLA commitment within 24 hours.': '24 小时内获取含报价、时效与 SLA 承诺的线路方案。'
|
||
,'Share shipment details and we return a route-specific quote with transit-time options within 24 hours.': '提交货物信息后,24 小时内返回含多种时效选项的线路报价。'
|
||
,'CEO & Founder · Cross-border Brand': '首席执行官 / 创始人 · 跨境品牌'
|
||
,'Operations Lead · E-commerce Seller': '运营负责人 · 电商卖家'
|
||
,'Hong Kong': '香港'
|
||
,'Shenzhen': '深圳'
|
||
,'Los Angeles': '洛杉矶'
|
||
,'London': '伦敦'
|
||
,'Singapore': '新加坡'
|
||
,'Tokyo': '东京'
|
||
,'Frankfurt': '法兰克福'
|
||
,'Sydney': '悉尼'
|
||
,'View Pricing': '查看价格'
|
||
,'Get Started': '快速开始'
|
||
,'How It Works': '合作流程'
|
||
,'3 steps — quote to delivery.': '三步 — 从报价到签收'
|
||
,'Others said no?': '别人不接?'
|
||
,'We say yes': '我们接'
|
||
,'Route · Cargo · Time': '线路 · 货型 · 时效'
|
||
,'24h quote': '24h 报价'
|
||
,'Price · Transit': '价格 · 时效'
|
||
,'1 advisor assigned': '分配专属顾问'
|
||
,'1 advisor': '1 位顾问'
|
||
,'Pickup → Delivered': '揽收 → 签收'
|
||
,'After-sales backup': '售后保障'
|
||
,'Share your shipment': '提交货物信息'
|
||
,'Get a quote →': '获取报价 →'
|
||
,'Start shipping →': '开始发货 →'
|
||
,'Get your plan in 24h': '24 小时拿方案'
|
||
,'See pricing →': '查看价格 →'
|
||
,'Ship with support': '顾问全程跟单'
|
||
,'View services →': '查看服务 →'
|
||
,'Why Sellers Choose IDE': '卖家为什么选择 IDE'
|
||
,'3 questions — 3 answers you\'ll remember.': '三个问题 — 三个让你记住的答案'
|
||
,'Will you take my order?': '我的单你们接吗?'
|
||
,'YES': '能'
|
||
,'Small volume': '小批量'
|
||
,'Tough cargo': '疑难货'
|
||
,'Special routes': '特殊线路'
|
||
,'Who do I talk to?': '出了问题找谁?'
|
||
,'Quote → After-sales': '报价 → 售后'
|
||
,'Not a ticket queue': '不是工单排队'
|
||
,'Can I track everything?': '物流能全程查到吗?'
|
||
,'Live milestones': '节点实时'
|
||
,'Alert before delay': '延误先预警'
|
||
,'One team — three pillars.': '一个团队 — 三大支柱'
|
||
,'Same-day dispatch': '当日出库'
|
||
,'Pick · Pack · Ship': '拣 · 包 · 发'
|
||
,'Air · Sea · Truck': '空 · 海 · 卡'
|
||
,'Door-to-door track': '门到门追踪'
|
||
,'Fast clearance': '快速清关'
|
||
,'Compliant · On time': '合规 · 准时'
|
||
,'Ask about your shipment →': '咨询我的货物 →'
|
||
,'YES — we take them': '能 — 我们接'
|
||
,'Small · Tough · Special': '小批 · 疑难 · 特殊'
|
||
,'Within 24 hours': '24 小时内'
|
||
,'Price + transit options': '价格 + 时效方案'
|
||
,'Global routes': '全球线路'
|
||
,'Best channel matched': '最优渠道匹配'
|
||
,'Full visibility': '全程可视'
|
||
,'Your advisor handles it': '顾问帮你处理'
|
||
,'Claims · Exceptions': '理赔 · 异常'
|
||
,'Hard shipment?': '疑难货?'
|
||
,'Free advisor': '免费顾问'
|
||
,'Route · Price · Transit': '线路 · 价格 · 时效'
|
||
,'One-stop fulfillment': '一站式履约'
|
||
,'Stable SLA': '稳定 SLA'
|
||
,'Cost · Speed balanced': '成本 · 时效平衡'
|
||
,'On-time delivery': '准时送达'
|
||
,'Risk controlled': '风险可控'
|
||
,'Multi-warehouse': '多仓协同'
|
||
,'Global inventory': '全球库存'
|
||
,'Line-haul + last mile': '干线 + 末端'
|
||
,'Stable performance': '稳定履约'
|
||
,'Route optimized': '线路优化'
|
||
,'By weight & SLA': '按重量 · SLA'
|
||
,'Regional fleet': '区域车队'
|
||
,'Flexible capacity': '弹性运力'
|
||
,'Export-grade pack': '出口级包装'
|
||
,'Damage protected': '防损保护'
|
||
,'Smart WMS': '智能 WMS'
|
||
,'Docs reviewed': '单证预审'
|
||
,'Status tracked': '状态跟踪'
|
||
,'Multi-platform sync': '多平台同步'
|
||
,'SLA backed': 'SLA 保障'
|
||
,'Call Us': '电话咨询'
|
||
,'Get Help': '快速帮助'
|
||
,'Track Shipment': '查询物流'
|
||
,'Cross-border shipping for SMB sellers and difficult orders — dedicated advisors, full tracking, and real after-sales support.': '面向中小卖家与疑难订单的跨境物流——专属顾问、全程追踪、真实售后保障。'
|
||
,'FAQ': '常见问题'
|
||
,'Do you accept small-volume or difficult orders?': '体量小或疑难订单能接吗?'
|
||
,'What if something goes wrong after shipping?': '发货后出问题怎么办?'
|
||
};
|
||
|
||
const reverseTextMap = {};
|
||
Object.entries(textMap).forEach(([englishText, chineseText]) => {
|
||
if (chineseText && !reverseTextMap[chineseText]) {
|
||
reverseTextMap[chineseText] = englishText;
|
||
}
|
||
});
|
||
|
||
function normalizeI18nText(text) {
|
||
return (text || '')
|
||
.replace(/[\u2018\u2019\u2032]/g, "'")
|
||
.replace(/[\u201C\u201D\u2033]/g, '"')
|
||
.replace(/\u00A0/g, ' ')
|
||
.replace(/\s+/g, ' ')
|
||
.trim();
|
||
}
|
||
|
||
function resolveEnglishKey(rawText) {
|
||
const normalizedText = normalizeI18nText(rawText || '');
|
||
if (!normalizedText) {
|
||
return '';
|
||
}
|
||
if (textMap[normalizedText]) {
|
||
return normalizedText;
|
||
}
|
||
return reverseTextMap[normalizedText] || '';
|
||
}
|
||
|
||
function tagI18nElement(element) {
|
||
if (!element || element.hasAttribute('data-i18n-key')) {
|
||
return;
|
||
}
|
||
if (element.closest('.site-nav-dock')) {
|
||
return;
|
||
}
|
||
const key = resolveEnglishKey(element.textContent || '');
|
||
if (key) {
|
||
element.setAttribute('data-i18n-key', key);
|
||
}
|
||
}
|
||
|
||
function registerI18nTargets() {
|
||
document.querySelectorAll('body *').forEach((element) => {
|
||
if (element.children.length !== 0) {
|
||
return;
|
||
}
|
||
|
||
tagI18nElement(element);
|
||
});
|
||
|
||
[
|
||
'.hero-desc',
|
||
'.hero-stat__label',
|
||
'.btn-hero-primary',
|
||
'.btn-hero-secondary',
|
||
'.section-header > span',
|
||
'.section-header > h2',
|
||
'.section-header > p',
|
||
'.how-step h3',
|
||
'.why-ide-card h3',
|
||
'.how-step-link',
|
||
'.pricing-more-link',
|
||
'.call-to-action h3',
|
||
'.cta-btn',
|
||
'.faq-question',
|
||
'.page-header h2',
|
||
'.page-header p',
|
||
'.featured-services .title',
|
||
'.services .service-card h3 a',
|
||
'.services .card:not(.service-card) h3 a',
|
||
'.pricing .pricing-item h3',
|
||
'.horizontal-pricing .pricing-item h3',
|
||
'.footer-info > p',
|
||
'.footer-links h4',
|
||
'.footer-contact h4',
|
||
'#navbar ul > li:not(.site-nav-dock) > a:not(#language-toggle-btn)',
|
||
].forEach((selector) => {
|
||
document.querySelectorAll(selector).forEach(tagI18nElement);
|
||
});
|
||
|
||
document.querySelectorAll('[placeholder]').forEach((element) => {
|
||
const placeholder = element.getAttribute('placeholder');
|
||
const placeholderKey = resolveEnglishKey(placeholder || '');
|
||
if (placeholderKey) {
|
||
element.setAttribute('data-i18n-placeholder-key', placeholderKey);
|
||
}
|
||
});
|
||
|
||
document.querySelectorAll('[alt],[title],[aria-label],[value]').forEach((element) => {
|
||
['alt', 'title', 'aria-label', 'value'].forEach((attr) => {
|
||
const rawValue = element.getAttribute(attr);
|
||
const key = resolveEnglishKey(rawValue || '');
|
||
if (key) {
|
||
element.setAttribute(`data-i18n-${attr}-key`, key);
|
||
}
|
||
});
|
||
});
|
||
|
||
const textNodeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
||
let textNode = textNodeWalker.nextNode();
|
||
while (textNode) {
|
||
const parent = textNode.parentElement;
|
||
if (!parent || ['SCRIPT', 'STYLE', 'NOSCRIPT'].includes(parent.tagName)) {
|
||
textNode = textNodeWalker.nextNode();
|
||
continue;
|
||
}
|
||
|
||
const key = resolveEnglishKey(textNode.textContent || '');
|
||
if (key) {
|
||
i18nTextNodes.set(textNode, key);
|
||
}
|
||
textNode = textNodeWalker.nextNode();
|
||
}
|
||
}
|
||
|
||
function renderLanguageToggle(isChinese) {
|
||
const languageToggleLink = document.querySelector('#language-toggle-btn');
|
||
if (!languageToggleLink) {
|
||
return;
|
||
}
|
||
|
||
languageToggleLink.classList.toggle('lang-is-zh', isChinese);
|
||
languageToggleLink.classList.toggle('lang-is-en', !isChinese);
|
||
languageToggleLink.innerHTML =
|
||
'<i class="bi bi-translate language-toggle-icon" aria-hidden="true"></i>' +
|
||
`<span class="language-toggle__next">${isChinese ? 'EN' : '中'}</span>`;
|
||
languageToggleLink.setAttribute(
|
||
'aria-label',
|
||
isChinese ? 'Switch to English' : '切换到中文'
|
||
);
|
||
languageToggleLink.setAttribute('title', isChinese ? 'Switch to English' : '切换到中文');
|
||
}
|
||
|
||
function applyLanguage(lang) {
|
||
const isChinese = lang === 'zh';
|
||
document.documentElement.lang = isChinese ? 'zh-CN' : 'en';
|
||
|
||
const currentTitle = document.title;
|
||
if (isChinese && pageTitleMap[currentTitle]) {
|
||
document.title = pageTitleMap[currentTitle];
|
||
} else if (!isChinese) {
|
||
const englishTitle = Object.keys(pageTitleMap).find((key) => pageTitleMap[key] === currentTitle);
|
||
if (englishTitle) {
|
||
document.title = englishTitle;
|
||
}
|
||
}
|
||
|
||
document.querySelectorAll('[data-i18n-key]').forEach((element) => {
|
||
const key = element.getAttribute('data-i18n-key');
|
||
if (!key) {
|
||
return;
|
||
}
|
||
element.textContent = isChinese ? (textMap[key] || key) : key;
|
||
});
|
||
|
||
document.querySelectorAll('[data-i18n-placeholder-key]').forEach((element) => {
|
||
const key = element.getAttribute('data-i18n-placeholder-key');
|
||
if (!key) {
|
||
return;
|
||
}
|
||
element.setAttribute('placeholder', isChinese ? (textMap[key] || key) : key);
|
||
});
|
||
|
||
['alt', 'title', 'aria-label', 'value'].forEach((attr) => {
|
||
document.querySelectorAll(`[data-i18n-${attr}-key]`).forEach((element) => {
|
||
const key = element.getAttribute(`data-i18n-${attr}-key`);
|
||
if (!key) {
|
||
return;
|
||
}
|
||
element.setAttribute(attr, isChinese ? (textMap[key] || key) : key);
|
||
});
|
||
});
|
||
|
||
const textNodeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
||
let textNode = textNodeWalker.nextNode();
|
||
while (textNode) {
|
||
const key = i18nTextNodes.get(textNode);
|
||
if (key) {
|
||
textNode.textContent = isChinese ? (textMap[key] || key) : key;
|
||
}
|
||
textNode = textNodeWalker.nextNode();
|
||
}
|
||
|
||
renderLanguageToggle(isChinese);
|
||
|
||
if (window.IDEAdvisor) {
|
||
window.IDEAdvisor.setLanguage(isChinese ? 'zh' : 'en');
|
||
}
|
||
|
||
if (window.IDEOpenGraph && typeof window.IDEOpenGraph.refresh === 'function') {
|
||
window.IDEOpenGraph.refresh();
|
||
}
|
||
}
|
||
|
||
function resolveSavedLanguage() {
|
||
const saved = localStorage.getItem(languageStorageKey);
|
||
if (saved === 'zh' || saved === 'en') return saved;
|
||
return 'zh';
|
||
}
|
||
|
||
function initLanguageSwitch() {
|
||
const dropDownMenu = Array.from(document.querySelectorAll('#navbar > ul > li.dropdown')).find((menuItem) => {
|
||
const menuText = normalizeI18nText(menuItem.textContent || '');
|
||
return menuText.includes('Drop Down');
|
||
});
|
||
if (dropDownMenu) {
|
||
dropDownMenu.remove();
|
||
}
|
||
|
||
registerI18nTargets();
|
||
|
||
const languageBtn = document.getElementById('language-toggle-btn');
|
||
if (languageBtn && languageBtn.dataset.bound !== '1') {
|
||
languageBtn.dataset.bound = '1';
|
||
languageBtn.addEventListener('click', (event) => {
|
||
event.preventDefault();
|
||
const currentLang = resolveSavedLanguage();
|
||
const nextLang = currentLang === 'en' ? 'zh' : 'en';
|
||
localStorage.setItem(languageStorageKey, nextLang);
|
||
applyLanguage(nextLang);
|
||
});
|
||
}
|
||
|
||
applyLanguage(resolveSavedLanguage());
|
||
}
|
||
|
||
/**
|
||
* Preloader
|
||
*/
|
||
const preloader = document.querySelector('#preloader');
|
||
if (preloader) {
|
||
window.addEventListener('load', () => {
|
||
preloader.remove();
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Sticky header on scroll
|
||
*/
|
||
const selectHeader = document.querySelector('#header');
|
||
if (selectHeader) {
|
||
document.addEventListener('scroll', () => {
|
||
window.scrollY > 100 ? selectHeader.classList.add('sticked') : selectHeader.classList.remove('sticked');
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Scroll top button
|
||
*/
|
||
const scrollTop = document.querySelector('.scroll-top');
|
||
if (scrollTop) {
|
||
const togglescrollTop = function() {
|
||
window.scrollY > 100 ? scrollTop.classList.add('active') : scrollTop.classList.remove('active');
|
||
}
|
||
window.addEventListener('load', togglescrollTop);
|
||
document.addEventListener('scroll', togglescrollTop);
|
||
scrollTop.addEventListener('click', window.scrollTo({
|
||
top: 0,
|
||
behavior: 'smooth'
|
||
}));
|
||
}
|
||
|
||
/**
|
||
* Mobile nav toggle
|
||
*/
|
||
const mobileNavShow = document.querySelector('.mobile-nav-show');
|
||
const mobileNavHide = document.querySelector('.mobile-nav-hide');
|
||
|
||
document.querySelectorAll('.mobile-nav-toggle').forEach(el => {
|
||
el.addEventListener('click', function(event) {
|
||
event.preventDefault();
|
||
mobileNavToogle();
|
||
})
|
||
});
|
||
|
||
function mobileNavToogle() {
|
||
document.querySelector('body').classList.toggle('mobile-nav-active');
|
||
mobileNavShow.classList.toggle('d-none');
|
||
mobileNavHide.classList.toggle('d-none');
|
||
}
|
||
|
||
/**
|
||
* Hide mobile nav on same-page/hash links
|
||
*/
|
||
document.querySelectorAll('#navbar a').forEach(navbarlink => {
|
||
if (navbarlink.id === 'language-toggle-btn') return;
|
||
const hash = navbarlink.hash;
|
||
if (!hash || hash === '#') return;
|
||
|
||
let section = null;
|
||
try {
|
||
section = document.querySelector(hash);
|
||
} catch (error) {
|
||
return;
|
||
}
|
||
if (!section) return;
|
||
|
||
navbarlink.addEventListener('click', () => {
|
||
if (document.querySelector('.mobile-nav-active')) {
|
||
mobileNavToogle();
|
||
}
|
||
});
|
||
|
||
});
|
||
|
||
/**
|
||
* Toggle mobile nav dropdowns
|
||
*/
|
||
const navDropdowns = document.querySelectorAll('.navbar .dropdown > a');
|
||
|
||
navDropdowns.forEach(el => {
|
||
el.addEventListener('click', function(event) {
|
||
if (document.querySelector('.mobile-nav-active')) {
|
||
event.preventDefault();
|
||
this.classList.toggle('active');
|
||
this.nextElementSibling.classList.toggle('dropdown-active');
|
||
|
||
let dropDownIndicator = this.querySelector('.dropdown-indicator');
|
||
dropDownIndicator.classList.toggle('bi-chevron-up');
|
||
dropDownIndicator.classList.toggle('bi-chevron-down');
|
||
}
|
||
})
|
||
});
|
||
|
||
/**
|
||
* Initiate PureCounter
|
||
*/
|
||
if (typeof PureCounter !== 'undefined' && document.querySelector('.purecounter')) {
|
||
new PureCounter();
|
||
}
|
||
|
||
/**
|
||
* Initiate glightbox
|
||
*/
|
||
if (typeof GLightbox !== 'undefined' && document.querySelector('.glightbox')) {
|
||
GLightbox({
|
||
selector: '.glightbox'
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Animation on scroll function and init
|
||
*/
|
||
function aos_init() {
|
||
if (typeof AOS === 'undefined') return;
|
||
AOS.init({
|
||
duration: 1000,
|
||
easing: 'ease-in-out',
|
||
once: true,
|
||
mirror: false
|
||
});
|
||
}
|
||
window.addEventListener('load', () => {
|
||
aos_init();
|
||
});
|
||
|
||
initLanguageSwitch();
|
||
|
||
});
|