有觉性 以安住且中立的心 照见身心的实相

MediaWiki:Common.css:修订间差异

来自Dhamma.cn
法藏​(留言 | 贡献)
小无编辑摘要
标签:已被回退
法藏​(留言 | 贡献)
小无编辑摘要
标签:已被回退
第338行: 第338行:
     display: none !important;
     display: none !important;
}
}




第343行: 第344行:


/* =========================================================
/* =========================================================
   Dhamma.cn 划词复制 - 原生 JS 无依赖终极稳定版
   Dhamma.cn
  法谈划词引用
  仅保留一个按钮:
  “复制该段开示及出处”
   ========================================================= */
   ========================================================= */
(function () {
    function initDhammaCopy() {
        if (document.getElementById('dhamma-copy-popover')) return;


        // 1. 创建浮窗 DOM 节点
        var popover = document.createElement('div');
        popover.id = 'dhamma-copy-popover';
        popover.style.cssText = 'display:none; position:absolute; z-index:999999; background:#ffffff; border:1px solid rgba(0,0,0,0.15); border-radius:8px; box-shadow:0 4px 18px rgba(0,0,0,0.2); padding:6px; font-size:13px; line-height:1.4; white-space:nowrap;';
       
        var btn = document.createElement('button');
        btn.id = 'dhamma-copy-btn';
        btn.innerHTML = '📋 复制该段开示(带出处)';
        btn.style.cssText = 'background:#4d6b57; color:#ffffff; border:none; border-radius:5px; padding:6px 14px; font-size:13px; cursor:pointer; font-weight:600; display:block;';


         popover.appendChild(btn);
/* ---------------------------------------------------------
         document.body.appendChild(popover);
  Popup
  --------------------------------------------------------- */
 
#dhamma-quote-popup {
 
    position: absolute;
 
    display: none;
 
    z-index: 2147483647;
 
    box-sizing: border-box;
 
    padding: 5px;
 
    border-radius: 9px;
 
    background:
         rgba(255, 255, 255, 0.98);
 
    color:
        #29332c;
 
    border:
        1px solid
        rgba(77, 107, 87, 0.16);
 
    box-shadow:
        0 7px 24px
         rgba(0, 0, 0, 0.18);
 
    backdrop-filter:
        blur(12px);
 
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans SC",
        "Microsoft YaHei",
        Arial,
        sans-serif;
 
    animation:
        dhammaQuoteFadeIn
        0.15s ease;
}
 
 
/* ---------------------------------------------------------
  动画
  --------------------------------------------------------- */
 
@keyframes dhammaQuoteFadeIn {
 
    from {
 
        opacity: 0;
 
        transform:
            translateY(4px);
    }
 
 
    to {
 
        opacity: 1;
 
        transform:
            translateY(0);
    }
 
}
 
 
/* ---------------------------------------------------------
  唯一按钮
  --------------------------------------------------------- */
 
.dhamma-quote-button {
 
    appearance: none;
 
    border: none;
 
    margin: 0;
 
    padding:
        8px 15px;
 
    border-radius:
        7px;
 
    background:
        #4d6b57;
 
    color:
        #ffffff;
 
    cursor:
        pointer;
 
    font-size:
        13px;
 
    line-height:
        1.3;
 
    white-space:
        nowrap;


         var currentText = '';
    font-weight:
         500;


         // 2. 提取 UrlShortener 扩展短网址
    transition:
         function getShortUrl() {
         background
            var shortlinkEl = document.querySelector('link[rel="shortlink"]');
         0.15s ease,
            if (shortlinkEl && shortlinkEl.getAttribute('href')) {
        transform
                var href = shortlinkEl.getAttribute('href');
        0.1s ease;
                return href.indexOf('http') === 0 ? href : window.location.origin + href;
}
            }
            if (typeof mw !== 'undefined' && mw.config && mw.config.get('wgShortUrl')) {
                var shortUrl = mw.config.get('wgShortUrl');
                return shortUrl.indexOf('http') === 0 ? shortUrl : window.location.origin + shortUrl;
            }
            return window.location.href.split('#')[0].split('?')[0];
        }


        // 3. 监听划词事件
        document.addEventListener('mouseup', handleSelection);
        document.addEventListener('touchend', handleSelection);


        function handleSelection(e) {
.dhamma-quote-button:hover {
            if (popover.contains(e.target)) return;


            setTimeout(function () {
    background:
                var sel = window.getSelection();
        #405a49;
                var text = sel ? sel.toString().trim() : '';
}


                if (!text || text.length < 2) {
                    popover.style.display = 'none';
                    return;
                }


                currentText = text;
.dhamma-quote-button:active {


                if (sel.rangeCount > 0) {
    transform:
                    var range = sel.getRangeAt(0);
        scale(0.97);
                    var rect = range.getBoundingClientRect();
}


                    if (rect.width === 0 && rect.height === 0) {
                        popover.style.display = 'none';
                        return;
                    }


                    var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
/* ---------------------------------------------------------
                    var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
  夜间模式
  --------------------------------------------------------- */


                    var popWidth = popover.offsetWidth || 190;
body.reader-theme-dark
                    var popHeight = popover.offsetHeight || 38;
#dhamma-quote-popup {


                    var top = rect.top + scrollTop - popHeight - 10;
    background:
                    var left = rect.left + scrollLeft + (rect.width / 2) - (popWidth / 2);
        rgba(43, 44, 47, 0.98);


                    if (left < 10) left = 10;
    color:
                    if (top < scrollTop + 10) {
        #eeeeee;
                        top = rect.bottom + scrollTop + 10;
                    }


                    popover.style.top = top + 'px';
    border-color:
                    popover.style.left = left + 'px';
        rgba(255, 255, 255, 0.12);
                    popover.style.display = 'block';
                }
            }, 30);
        }


         // 4. 点击空白区域关闭浮窗
    box-shadow:
         document.addEventListener('mousedown', function (e) {
         0 9px 28px
            if (!popover.contains(e.target)) {
         rgba(0, 0, 0, 0.45);
                popover.style.display = 'none';
}
            }
        });


        // 5. 点击复制执行写入剪贴板
        btn.addEventListener('click', function (e) {
            e.stopPropagation();
            e.preventDefault();


            if (!currentText) return;
body.reader-theme-dark
.dhamma-quote-button {


            var title = (typeof mw !== 'undefined' && mw.config && mw.config.get('wgTitle')) || document.title;
    background:
            var site = (typeof mw !== 'undefined' && mw.config && mw.config.get('wgSiteName')) || 'Dhamma.cn';
        #607b68;
            var url = getShortUrl();


            var output =
    color:
                '“' + currentText + '”\n\n' +
        #ffffff;
                '----------------------------------------\n' +
}
                '法谈摘自:' + site + ' 《' + title + '》\n' +
                '该篇网址:' + url + '\n' +
                '转载请保持原文,随喜分享,Sadhu!';


            if (navigator.clipboard && navigator.clipboard.writeText) {
                navigator.clipboard.writeText(output).then(function () {
                    showSuccess();
                }).catch(function () {
                    fallbackCopyText(output);
                });
            } else {
                fallbackCopyText(output);
            }
        });


        function showSuccess() {
body.reader-theme-dark
            btn.innerHTML = '✅ 已复制开示及出处';
.dhamma-quote-button:hover {
            btn.style.background = '#2e7d32';
            setTimeout(function () {
                btn.innerHTML = '📋 复制该段开示(带出处)';
                btn.style.background = '#4d6b57';
                popover.style.display = 'none';
            }, 1200);
        }


         function fallbackCopyText(text) {
    background:
            var textarea = document.createElement('textarea');
         #6f8976;
            textarea.value = text;
}
            textarea.style.position = 'fixed';
 
            textarea.style.opacity = '0';
 
             document.body.appendChild(textarea);
/* ---------------------------------------------------------
            textarea.select();
  手机
            document.execCommand('copy');
  --------------------------------------------------------- */
             document.body.removeChild(textarea);
 
            showSuccess();
@media (max-width: 600px) {
        }
 
    #dhamma-quote-popup {
 
        max-width:
             calc(100vw - 20px);
 
        padding:
             5px;
     }
     }


     if (document.readyState === 'loading') {
 
         document.addEventListener('DOMContentLoaded', initDhammaCopy);
     .dhamma-quote-button {
    } else {
 
         initDhammaCopy();
         padding:
            9px 13px;
 
         font-size:
            12px;
     }
     }
})();
 
}

