1//æ»å¨å¯¼èªæ 置顶 2$(window).scroll(function () { 3 var menu_top = $('#menu_wrap').offset().top; 4 if ($(window).scrollTop() >= menu_top) { 5 $('.menu').addClass('menuFixed') 6 closeNav(); 7 } else { 8 $('.menu').removeClass('menuFixed') 9 } 10 var demo = document.getElementsByClassName("tishi"); 11 12 if (check()) { 13 demo[0].innerText = "æå¼å¾®ä¿¡âæ«ä¸æ«âï¼æå¼ç½é¡µåç¹å»å±å¹å³ä¸è§å享æé®"; 14 } else { 15 demo[0].innerText = "å¤å¶æ¤é¾æ¥åé微信好åã"; 16 } 17}); 18 19function closeNav() { 20 $('#menu_wrap > div > nav > div > div.navbar-header > button').addClass('collapsed'); 21 $('#bs-example-navbar-collapse-1').removeClass('in'); 22} 23//è·åå½åæ¯å¦ä¸ºç§»å¨ç«¯ 24function check() { 25 var userAgentInfo = navigator.userAgent; 26 var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPod"); 27 var flag = true; 28 for (var v = 0; v < Agents.length; v++) { 29 if (userAgentInfo.indexOf(Agents[v]) > 0) { 30 flag = false; 31 break; 32 } 33 } 34 return flag; 35} 36$('#menu_wrap > div > nav').on('click', function (e) { 37 time = e.timeStamp; 38}) 39var time = 0; 40document.body.addEventListener('click', function (e) { 41 if ($("audio").length > 0) { 42 var audioObj = document.getElementById('bgAudioVolume'); 43 if (audioObj.paused) { 44 if (e.timeStamp - time < 300) return 45 else closeNav(); 46 } else { 47 return; 48 } 49 } 50}) 51 52 53// 鳿³¢å¾è®¾ç½® 54document.onreadystatechange = function () { 55 if ($("audio").length > 0) { 56 if (check()) { 57 backgroundAudio = document.getElementById("bgAudioVolume"); 58 backgroundAudio.volume = 0.5; 59 } else { 60 backgroundAudio = document.getElementById("bgAudioVolume"); 61 backgroundAudio.volume = 0.1; 62 } 63 } 64} 65// 鳿³¢å¾è®¾ç½® 66window.addEventListener('click', function () { 67 if ($("audio").length > 0) { 68 stop(); 69 } 70}) 71 72function updata() { 73 // document.getElementById("openaudio").click(); 74 if ($("audio").length > 0) { 75 stop(); 76 } 77} 78 79function stop() { 80 (function () { 81 let NBR_OF_BARS; 82 if (check()) { 83 NBR_OF_BARS = 50; 84 } else { 85 NBR_OF_BARS = 35; 86 } 87 88 // è·åé³é¢å ç´ æ ç¾ 89 const audio = document.querySelector("#bgAudioVolume"); 90 91 // å建é³é¢ç¯å¢ 92 const ctx = new(window.AudioContext || window.webkitAudioContext)(); 93 94 // å建é³é¢æº 95 const audioSource = ctx.createMediaElementSource(audio); 96 97 // å建é³é¢åæå¨ 98 const analayzer = ctx.createAnalyser(); 99 100 // å°æºè¿æ¥å°åæå¨ï¼ç¶åè¿åä¸ä¸æçç®æ 101 audioSource.connect(analayzer); 102 audioSource.connect(ctx.destination); 103 104 // æå°åæé¢ç 105 const frequencyData = new Uint8Array(analayzer.frequencyBinCount); 106 analayzer.getByteFrequencyData(frequencyData); 107 console.log("frequencyData", frequencyData); 108 109 // è·åå¯è§åå·¥å ·å®¹å¨ 110 const visualizerContainer = document.querySelector(".visualizer-container"); 111 112 // å建ä¸ç»é¢å®ä¹çæ 113 for (let i = 0; i < NBR_OF_BARS; i++) { 114 115 const bar = document.createElement("DIV"); 116 bar.setAttribute("id", "bar" + i); 117 bar.setAttribute("class", "visualizer-container__bar"); 118 visualizerContainer.appendChild(bar); 119 120 } 121 // 该åè½å ·ææ ¹æ®é¢çæ°æ®è°æ´æ¡å½¢é«åº¦çåè½ 122 function renderFrame() { 123 124 // ç¨ææ°çé¢çæ°æ®æ´æ°æä»¬çé¢çæ°æ®éµå 125 analayzer.getByteFrequencyData(frequencyData); 126 127 for (let i = 0; i < NBR_OF_BARS; i++) { 128 // å 为é¢çæ°æ®æ°ç»çé¿åº¦æ¯1024ï¼æä»¥æä»¬ä¸æ³è¿è¡è¯»å 129 //第ä¸ä¸ªNBR_OF_BARSå¼ï¼ä½å°è¯æåæ´ä¸ªé¢è°±çé¢ç 130 const index = (i + 10) * 2; 131 // Fdæ¯0å°255ä¹é´çé¢çå¼ 132 const fd = frequencyData[index]; 133 // è·åbar DIVå ç´ 134 const bar = document.querySelector("#bar" + i); 135 if (!bar) { 136 continue; 137 } 138 // 妿fdæªå®ä¹ï¼é»è®¤ä¸º0ï¼åç¡®ä¿fdè³å°ä¸º4 139 //è¿å°ä½¿ä¸ä¸ªå®éçé¢çè³å°4pxé«çè§è§ææ 140 const barHeight = Math.max(4, fd || 0); 141 // if (i <=10 || i >= 70) { 142 // bar.style.height = 4 + "px"; 143 // bar.style.marginTop = "-" + 4 / 2 + "px"; 144 // continue; 145 // } 146 bar.style.height = barHeight + "px"; 147 bar.style.marginTop = "-" + barHeight / 2 + "px"; 148 } 149 150 // å¨ä¸ä¸ä¸ªå¨ç»å¸§ï¼è°ç¨æä»¬èªå·± 151 window.requestAnimationFrame(renderFrame); 152 153 } 154 155 renderFrame(); 156 157 audio.play(); 158 159 })(); 160} 161var sharetitle = encodeURIComponent(window.location.href); // è·åå½å页é¢URLå¹¶è¿è¡ç¼ç 162var shareUrl = encodeURIComponent(document.title); // è·åå½å页颿 é¢å¹¶è¿è¡ç¼ç 163 164function fenxinagweibo() { 165 // share(); 166 // åäº«çæ é¢ 167 // title = encodeURIComponent(title || document.title);
168 // // å享å 容龿¥ 169 // url = encodeURIComponent(url || window.location.href); 170 // // å享å¾ççè·¯å¾ï¼å¤å¼ å¾ç以ï¼|ï¼éå¼ï¼å¯éåæ° 171 // picurl = encodeURIComponent(picurl || ''); 172 var sharesinastring = 173 'https://service.weibo.com/share/share.php?title=' + sharetitle + 174 '&url=' + shareUrl + 175 '&content=utf-8&sourceUrl=' + shareUrl; 176 // 卿°çªå£ä¸æå¼ 177 window.open(sharesinastring, "newwin", "toolbar=no,scrollbars=yes,menubar=no,height=100,width=400"); 178} 179 180
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.