1// preloader.js 2 3// DOMContentLoadedã¤ãã³ãã§ããªãã¼ãã¼ã使ãã¦bodyã«è¿½å ãã 4document.addEventListener('DOMContentLoaded', function() { 5 var preloader = document.createElement('div'); 6 preloader.id = 'preloader'; 7 preloader.style.backgroundColor = "#000"; // ããªãã¼ãã¼ã®èæ¯è² 8 preloader.style.position = "fixed"; 9 preloader.style.top = "0"; 10 preloader.style.left = "0"; 11 preloader.style.width = "100%"; 12 preloader.style.height = "100%"; 13 preloader.style.zIndex = "9999"; 14 preloader.style.display = "flex"; 15 preloader.style.justifyContent = "center"; 16 preloader.style.alignItems = "center"; 17 18 document.body.appendChild(preloader); 19 20 var body = document.body; 21 22 // ãã§ã¼ãã¤ã³ã®ããã«æåã«bodyã®opacityã0ã«è¨å® 23 body.style.opacity = '0'; 24 body.style.transition = 'opacity 1s ease'; // ãã§ã¼ãã¤ã³ã®ãã©ã³ã¸ã·ã§ã³ 25 26 // ãªã½ã¼ã¹ãå®å ¨ã«èªã¿è¾¼ã¾ããå¾ã«ããªãã¼ãã¼ãé表示ã«ããbodyããã§ã¼ãã¤ã³ 27 window.addEventListener('load', function() { 28 if (preloader) { 29 preloader.style.display = 'none'; 30 } 31 if (body) { 32 body.style.opacity = '1'; // body å ¨ä½ã®ãã§ã¼ãã¤ã³å¹æãçºå 33 } 34 }); 35 36 // ãã§ã¼ã«ã»ã¼ãã¨ãã¦ã3ç§å¾ã«å¼·å¶çã«ããªãã¼ãã¼ãé表示ã«ããbodyããã§ã¼ãã¤ã³ 37 setTimeout(function() { 38 if (preloader && preloader.style.display !== 'none') { 39 preloader.style.display = 'none'; 40 body.style.opacity = '1'; // body å ¨ä½ã®ãã§ã¼ãã¤ã³å¹æãçºå 41 } 42 }, 3000); // 3000msï¼3ç§å¾ï¼ 43});
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.