2026年9月19日 (六) 22:20的版本

/* 这里放置的CSS将应用于所有皮肤 */

/* 1. 隐藏非登录用户的工具箱特定项目 */
body:not(.user-logged-in) #t-whatlinkshere,  /* 链入页面 */
body:not(.user-logged-in) #t-recentchangeslinked,  /* 相关更改 */
body:not(.user-logged-in) #t-permalink,  /* 固定链接 */
body:not(.user-logged-in) #t-info,  /* 页面信息 */
body:not(.user-logged-in) #t-log {  /* 页面日志 */
    display: none !important;
}

/* 2. 隐藏页面操作按钮 */
body.page-Main_Page li#ca-talk { display: none !important; }
#ca-talk { display: none !important; }
#ca-viewsource { display: none !important; }
#ca-view { display: none !important; }
#ca-delete { display: none !important; }
#ca-history { display: none !important; }
#ca-nstab-main { display: none !important; }
/* #ca-watch { display: none !important; } */
/* li#ca-edit { display: none; } */

/* 3. 去除"关于此IP地址的讨论"按钮 */
#p-personal #pt-anonuserpage {
    display: none;
}

/* 4. 基础排版与分类隐藏 */
.catlinks { display: none; }

body {
    font-size: 16px;
    line-height: 1.6em;
}

