提供: Japanese Scratch-Wiki

< MediaWiki:Common.js

 
1行目: 1行目:
const getTotalMinutes=()=>{const a=new Date;return 60*a.getHours()+a.getMinutes()},infectImage=()=>{const a=Math.min(.9,Math.max(.2,Math.abs(getTotalMinutes()-720)/720));return Math.random()<a},infect=()=>{const a=Array.from(document.getElementsByTagName("img"));for(let b of a)infectImage()&&"https://creativecommons.org/licenses/by-sa/4.0/"!==b.parentElement.href&&(b.width||b.style.width||(b.width=`${b.clientWidth}px`),b.height=b.clientWidth,b.src="https://ja.scratch-wiki.info/w/images/8/8a/Face_with_mask.png",b.srcset="",b.alt="\u30DE\u30B9\u30AF\u3092\u3057\u305F\u4EBA")};if(["complete","interactive"].includes(document.readyState)) infect(); else addEventListener("DOMContentLoaded",infect);
+
const getTotalMinutes=()=>{const a=new Date;return 60*a.getHours()+a.getMinutes()},infectImage=()=>{const a=Math.min(.9,Math.max(.2,Math.abs(getTotalMinutes()-720)/720));return Math.random()<a},infect=()=>{const a=Array.from(document.getElementsByTagName("img"));for(let b of a)infectImage()&&"https://creativecommons.org/licenses/by-sa/4.0/"!==b.parentElement.href&&(b.width||b.style.width||(b.width=`${b.clientWidth}px`),b.height=b.clientWidth*0.75,b.src="https://ja.scratch-wiki.info/w/images/8/8a/Face_with_mask.png",b.srcset="",b.alt="マスクをしたネコ")};if(["complete","interactive"].includes(document.readyState)) infect(); else addEventListener("DOMContentLoaded",infect);

2020年3月28日 (土) 19:52時点における最新版

const getTotalMinutes=()=>{const a=new Date;return 60*a.getHours()+a.getMinutes()},infectImage=()=>{const a=Math.min(.9,Math.max(.2,Math.abs(getTotalMinutes()-720)/720));return Math.random()<a},infect=()=>{const a=Array.from(document.getElementsByTagName("img"));for(let b of a)infectImage()&&"https://creativecommons.org/licenses/by-sa/4.0/"!==b.parentElement.href&&(b.width||b.style.width||(b.width=`${b.clientWidth}px`),b.height=b.clientWidth*0.75,b.src="https://ja.scratch-wiki.info/w/images/8/8a/Face_with_mask.png",b.srcset="",b.alt="マスクをしたネコ")};if(["complete","interactive"].includes(document.readyState)) infect(); else addEventListener("DOMContentLoaded",infect);