1/* =========================================== */ 2// ããã¹ãç¡éã¢ãã¡ã¼ã·ã§ã³ï¼é度調æ´å¯è½ï¼è¤æ°å¯¾å¿ï¼ 3jQuery(document).ready(function () { 4 const tickers = document.querySelectorAll(".js-tick"); 5 6 if (!tickers.length) { 7 // éçºç°å¢ã§ã®ã¿è¦åã表示 8 const isDevelopment = location.hostname === "localhost" || location.hostname === "127.0.0.1" || location.hostname === ""; 9 if (isDevelopment) { 10 console.warn("Required ticker elements not found"); 11 } 12 return; 13 } 14 15 // åãã£ãã«ã¼è¦ç´ ã«å¯¾ãã¦ã¢ãã¡ã¼ã·ã§ã³ãåæå 16 tickers.forEach((ticker) => { 17 const tickerItems = ticker.querySelectorAll(".js-tick-item"); 18 19 if (!tickerItems.length) { 20 console.warn("No ticker items found in ticker element"); 21 return; 22 } 23 24 // æåã®ã¢ã¤ãã ã®å¹ ãåå¾ 25 const itemWidth = tickerItems[0].offsetWidth; 26 27 // ã¹ã¯ãã¼ã«é度ï¼px/ç§ï¼ 28 const speed = 50; 29 30 let position = 0; 31 let lastTime = performance.now(); 32 33 function animate(currentTime) { 34 const deltaTime = (currentTime - lastTime) / 1000; 35 lastTime = currentTime; 36 37 // ä½ç½®ãæ´æ° 38 position -= speed * deltaTime; 39 40 // 1ã¤ç®ã®ã¢ã¤ãã ãå®å ¨ã«å·¦ã«æ¶ããããªã»ãã 41 if (Math.abs(position) >= itemWidth) { 42 position += itemWidth; 43 } 44 45 // transformãé©ç¨ 46 ticker.style.transform = `translateX(${position}px)`; 47 48 requestAnimationFrame(animate); 49 } 50 51 // ã¢ãã¡ã¼ã·ã§ã³éå§ 52 requestAnimationFrame(animate); 53 }); 54}); 55 56/* =========================================== */ 57// animate.css ã¢ãã¡ã¼ã·ã§ã³ 58jQuery(document).ready(function () { 59 // animate.cssä½¿ç¨ 60 // è¦ç´ ãç»é¢ã«å ¥ã£ããå®è¡ 61 const animateClass = ".animate__animated"; 62 const elements = document.querySelectorAll(animateClass); 63 64 // è¦ç´ ãåå¨ããªãå ´åã¯å¦çã䏿 65 if (!elements.length) { 66 // éçºç°å¢ã§ã®ã¿è¦åã表示 67 const isDevelopment = location.hostname === "localhost" || location.hostname === "127.0.0.1" || location.hostname === ""; 68 if (isDevelopment) { 69 console.warn("No animate__animated elements found"); 70 } 71 return; 72 } 73 74 // IntersectionObserverã®ãªãã·ã§ã³ 75 const observerOptions = { 76 root: null, 77 rootMargin: "0px", 78 threshold: 0.1, // è¦ç´ ã®10%ãè¦ãããçºç« 79 }; 80 81 const handleIntersection = (entries, observer) => { 82 entries.forEach((entry) => { 83 if (entry.isIntersecting) { 84 const target = entry.target; 85 86 // ä¿åãã¦ãããã¢ãã¡ã¼ã·ã§ã³ã¯ã©ã¹ã追å 87 const animationClasses = target.dataset.animationClasses; 88 if (animationClasses) { 89 const classes = animationClasses.split(" "); 90 classes.forEach((className) => { 91 target.classList.add(className); 92 }); 93 } 94 95 // ä¸åº¦ã ãå®è¡ããå ´åã¯ãç£è¦ãè§£é¤ 96 observer.unobserve(target); 97 } 98 }); 99 }; 100 101 const observer = new IntersectionObserver(handleIntersection, observerOptions); 102 103 // åè¦ç´ ãç£è¦å¯¾è±¡ã«è¿½å 104 elements.forEach((element) => { 105 // æ¢åã®ã¢ãã¡ã¼ã·ã§ã³ã¯ã©ã¹ï¼animate__xxxï¼ãåå¾ãã¦ä¿å 106 const animationClasses = Array.from(element.classList).filter( 107 (className) => className.startsWith("animate__") && className !== "animate__animated", 108 ); 109 110 if (animationClasses.length > 0) { 111 // ã¢ãã¡ã¼ã·ã§ã³ã¯ã©ã¹ãdata屿§ã«ä¿å 112 element.dataset.animationClasses = animationClasses.join(" "); 113 114 // ã¢ãã¡ã¼ã·ã§ã³ã¯ã©ã¹ã䏿çã«åé¤ï¼animate__animatedã¯æ®ãï¼ 115 animationClasses.forEach((className) => { 116 element.classList.remove(className); 117 }); 118 } 119 120 // åæç¶æ ãé表示ã«è¨å® 121 element.style.opacity = "0"; 122 123 // ç£è¦éå§ 124 observer.observe(element); 125 }); 126});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.