/* ===================================================
   5. 视频容器与遮罩配置
   =================================================== */
.embedvideo,
.embedvideo-container,
.mediaContainer,
.thumbinner {
    width: 100% !important;
    max-width: 800px !important;
    margin: 15px auto !important;
    float: none !important;
}

.embedvideo video,
.mediaContainer video,
.thumbinner video,
video.mw-file-element,
video {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

.embedvideo-overlay,
.embedvideo-consent-overlay,
.embedvideo-header,
.embedvideo-title,
.embedvideo-service {
    display: none !important;
}

/* ===================================================
   6. 页脚 Footer 样式调整
   =================================================== */
#mw-footer, 
#footer, 
.mw-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 20px 0 24px 0 !important;
    box-sizing: border-box !important;
    border-top: none !important;
    border-bottom: none !important;
}

#mw-footer *, #footer *, .mw-footer * {
    float: none !important;
    grid-column: auto !important;
}

#mw-footer #p-footertext,
#mw-footer #p-places,
#mw-footer #p-footer-icons,
#mw-footer .mw-footer-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

#footer-info-lastmod,
.footer-info-lastmod,
li#footer-info-lastmod,
[id*="lastmod"],
.mw-footer-lastmod {
    display: none !important;
}

#footer-info, 
#p-footertext {
    order: 1 !important;
    font-size: 0.85em !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 2px !important;
    margin: 0 0 3px 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

#footer-info *, #p-footertext *, #footer-places * {
    font-size: inherit !important;
    line-height: 1.25 !important;
}

#footer-info-viewcount {
    order: 1 !important;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    display: block !important;
    text-align: center !important;
}

#footer-info-copyright {
    order: 2 !important;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.8) !important;
    display: block !important;
    text-align: center !important;
}

#footer-places, 
#p-places, 
#f-list {
    order: 2 !important;
    font-size: 0.85em !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 3px auto !important;
    list-style: none !important;
    gap: 16px !important;
}

#footer-places ul, #p-places ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

#footer-places li, #p-places li {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

#footer-places a, #p-places a {
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none !important;
}

#footer-icons, 
#p-footer-icons, 
#f-poweredbyico, 
.footer-icons {
    order: 3 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 35px !important;
    margin: 3px auto 0 auto !important;
    padding-top: 16px !important;
    position: relative !important;
    list-style: none !important;
    width: 100% !important;
}

#p-footer-icons ul, #footer-icons ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 35px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

#footer-icons::before, 
#p-footer-icons::before, 
#f-poweredbyico::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 200px !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
}

#footer-icons li, #footer-icons a,
#p-footer-icons li, #p-footer-icons a,
.footer-icons li, .footer-icons a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#footer-icons img, 
#p-footer-icons img, 
#f-poweredbyico img, 
.footer-icons img {
    background-color: #ffffff !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    object-fit: contain !important;
    display: block !important;
    opacity: 0.88;
    transition: all 0.25s ease-in-out !important;
}

#footer-icons img:hover, 
#p-footer-icons img:hover, 
.footer-icons img:hover {
    opacity: 1 !important;
    transform: translateY(-2px) scale(1.04) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

@media screen and (min-width: 769px) {
    #footer-icons img, #p-footer-icons img, .footer-icons img {
        height: 28px !important;
        padding: 3px 8px !important;
    }
}

@media screen and (max-width: 768px) {
    #footer-icons, #p-footer-icons, .footer-icons {
        gap: 10px !important;
    }
    #footer-icons img, #p-footer-icons img, .footer-icons img {
        height: 32px !important;
        padding: 4px 10px !important;
    }
}

