https://2p4c.tw/wp-includes/js/jquery/jquery.min.js
https://2p4c.tw/wp-includes/js/jquery/jquery-migrate.min.js
(function() {
if (window.location.pathname.startsWith('/en/')) {
var topBar = document.getElementById('p4c-top-bar');
if (topBar) topBar.style.display = 'none';
}
})();
document.addEventListener("DOMContentLoaded", function() {
// --- 1. 打字機效果 ---
const textToType = "Hi,我是站長 Ching!歡迎來到我的網站";
const typeTarget = document.getElementById("cws-typewriterText");if (typeTarget) {
let typeIndex = 0;
function typeWriterEffect() {
if (typeIndex < textToType.length) {
typeTarget.textContent += textToType.charAt(typeIndex);
typeIndex++;
setTimeout(typeWriterEffect, 80);
}
}
setTimeout(typeWriterEffect, 500);
}// --- 2. 倒數 / 正數計時器 ---
const tripStartDate = new Date("May 7, 2026 20:00:00").getTime();
const cdTitle = document.getElementById("cws-cd-title");
const cdDays = document.getElementById("cws-cd-days");
const cdHours = document.getElementById("cws-cd-hours");function updateCountdown() {
const now = new Date().getTime();if (now < tripStartDate) {
const diff = tripStartDate - now;
cdDays.textContent = Math.floor(diff / (1000 * 60 * 60 * 24));
cdHours.textContent = String(Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0');
} else {
const diff = now - tripStartDate;
cdTitle.textContent = "✈️ 目前已經出發";
cdDays.textContent = Math.floor(diff / (1000 * 60 * 60 * 24));
cdHours.textContent = String(Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0');
}
}updateCountdown();
setInterval(updateCountdown, 1000);
});
function genesisBlocksShare( url, title, w, h ){
var left = ( window.innerWidth / 2 )-( w / 2 );
var top = ( window.innerHeight / 2 )-( h / 2 );
return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=600, top='+top+', left='+left);
}
var ConverlyCustomData = {channelId: null};
const loadScriptsTimer=setTimeout(loadScripts,5*1000);const userInteractionEvents=['click', 'mousemove', 'keydown', 'touchstart', 'touchmove', 'wheel'];userInteractionEvents.forEach(function(event){window.addEventListener(event,triggerScriptLoader,{passive:!0})});function triggerScriptLoader(){loadScripts();clearTimeout(loadScriptsTimer);userInteractionEvents.forEach(function(event){window.removeEventListener(event,triggerScriptLoader,{passive:!0})})}
function loadScripts(){document.querySelectorAll("script[data-type='lazy']").forEach(function(elem){elem.setAttribute("src",elem.getAttribute("data-src"))})}
var rtocScrollAnimation = {"rtocScrollAnimation":"on"};
var rtocBackButton = {"rtocBackButton":"on"};
var rtocBackDisplayPC = {"rtocBackDisplayPC":""};
var rtocOpenText = {"rtocOpenText":"OPEN"};
var rtocCloseText = {"rtocCloseText":"CLOSE"};
//# sourceURL=rtoc_js-js-extra
https://2p4c.tw/wp-content/plugins/rich-table-of-content/js/rtoc_common.js
https://2p4c.tw/wp-content/plugins/rich-table-of-content/js/rtoc_highlight.js
https://2p4c.tw/wp-content/plugins/genesis-blocks/dist/assets/js/dismiss.js
https://2p4c.tw/wp-content/plugins/breeze/assets/js/js-front-end/breeze-lazy-load.min.js
function breezeInitLazyLoad() {
window.lazyLoadInstance = new LazyLoad({
elements_selector: ".br-lazy",
data_src: "breeze",
data_srcset: "brsrcset",
data_sizes: "brsizes",
class_loaded: "br-loaded",
threshold: 300,
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", breezeInitLazyLoad);
} else {
breezeInitLazyLoad();
}
//# sourceURL=breeze-lazy-js-after
var csLocalize = {"siteSchemeMode":"light","siteSchemeToogle":""};
//# sourceURL=csco-scripts-js-extra
https://2p4c.tw/wp-content/themes/swyft/assets/js/scripts.js
window.addEventListener("DOMContentLoaded",(e=>{document.querySelectorAll('img[loading="lazy"]').forEach((e=>{e.getBoundingClientRect().top<=window.innerHeight&&(e.loading="eager")}))}));
const loadScriptsTimer=setTimeout(loadScripts,5*1000);const userInteractionEvents=["mouseover","keydown","touchstart","touchmove","wheel"];userInteractionEvents.forEach(function(event){window.addEventListener(event,triggerScriptLoader,{passive:!0})});function triggerScriptLoader(){loadScripts();clearTimeout(loadScriptsTimer);userInteractionEvents.forEach(function(event){window.removeEventListener(event,triggerScriptLoader,{passive:!0})})}function loadScripts(){document.querySelectorAll("script,iframe[data-type='lazy']").forEach(function(elem){elem.setAttribute("src",elem.getAttribute("data-src"))})}
document.addEventListener("DOMContentLoaded", function () {
const firstSlideImg = document.querySelector(
".cs-hero-type-1_item[data-swiper-slide-index='0'] img"
);if (firstSlideImg) {
firstSlideImg.loading = "eager"; // 讓它成為優先載入圖
firstSlideImg.decoding = "async";
firstSlideImg.removeAttribute("loading"); // 確保 lazy 被移除
}
});