// const requestInterval = (fn, delay) => { // let start = new Date().getTime(); // let handle = { // value: 0 // }; // let loop = () => { // handle.value = requestAnimationFrame(loop); // let current = new Date().getTime(); // let delta = current - start; // if (delta >= delay) { // fn(); // start = new Date().getTime(); // } // }; // handle.value = requestAnimationFrame(loop); // return handle; // }; // const renderIdFont=(idName)=>{ // //random // const sample = (arr) => arr[Math.floor(Math.random() * arr.length)]; // const bubbleSizes = [3, 6, 9, 12]; // //render // let bubbleText = document.getElementById(idName); // if(!bubbleText){ // return 0 // } // let bubblePositions = Array.from( // Array(bubbleText.offsetWidth).keys() // ); // setTimeout(() => { // let bubbleSize = sample(bubbleSizes); // let bubblePosition = sample(bubblePositions); // let bubble = document.createElement("div"); // bubble.className = "bubble"; // bubble.style.width = `${bubbleSize}px`; // bubble.style.height = `${bubbleSize}px`; // bubble.style.left = `${bubblePosition}px`; // bubbleText.append(bubble); // let bubbleAnimation = bubble.animate( // [{ // bottom: "10px", // opacity: 1 // }, { // bottom: "180%", // opacity: 0.6 // }], { // fill: "forwards", // duration: 3000 // } // ); // bubbleAnimation.onfinish = () => bubble.remove(); // }, 500); // } // const init = () => { // let idArray=['bubblingId1','bubblingId2','bottomWordId3'] // for(let i=0,length=idArray.length;i{ // const baseUrl='https://yongma16.xyz/api/' // const path='get-word/' // // const headers = {'Content-Type':'application/json;charset=UTF-8'} // wx.request({ // url: baseUrl+path, // success: (res) => { // let data=res.data // let word=data.data // writeWord(word) // } // }); // },100) // getWord() // } // const getWord=()=>{ // setTimeout(()=>{ // const baseUrl='https://yongma16.xyz/api/' // const path='get-word/' // // const headers = {'Content-Type':'application/json;charset=UTF-8'} // wx.request({ // url: baseUrl+path, // success: (res) => { // let data=res.data // let word=data.data // writeWord(word) // } // }); // return getWord() // },8000) // } // // 打字机效果 // const writeWord=(word)=>{ // document.getElementById('bubblingId2').innerText=word // } // const getTime=()=>{ // let start=new Date('2022-02-20') // let now=new Date() // let diff=now.valueOf()-start.valueOf();// // let onDay=24*60*60*1000; // let day=Math.ceil(diff/onDay);//天数 // document.getElementById('dayCalFontId').innerText=`在一起:${day}天` // }