function showClock() { let nowTime = new Date(); let nowYear = nowTime.getFullYear(); let nowMonth = nowTime.getMonth()+1; let nowDay = nowTime.getDate(); let weekday = ['日', '月', '火', '水', '木', '金', '土']; let nowWday = weekday[nowTime.getDay()]; let nowHour = nowTime.getHours(); let nowMin = ('0' + nowTime.getMinutes()).slice(-2); let nowSec = ('0' + nowTime.getSeconds()).slice(-2); let msg = nowYear + "年" + nowMonth + "月" + nowDay + "日(" + nowWday + ")" + nowHour + ":" + nowMin; document.getElementById("realtime").innerHTML = msg; } setInterval('showClock()',1000); var pass = 168; var content = 'NEW'; var currentDate = new Date(); $(function(){ $('.newmark').each(function(){ time = $(this).text().split(":"); var entryDate = new Date(time[0], time[1]-1, time[2], time[3], time[4], time[5]); var now = (entryDate.getTime() - currentDate.getTime())/(60*60*1000); now = Math.ceil(now); if(-now <= pass){ $(this).html(content).css('display', 'inline'); } }); }); const body_element = document.querySelector('html body'); const modal_div = document.createElement("div"); let modal_window = document.body.appendChild(modal_div); let modal_html = '
'; modal_window.innerHTML = modal_html; Array.from(document.querySelectorAll('[data-modal*="bs-lightbox"]')).forEach((href) => { href.setAttribute('data-bs-toggle','modal'); href.setAttribute('data-bs-target','#lightboxModalFullscreen'); href.addEventListener('click', (e)=>{ const target_href = href.getAttribute('href'); const target_caption = href.getAttribute('title'); document.getElementById('LightboxCanvas').src = target_href; document.getElementById('LightboxCaption').textContent = target_caption; e.preventDefault(); // console.log(target_href); }) }); const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) // pagetop button appear or disappear const pagetop_btn = document.querySelector(".pagetop"); window.addEventListener("scroll", scroll_event); function scroll_event() { if (window.pageYOffset > 600) { pagetop_btn.style.opacity = "1"; } else if (window.pageYOffset < 100) { pagetop_btn.style.opacity = "0"; } }