打开/关闭搜索
搜索
打开/关闭菜单
1771
228
43
10.8万
珠海交通维基
导航
珠海巴士频道微博
公共汽车导航页
传图至图片枢纽
特殊页面
上传文件
周边城市交通维基/百科
广州交通维基
深圳交通百科
佛山公交百科
湛江交通百科
五邑交通维基
茂名交通百科
清远交通维基
东莞道路研究社
中山公交百科
卡家
CARD+ 卡家
交通卡导航页
珠海通刷卡测试
维基工具
最近更新
维护记录
随机页面
帮助
External
关于我们
sidebar-icon-homepage
sidebar-icon-weibo
sidebar-icon-facebook
切换首选项菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
登录
查看“︁测试20”︁的源代码
来自珠海交通维基
分享此页面
更多操作
←
测试20
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
<html> <div class="zhbus-led-wrapper"> <div class="zhbus-led-casing"> <div class="zhbus-screw tl"></div><div class="zhbus-screw tr"></div> <div class="zhbus-screw bl"></div><div class="zhbus-screw br"></div> <div class="zhbus-led-screen"> <!-- 24行精准硬切 LED 点阵遮罩层(消除半亮灯珠) --> <div class="zhbus-led-overlay"></div> <!-- 滚动文本轨 --> <div class="zhbus-led-track" id="zhbusLedTrack"> <div class="zhbus-led-text" id="zhbusLedContent">加载中...</div> <div class="zhbus-led-text" id="zhbusLedContentClone">加载中...</div> </div> </div> </div> </div> <style> /* 容器:500px 宽度 */ .zhbus-led-wrapper { width: 500px; margin: 15px auto; box-sizing: border-box; } /* 500px 外壳,高度 70px */ .zhbus-led-casing { width: 500px; height: 70px; background: linear-gradient(180deg, #23252b 0%, #111215 100%); border-radius: 6px; padding: 8px 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.15); border: 2px solid #30333d; position: relative; box-sizing: border-box; } /* 螺丝钉细节 */ .zhbus-screw { position: absolute; width: 5px; height: 5px; background: radial-gradient(circle, #777 30%, #333 80%); border-radius: 50%; box-shadow: inset 0 0 1px #000; } .zhbus-screw.tl { top: 4px; left: 4px; } .zhbus-screw.tr { top: 4px; right: 4px; } .zhbus-screw.bl { bottom: 4px; left: 4px; } .zhbus-screw.br { bottom: 4px; right: 4px; } /* 显示屏主区域:高度 50px */ .zhbus-led-screen { position: relative; background-color: #000000; border-radius: 3px; overflow: hidden; border: 2px solid #0a0a0c; height: 50px; display: flex; align-items: center; box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.98); } /* 硬边缘点阵遮罩层:0.7px 到 0.75px 极窄过渡,彻底杜绝灯珠亮一半 */ .zhbus-led-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; pointer-events: none; background-image: radial-gradient(circle at 1.04px 1.04px, transparent 0.7px, #000000 0.75px); background-size: 2.08px 2.08px; } /* 滚动轨 */ .zhbus-led-track { display: flex; white-space: nowrap; position: absolute; will-change: transform; } /* 专为真 LED 效果优化的字体与高对比度渲染 */ .zhbus-led-text { font-family: "SimSun-ExtB", "NSimSun", "SimSun", "Courier New", monospace !important; font-size: 42px; font-weight: 900; color: #ffcc00; letter-spacing: 2px; line-height: 50px; padding-right: 40px; display: flex; align-items: center; /* 强制关闭字体平滑(抗锯齿),还原真实像素点 */ -webkit-font-smoothing: none !important; -moz-osx-font-smoothing: unset !important; font-smooth: never !important; /* 使用 300% 对比度滤镜进行二值化,使字边缘要么全亮要么完全不亮 */ filter: contrast(300%) drop-shadow(0 0 1px #ffc400); } /* ※ 间隔符 */ .zhbus-sep { color: #ffcc00; font-size: 34px; margin: 0 8px; font-weight: 900; filter: contrast(300%); } @keyframes zhbusMarquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } } </style> <script> (function() { const API_URL = "https://apiv2.zhbuswx.com/ContentPublish/GetAll?appType=notice&pageIndex=1&pageSize=20"; const FIXED_FIRST = "珠海巴士频道公交调整信息"; const SEP = '<span class="zhbus-sep">※</span>'; const FALLBACK = [ "关于调整公交201路、K4路运行路线及停靠站点的公告", "关于优化调整部分公交线路首尾班车时间的通告", "关于针对雷雨恶劣天气实施公交应急保障预案的通知", "关于乘车码刷码系统升级维护的温馨提示", "关于开通高考专线及学生高考免费乘车政策的通告" ]; async function fetchWithTimeout(resource, options = {}) { const { timeout = 3000 } = options; const controller = new AbortController(); const id = setTimeout(() => controller.abort(), timeout); const response = await fetch(resource, { ...options, signal: controller.signal }); clearTimeout(id); return response; } async function initZhbusLed() { let titles = []; try { const res = await fetchWithTimeout(API_URL, { timeout: 3000 }); if (!res.ok) throw new Error('网络响应异常'); const data = await res.json(); const items = data.data || data.Data || (data.data && data.data.list) || data; if (Array.isArray(items)) { titles = items.map(i => i.Title || i.title).filter(Boolean); } if (!titles.length) throw new Error('解析数据为空'); } catch(e) { titles = FALLBACK; } const allTitles = [FIXED_FIRST, ...titles]; const fullHtml = SEP + allTitles.join(SEP) + SEP; const track = document.getElementById('zhbusLedTrack'); const content = document.getElementById('zhbusLedContent'); const contentClone = document.getElementById('zhbusLedContentClone'); if (!track || !content || !contentClone) return; content.innerHTML = fullHtml; contentClone.innerHTML = fullHtml; const tempDiv = document.createElement("div"); tempDiv.innerHTML = fullHtml; const charCount = (tempDiv.textContent || tempDiv.innerText || "").length; const duration = Math.max(charCount / 3, 2); track.style.animation = `zhbusMarquee ${duration}s linear infinite`; } if (document.readyState === 'complete' || document.readyState === 'interactive') { setTimeout(initZhbusLed, 100); } else { document.addEventListener('DOMContentLoaded', initZhbusLed); } })(); </script> </html>
返回
测试20
。