PageSourceSearch

https://www.lindapatent.com/templets/linda/style/Web_columns_tmt.js

js lindapatent.com collected 2026-10-03 21:07:46 UTC 5,908 bytes, 180 lines download raw bytes

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.