1// ã¢ã¼ãã«ãéã颿° 2 function openModal(modalId) { 3 const modal = document.getElementById(modalId); 4 if (modal) { 5 modal.classList.add('active'); 6 document.body.style.overflow = 'hidden'; 7 8 // ãã©ã¼ã«ã¹ãã¢ã¼ãã«å ã«ç§»å 9 const closeButton = modal.querySelector('.close-btn'); 10 if (closeButton) { 11 closeButton.focus(); 12 } 13 } 14 } 15 16 // ã¢ã¼ãã«ãéãã颿° 17 function closeModal(modal) { 18 modal.classList.remove('active'); 19 document.body.style.overflow = 'auto'; 20 } 21 22 // ãã°ã«ã¹ã¤ããã®åãæ¿ã 23 function toggleSetting(toggle) { 24 toggle.classList.toggle('active'); 25 } 26 27 // DOMãèªã¿è¾¼ã¾ããå¾ã«å®è¡ 28 document.addEventListener('DOMContentLoaded', function() { 29 // ã¢ã¼ãã«ãéããªã³ã¯ã®ã¤ãã³ããªã¹ãã¼ 30 document.querySelectorAll('.modal-link').forEach(link => { 31 link.addEventListener('click', function(event) { 32 event.preventDefault(); 33 const modalId = this.getAttribute('data-modal'); 34 openModal(modalId); 35 }); 36 37 // ãã¼ãã¼ãã¤ãã³ã 38 link.addEventListener('keydown', function(event) { 39 if (event.key === 'Enter' || event.key === ' ') { 40 event.preventDefault(); 41 const modalId = this.getAttribute('data-modal'); 42 openModal(modalId); 43 } 44 }); 45 }); 46 47 // éãããã¿ã³ã®ã¤ãã³ããªã¹ãã¼ 48 document.querySelectorAll('.close-btn, .close-modal').forEach(button => { 49 button.addEventListener('click', function() { 50 const modal = this.closest('.modal-overlay'); 51 closeModal(modal); 52 }); 53 }); 54 55 // èæ¯ã¯ãªãã¯ã§ã¢ã¼ãã«ãéãã 56 document.querySelectorAll('.modal-overlay').forEach(overlay => { 57 overlay.addEventListener('click', function(event) { 58 if (event.target === this) { 59 closeModal(this); 60 } 61 }); 62 }); 63 64 // ãã°ã«ã¹ã¤ããã®ã¤ãã³ããªã¹ãã¼ 65 document.querySelectorAll('.toggle').forEach(toggle => { 66 toggle.addEventListener('click', function() { 67 toggleSetting(this); 68 }); 69 }); 70 71 // ESCãã¼ã§ã¢ã¯ãã£ããªã¢ã¼ãã«ãéãã 72 document.addEventListener('keydown', function(event) { 73 if (event.key === 'Escape') { 74 const activeModal = document.querySelector('.modal-overlay.active'); 75 if (activeModal) { 76 closeModal(activeModal); 77 } 78 } 79 }); 80 });
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.