v26110447 踢腿音效改成偶尔随机响(2 成概率 + 至少隔 40 秒)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||
var VER = '26110446';
|
||||
var VER = '26110447';
|
||||
const $ = (s, c) => (c || document).querySelector(s);
|
||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||
|
||||
|
||||
@@ -154,8 +154,13 @@
|
||||
} catch (e) {}
|
||||
};
|
||||
['touchstart', 'touchend', 'pointerdown', 'click'].forEach(t => addEventListener(t, unlock, { passive: true, capture: true }));
|
||||
/* 11-05 用户:「不是每一次都出现,随机、偶尔出现一次就行」→ 每次踢只有 2 成概率响,且离上一声至少 40 秒(大约一两分钟才响一次) */
|
||||
let lastSnd = 0;
|
||||
function kickSound(delay) {
|
||||
if (!ac || ac.state !== 'running') return;
|
||||
const nowMs = Date.now();
|
||||
if (!DEBUG && (nowMs - lastSnd < 40000 || Math.random() > .2)) return;
|
||||
lastSnd = nowMs;
|
||||
try { if (localStorage.getItem('mb_kick_snd') === '0') return; } catch (e) {} // 「我的 → 隐私与权限 → 宝宝踢腿音效」关了就不响
|
||||
const t = ac.currentTime + delay / 1000, out = ac.createGain();
|
||||
out.gain.value = 0.9; out.connect(ac.destination);
|
||||
|
||||
@@ -244,5 +244,5 @@
|
||||
}
|
||||
/* feed.js 首页默认不加载(index.html 只引了 topics.js),这里按需拉一次 */
|
||||
if (window.GC_FEED) init();
|
||||
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110446'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
|
||||
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110447'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
|
||||
})();
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
(function () {
|
||||
var sec = document.getElementById('gcHome');
|
||||
if (!sec) return;
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110446';
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110447';
|
||||
document.head.appendChild(l);
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110446';
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110447';
|
||||
s.onload = function () { if (sec.querySelector('.g4-foot')) merge(); else sec.addEventListener('gc4-ready', merge, { once: true }); }; /* v4 要先拉 feed.js 才渲染 */
|
||||
document.body.appendChild(s);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
if (/[?&]kit=0(?:&|$)/.test(location.search)) return;
|
||||
var box = document.getElementById('kit'), sec = document.getElementById('kitHome');
|
||||
if (!box || !sec) return;
|
||||
var V = '26110446';
|
||||
var V = '26110447';
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/kit.css?v=' + V; document.head.appendChild(l);
|
||||
document.documentElement.classList.add('has-kit');
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
postMessage 不是实时投递,微信在分享那一刻才派发,所以每次换内容都要再报一次;子页面没引 jweixin,这里按需加载。 */
|
||||
(function (g) {
|
||||
'use strict';
|
||||
var V = '26110446';
|
||||
var V = '26110447';
|
||||
var isWx = /MicroMessenger/i.test(navigator.userAgent || '');
|
||||
var waiting = [], loading = false;
|
||||
function ready(cb) {
|
||||
|
||||
Reference in New Issue
Block a user