Files
mama-box/topic/_shared/brand.js

17 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* 11-02 用户:专题页底部加品牌落款「兜爸心选 · 孕育知识整理」(页面会被单独转发,低调署名)。
共用模板 article.js 已内置;自带页面(huafei / wen / buji / zhichang / yingyang)各引一次本文件。
放在最后一个 .foot 后面;没有 .foot 的页面必须写 data-after。 */
(function () {
if (document.querySelector('.tp-brand')) return;
var st = document.createElement('style');
st.textContent = '.tp-brand{display:flex;align-items:center;justify-content:center;gap:6px;margin:14px auto 22px;font-size:11.5px;color:#C29A8F;letter-spacing:.06em}' +
'.tp-brand img{width:58px;height:auto;opacity:.6}.tp-brand i{width:1px;height:10px;background:#E5CFC8}';
document.head.appendChild(st);
var h = '<div class="tp-brand"><img src="../../assets/img/brand-logo-c.png" alt="兜爸心选"><i></i><span>孕育知识整理</span></div>';
/* 页面结构特殊的(如 huafei 分好几屏)用 <script data-after="选择器"> 指定放在哪些元素后面 */
var cs = document.currentScript, after = cs && cs.getAttribute('data-after');
if (after) { [].forEach.call(document.querySelectorAll(after), function (el) { el.insertAdjacentHTML('afterend', h); }); return; }
var f = document.querySelectorAll('.foot'), last = f[f.length - 1];
if (last) last.insertAdjacentHTML('afterend', h);
})();