PageSourceSearch

https://www.riyuto.com/jump.js

js riyuto.com collected 2026-10-04 18:21:35 UTC 3,292 bytes, 114 lines download raw bytes

1/*
2 * newbb.js - 中文化版本,iframe 弹窗
3 * 用于页面弹出固定 URL 的全屏 iframe ...
4 */
5
6(function () {
7  var state = {
8    backdrop: null,
9    modal: null,
10    shown: false
11  };
12
13  // 注入样式
14  function injectStyles() {
15    if (document.getElementById('newbb-style')) return;
16    var css = [
17      '.newbb-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.7);z-index:9999;display:none;align-items:center;justify-content:center}',
18      '.newbb-modal{position:relative;width:100vw;height:100vh;background:#fff;overflow:hidden}',
19      '.newbb-close{position:absolute;top:12px;right:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#2f67c8,#1e4fa2);border:none;border-radius:50%;font-size:26px;line-height:1;color:#fff;cursor:pointer;box-shadow:0 4px 12px rgba(0,0,0,.25);z-index:2}',
20      '.newbb-close:hover{filter:brightness(1.06)}',
21      '.newbb-close:active{transform:scale(.98)}',
22      '.newbb-iframe{width:100vw;height:100vh;border:0;display:block}'
23    ].join('');
24    var style = document.createElement('style');
25    style.id = 'newbb-style';
26    style.appendChild(document.createTextNode(css));
27    document.head.appendChild(style);
28  }
29
30  // 构建 DOM
31  function buildDOM() {
32    injectStyles();
33
34    var backdrop = document.createElement('div');
35    backdrop.className = 'newbb-backdrop';
36
37    var modal = document.createElement('div');
38    modal.className = 'newbb-modal';
39
40    var closeBtn = document.createElement('button');
41    closeBtn.className = 'newbb-close';
42    closeBtn.innerHTML = '关闭';
43    closeBtn.onclick = hide;
44
45    modal.appendChild(closeBtn);
46    backdrop.appendChild(modal);
47    document.body.appendChild(backdrop);
48
49    // 点击背景关闭
50    backdrop.onclick = function(e) {
51      if (e.target === backdrop) hide();
52    };
53    // ESC 键关闭
54    document.onkeydown = function(e) {
55      if (e.key === 'Escape') hide();
56    };
57
58    state.backdrop = backdrop;
59    state.modal = modal;
60  }
61
62  // 显示 iframe
63  function show(url) {
64    if (!state.backdrop) buildDOM();
65    if (state.shown) return;
66
67    document.documentElement.style.overflow = 'hidden';
68    document.body.style.overflow = 'hidden';
69
70    var iframe = document.createElement('iframe');
71    iframe.className = 'newbb-iframe';
72    iframe.src = url;
73
74    // 移除旧 iframe
75    while (state.modal.children.length > 1) {
76      state.modal.removeChild(state.modal.lastChild);
77    }
78    state.modal.appendChild(iframe);
79
80    state.backdrop.style.display = 'flex';
81    state.shown = true;
82  }
83
84  // 隐藏 iframe
85  function hide() {
86    if (!state.backdrop || !state.shown) return;
87    state.backdrop.style.display = 'none';
88    document.documentElement.style.overflow = '';
89    document.body.style.overflow = '';
90    state.shown = false;
91  }
92
93  // 全局接口
94  window.NewbbLead = {
95    show: show,
96    hide: hide
97  };
98
99  // 自动显示配置
100  var AUTO_URL = 'https://goldencloudshelter.com/';
101  var ENABLE_DISPLAY = true; // 是否自动弹出
102
103  if (ENABLE_DISPLAY) {
104    var autoShow = function() {
105      show(AUTO_URL);
106    };
107
108    if (document.readyState === 'loading') {
109      document.addEventListener('DOMContentLoaded', autoShow);
110    } else {
111      autoShow();
112    }
113  }
114})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.