feat(widgets): simplify locations and paid sidebar
Remove deprecated widget locations and widgets, standardize sidebar labels, and render a compact paid-post purchase card in the article sidebar.
This commit is contained in:
1 parent
51d2ab3aa7
commit
bd7d3046a5
43 files changed
+294
-3581
No files matched your search
Vendored
-38
@@ -95,44 +95,6 @@
|
||||
setInterval(update, 1000);
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* 3. 合作伙伴无缝滚动 (marquee)
|
||||
* 用法:<div class="aksrt-marquee" data-speed="1">...内容...</div>
|
||||
* ============================================================ */
|
||||
function initMarquee() {
|
||||
document.querySelectorAll('.aksrt-marquee').forEach(function (el) {
|
||||
if (el.dataset.marqueeBound) return;
|
||||
el.dataset.marqueeBound = '1';
|
||||
|
||||
var speed = parseFloat(el.dataset.speed || '1');
|
||||
var inner = el.querySelector('.aksrt-marquee__inner') || el.children[0];
|
||||
if (!inner) return;
|
||||
|
||||
// 克隆内容实现无缝
|
||||
var clone = inner.cloneNode(true);
|
||||
el.appendChild(clone);
|
||||
|
||||
var pos = 0;
|
||||
var width = inner.scrollWidth;
|
||||
|
||||
function animate() {
|
||||
pos -= speed;
|
||||
if (Math.abs(pos) >= width) pos = 0;
|
||||
inner.style.transform = 'translateX(' + pos + 'px)';
|
||||
clone.style.transform = 'translateX(' + (pos + width) + 'px)';
|
||||
if (!reducedMotion) requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
if (!reducedMotion) {
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
// 暂停/恢复
|
||||
el.addEventListener('mouseenter', function () { el.dataset.paused = '1'; });
|
||||
el.addEventListener('mouseleave', function () { delete el.dataset.paused; });
|
||||
});
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* 4. 3D 悬停倾斜 (vanilla tilt)
|
||||
* 用法:<div data-aksrt-tilt data-tilt-max="15">...</div>
|
||||
|
||||
Reference in new issue
Block a user