Update head-end.html
This commit is contained in:
@@ -9,6 +9,101 @@
|
||||
{{ end }}
|
||||
|
||||
<script async src="//finicounter.eu.org/finicounter.js"></script>
|
||||
<script src="/adview_pic_cpc_cpm_cpa_guanggao_gg_guge__ads_300x250.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
if (typeof(killads) == 'undefined') {
|
||||
|
||||
// 创建一个函数来显示美化后的广告屏蔽提示
|
||||
function createEnhancedAdBlockNotice() {
|
||||
|
||||
// 如果弹窗已存在,则不再创建
|
||||
if (document.getElementById('adblock-overlay-enhanced')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 为弹窗添加一个柔和的入场动画 (通过动态创建<style>标签)
|
||||
var css = `
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: scale(0.95); }
|
||||
to { opacity: 1; transform: scale(1); }
|
||||
}
|
||||
`;
|
||||
var style = document.createElement('style');
|
||||
style.id = 'adblock-notice-styles';
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = css;
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
document.head.appendChild(style);
|
||||
|
||||
// 1. 创建遮罩层 (背景)
|
||||
var overlay = document.createElement('div');
|
||||
overlay.id = 'adblock-overlay-enhanced';
|
||||
overlay.style.cssText = 'position:fixed; top:0; left:0; width:100%; height:100%; background-color:rgba(0, 0, 0, 0.8); z-index:9999; display:flex; justify-content:center; align-items:center; backdrop-filter:blur(4px);';
|
||||
|
||||
// 2. 创建弹窗容器 (主面板)
|
||||
var modal = document.createElement('div');
|
||||
modal.id = 'adblock-modal-enhanced';
|
||||
modal.style.cssText = 'background-color:#fff; padding:40px; border-radius:16px; max-width:460px; width:90%; box-shadow:0 15px 30px rgba(0,0,0,0.2); font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; animation: fadeIn 0.3s ease-out;';
|
||||
|
||||
// 3. 设置弹窗内的HTML内容 (包含SVG图标、美化文案和按钮)
|
||||
modal.innerHTML = `
|
||||
<div style="text-align: center; margin-bottom: 20px;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#e53935" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" style="color: #e53935;">
|
||||
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path>
|
||||
</svg>
|
||||
<h2 style="margin: 15px 0 10px; color: #333; font-size: 24px; font-weight: 600;">
|
||||
一份小小的请求
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<p style="color: #555; font-size: 16px; line-height: 1.8; margin-bottom: 15px;">
|
||||
我们发现您可能正在使用广告屏蔽器。
|
||||
</p>
|
||||
|
||||
<p style="color: #555; font-size: 16px; line-height: 1.8; margin-bottom: 25px;">
|
||||
广告是支持本站 <strong>持续运营</strong> 与 <strong>免费分享</strong> 的动力来源。如果本站对您有帮助,恳请将我们加入 <strong>白名单</strong>。您的这份善意,是对我们 <strong>最大的支持</strong>!
|
||||
</p>
|
||||
|
||||
<div style="background-color: #E8F5E9; border-left: 4px solid #4CAF50; padding: 15px 20px; border-radius: 8px;">
|
||||
<p style="margin: 0; color: #2E7D32; font-size: 16px; line-height: 1.6; text-align: center;">
|
||||
<strong>操作很简单:</strong>在插件中将本站设为白名单,然后 <strong>刷新页面</strong> 即可。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 30px;">
|
||||
<button id="close-adblock-notice-enhanced" style="background-color: #f1f1f1; color: #666; border: none; padding: 12px 25px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 500; transition: background-color 0.2s, transform 0.1s;">
|
||||
我明白了,继续浏览
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// 4. 组合并添加到页面
|
||||
overlay.appendChild(modal);
|
||||
document.body.appendChild(overlay);
|
||||
document.body.style.overflow = 'hidden';
|
||||
|
||||
// 5. 为关闭按钮添加功能和交互效果
|
||||
var closeButton = document.getElementById('close-adblock-notice-enhanced');
|
||||
closeButton.addEventListener('click', function() {
|
||||
document.body.removeChild(overlay);
|
||||
document.head.removeChild(style); // 顺便移除添加的样式
|
||||
document.body.style.overflow = 'auto';
|
||||
});
|
||||
|
||||
// 为按钮添加更丰富的悬停效果
|
||||
closeButton.onmouseover = function() { this.style.backgroundColor = '#e0e0e0'; };
|
||||
closeButton.onmouseout = function() { this.style.backgroundColor = '#f1f1f1'; };
|
||||
closeButton.onmousedown = function() { this.style.transform = 'scale(0.98)'; };
|
||||
closeButton.onmouseup = function() { this.style.transform = 'scale(1)'; };
|
||||
}
|
||||
|
||||
// 确保在页面DOM加载完毕后,再执行脚本
|
||||
window.addEventListener('DOMContentLoaded', createEnhancedAdBlockNotice);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
// 这是一个自定义脚本,用于处理特定的页面逻辑和功能
|
||||
|
||||
Reference in New Issue
Block a user