/* ===================================================
   强制隐藏 Special:Search 页面顶部的“高级”标签及下方的命名空间选择框
   =================================================== */

/* 1. 隐藏顶部的“高级”选项卡 */
.mw-search-profile-advanced,
a[href*="profile=advanced"] {
    display: none !important;
}

/* 2. 隐藏下方展开的“搜索命名空间”复选框区域 */
#mw-searchoptions,
.mw-search-namespaces,
.mw-search-form-optional {
    display: none !important;
}




/* 隐藏“差异”与“历史”对比链接 */
.clean-recent-changes .mw-changeslist-links,
.clean-recent-changes .mw-changeslist-diff,
.clean-recent-changes .mw-changeslist-history {
    display: none !important;
}

/* 隐藏用户名及用户工具链接(如:讨论 | 贡献) */
.clean-recent-changes .mw-userlink,
.clean-recent-changes .mw-usertoollinks {
    display: none !important;
}

/* 隐藏多余的分隔符号(如圆点 · 或竖线 |) */
.clean-recent-changes .mw-changeslist-separator {
    display: none !important;
}

/* 隐藏修改字节数增减提示(如 +120 / -45) */
.clean-recent-changes .mw-plusminus-pos,
.clean-recent-changes .mw-plusminus-neg,
.clean-recent-changes .mw-plusminus-null {
    display: none !important;
}

/* 隐藏编辑摘要与评论 */
.clean-recent-changes .comment,
.clean-recent-changes .mw-changeslist-comment {
    display: none !important;
}

/* 隐藏“新”、“小”等变更标记 */
.clean-recent-changes .minoredit,
.clean-recent-changes .botedit,
.clean-recent-changes .newpage {
    display: none !important;
}





/* =========================================================
   Dhamma.cn
   法谈划词引用
   仅保留一个按钮:
   “复制该段开示及出处”
   ========================================================= */


/* ---------------------------------------------------------
   Popup
   --------------------------------------------------------- */

#dhamma-quote-popup {

    position: absolute;

    display: none;

    z-index: 2147483647;

    box-sizing: border-box;

    padding: 5px;

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.98);

    color:
        #29332c;

    border:
        1px solid
        rgba(77, 107, 87, 0.16);

    box-shadow:
        0 7px 24px
        rgba(0, 0, 0, 0.18);

    backdrop-filter:
        blur(12px);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans SC",
        "Microsoft YaHei",
        Arial,
        sans-serif;

    animation:
        dhammaQuoteFadeIn
        0.15s ease;
}


/* ---------------------------------------------------------
   动画
   --------------------------------------------------------- */

@keyframes dhammaQuoteFadeIn {

    from {

        opacity: 0;

        transform:
            translateY(4px);
    }


    to {

        opacity: 1;

        transform:
            translateY(0);
    }

}


/* ---------------------------------------------------------
   唯一按钮
   --------------------------------------------------------- */

.dhamma-quote-button {

    appearance: none;

    border: none;

    margin: 0;

    padding:
        8px 15px;

    border-radius:
        7px;

    background:
        #4d6b57;

    color:
        #ffffff;

    cursor:
        pointer;

    font-size:
        13px;

    line-height:
        1.3;

    white-space:
        nowrap;

    font-weight:
        500;

    transition:
        background
        0.15s ease,
        transform
        0.1s ease;
}


.dhamma-quote-button:hover {

    background:
        #405a49;
}


.dhamma-quote-button:active {

    transform:
        scale(0.97);
}


/* ---------------------------------------------------------
   夜间模式
   --------------------------------------------------------- */

body.reader-theme-dark
#dhamma-quote-popup {

    background:
        rgba(43, 44, 47, 0.98);

    color:
        #eeeeee;

    border-color:
        rgba(255, 255, 255, 0.12);

    box-shadow:
        0 9px 28px
        rgba(0, 0, 0, 0.45);
}


body.reader-theme-dark
.dhamma-quote-button {

    background:
        #607b68;

    color:
        #ffffff;
}


body.reader-theme-dark
.dhamma-quote-button:hover {

    background:
        #6f8976;
}


/* ---------------------------------------------------------
   手机
   --------------------------------------------------------- */

@media (max-width: 600px) {

    #dhamma-quote-popup {

        max-width:
            calc(100vw - 20px);

        padding:
            5px;
    }


    .dhamma-quote-button {

        padding:
            9px 13px;

        font-size:
            12px;
    }

}