跳转到帖子
{{if !member.member_id}}
<style>
  .content-blur {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
  }
  .blur-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(255,255,255,0.8);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    font-size: 20px;
    color: #333;
  }
  .blur-overlay a {
    color: #0066cc;
    text-decoration: underline;
  }
</style>
<script>
  document.addEventListener("DOMContentLoaded", function () {
    const urlPath = window.location.pathname;
    const isTargetPage = urlPath.match(/^\/(blogs|gallery)\//);

    if (isTargetPage) {
      // 找到内容区域 - 根据你的网站结构调整选择器
      const contentArea = document.querySelector('.content-area, .post-content, .article-content') || 
                          document.querySelector('main, article') || 
                          document.getElementById('content');
      
      if (contentArea) {
        // 只模糊内容区域
        contentArea.classList.add("content-blur");

        // 添加遮罩层
        const overlay = document.createElement("div");
        overlay.className = "blur-overlay";
        overlay.innerHTML = '您需要 <a href="/login">登录</a> 才能查看完整内容';
        
        // 将遮罩层插入到内容区域附近
        contentArea.parentNode.insertBefore(overlay, contentArea.nextSibling);
      }
    }
  });
</script>
{{endif}}

image.png

0篇意见

推荐意见

没有意见。

游客
添加意见…