$(function(){ var mainswiper = new Swiper('.swiper-container', { loop: true, speed:1000, slidesPerView: 1, centeredSlides: true, autoplay: { delay: 5000, disableOnInteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, /* navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', },*/ breakpoints: { 1500: { slidesPerView: 1 }, } }); var partnerswiper = new Swiper('.partner-container', { loop: true, speed:700, slidesPerView: 3, spaceBetween: 10, centeredSlides: true, on: { init: function(){ //$('.partner-container .swiper-wrapper > div').delay(1000).matchHeight(); }, }, autoplay: { delay: 5000, disableOnInteraction: false, }, /* pagination: { el: '.swiper-pagination', clickable: true, },*/ navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpoints: { 768: { spaceBetween: 0, }, 640: { slidesPerView: 2, spaceBetween: 0, }, } }); const mvslide = new Swiper(".topslide", { slidesPerView: 3, speed:700, loop: true, spaceBetween: 15, autoplay: { delay: 5000, disableOnInteraction: false, }, navigation: { nextEl: '.topslide_wrap .swiper-button-next', prevEl: '.topslide_wrap .swiper-button-prev', }, breakpoints: { 480: { slidesPerView: 1, }, 980: { slidesPerView: 2, }, } }); const mvtxtslide = new Swiper(".mvtxtslide", { slidesPerView: 1, speed:1000, loop: true, effect: 'fade', fadeEffect: { crossFade: true }, allowTouchMove:false, autoplay: { delay: 6000, disableOnInteraction: false, }, on: { slideChangeTransitionEnd: function () { $('.mvtxtslide .swiper-slide').removeClass('ready show'); setTimeout(() => { $('.mvtxtslide .swiper-slide-active').addClass('show'); $('.mvtxtslide .swiper-slide-duplicate-active').addClass('show'); }, 0); } } }); const mvnews = new Swiper(".mv_news", { slidesPerView: 1, speed:700, loop: true, autoplay: { delay: 8000, disableOnInteraction: false, }, }); $('#searchproducts #formbox span a.and').on('click',function(e){ e.preventDefault; $('#searchproducts #formbox span a').removeClass('onn'); $(this).addClass('onn'); $('#searchproducts #formbox input#andor').val('AND'); }); $('#searchproducts #formbox span a.or').on('click',function(e){ e.preventDefault; $('#searchproducts #formbox span a').removeClass('onn'); $(this).addClass('onn'); $('#searchproducts #formbox input#andor').val('OR'); }); }); $(window).on('load',function(){ $('.partner-container .swiper-wrapper > div a').matchHeight(); $('#searchproducts .catSearch #___gcse_1 .gsc-control-cse td input[type="text"] ').attr('placeholder','Enter keywords or products'); $('#searchproducts .catSearch #___gcse_1 .gsc-control-cse td button ').text('Search'); }); $(window).on('resize',function () { }); $(window).on('orientationchange', function(){ }); /**MVテキスト**/ /* document.addEventListener("DOMContentLoaded", () => { const lines = document.querySelectorAll("#mainimg .mvtxtslide .line"); lines.forEach(line => { const newContent = []; let delay = line.classList.contains("add_dl") ? 0.2 : 0; line.childNodes.forEach(node => { if (node.nodeType === Node.TEXT_NODE) { // テキストノード → 文字ごとに分割して node.textContent.split("").forEach(char => { if (char.trim() === "") return; // 空白(スペースや改行)は無視してOK const span = document.createElement("span"); span.textContent = char; span.style.transitionDelay = `${delay.toFixed(1)}s`; newContent.push(span); delay += 0.066; }); } else if (node.nodeType === Node.ELEMENT_NODE) { if (node.tagName === "BR") { // 改行タグ
はそのまま残す newContent.push(document.createElement("br")); } else { // 例: ... node.childNodes.forEach(child => { if (child.nodeType === Node.TEXT_NODE) { child.textContent.split("").forEach(char => { if (char.trim() === "") return; const span = document.createElement("span"); span.textContent = char; span.className = node.className; span.style.transitionDelay = `${delay.toFixed(1)}s`; newContent.push(span); delay += 0.066; }); } else if (child.nodeType === Node.ELEMENT_NODE && child.tagName === "BR") { newContent.push(document.createElement("br")); } }); } } }); line.innerHTML = ""; newContent.forEach(el => line.appendChild(el)); }); }); */ document.addEventListener("DOMContentLoaded", () => { const lines = document.querySelectorAll("#mainimg .mvtxtslide .line"); const pushCharSpan = (arr, char, delay, className = "") => { const span = document.createElement("span"); // 半角スペースは \u00A0 に置き換え(連続スペースやアニメ中の欠落を防ぐ) const out = (char === " ") ? "\u00A0" : char; span.textContent = out; if (className) span.className = className; span.style.transitionDelay = `${delay.toFixed(1)}s`; arr.push(span); }; lines.forEach(line => { const newContent = []; let delay = line.classList.contains("add_dl") ? 0.2 : 0; line.childNodes.forEach(node => { if (node.nodeType === Node.TEXT_NODE) { // 文字ごとに分割(絵文字などにも強い Array.from を使用) Array.from(node.textContent).forEach(char => { // 改行は text ノード内にほぼ来ない想定だが念のため if (char === "\n") { newContent.push(document.createElement("br")); return; } pushCharSpan(newContent, char, delay); delay += 0.066; }); } else if (node.nodeType === Node.ELEMENT_NODE) { if (node.tagName !== "BR") { //newContent.push(document.createElement("br")); //} else { // 例: ... node.childNodes.forEach(child => { if (child.nodeType === Node.TEXT_NODE) { Array.from(child.textContent).forEach(char => { if (char === "\n") { newContent.push(document.createElement("br")); return; } pushCharSpan(newContent, char, delay, node.className); delay += 0.066; }); //} else if (child.nodeType === Node.ELEMENT_NODE && child.tagName === "BR") { //newContent.push(document.createElement("br")); } }); } } }); line.innerHTML = ""; newContent.forEach(el => line.appendChild(el)); }); });