|
|
| 第14行: |
第14行: |
| </div> | | </div> |
| </div> | | </div> |
| <div id="neko-page-counter" style="min-height:100px;padding:10px;background:#0f0f1a;border-radius:8px;border:1px solid #2a2a40;text-align:center;color:#888;line-height:80px;">加载中...</div>
| |
|
| |
| <script>
| |
| (function() {
| |
| 'use strict';
| |
|
| |
| var PAD = 6;
| |
| var BASE_URL = 'https://wiki.meltfi.top/Special:Filepath/';
| |
|
| |
| function init() {
| |
| var container = document.getElementById('neko-page-counter');
| |
| if (!container) return;
| |
|
| |
| var total = 0;
| |
| if (typeof mw !== 'undefined' && mw.config) {
| |
| total = mw.config.get('wgNumberOfPages') || 0;
| |
| }
| |
|
| |
| var digits = String(total).padStart(PAD, '0').split('');
| |
| container.innerHTML = '';
| |
| container.style.cssText = 'display:flex;align-items:flex-end;justify-content:center;gap:0;min-height:100px;padding:10px;background:#0f0f1a;border-radius:8px;border:1px solid #2a2a40;';
| |
|
| |
| var parentW = container.parentElement ? container.parentElement.clientWidth : 600;
| |
| var imgW = Math.max(28, Math.min(100, Math.floor((parentW - 20) / PAD)));
| |
| var imgH = Math.round(imgW * 1.25);
| |
|
| |
| digits.forEach(function(d) {
| |
| var img = document.createElement('img');
| |
| img.src = BASE_URL + d + '.gif';
| |
| img.alt = d;
| |
| img.style.cssText = 'width:' + imgW + 'px;height:' + imgH + 'px;object-fit:contain;image-rendering:pixelated;display:block;';
| |
|
| |
| img.onerror = function() {
| |
| var fb = document.createElement('div');
| |
| fb.textContent = d;
| |
| fb.style.cssText = 'width:' + imgW + 'px;height:' + imgH + 'px;display:flex;align-items:center;justify-content:center;background:#333;color:#ff9ecd;font-size:' + Math.max(12, Math.floor(imgW * 0.4)) + 'px;font-weight:bold;font-family:monospace;border-radius:3px;';
| |
| if (img.parentNode) img.parentNode.replaceChild(fb, img);
| |
| };
| |
|
| |
| container.appendChild(img);
| |
| });
| |
| }
| |
|
| |
| if (document.readyState === 'complete' || document.readyState === 'interactive') {
| |
| setTimeout(init, 100);
| |
| } else {
| |
| document.addEventListener('DOMContentLoaded', function() {
| |
| setTimeout(init, 100);
| |
| });
| |
| }
| |
|
| |
| if (typeof jQuery !== 'undefined') {
| |
| jQuery(function($) {
| |
| setTimeout(init, 200);
| |
| });
| |
| }
| |
| })();
| |
| </script>
| |
|
| |
| <!-- 👇 全宽大公告区 --> | | <!-- 👇 全宽大公告区 --> |
| <div class="chanmoecard" style="flex:1 1 100%; padding:0; overflow:hidden; margin-bottom:24px;"> | | <div class="chanmoecard" style="flex:1 1 100%; padding:0; overflow:hidden; margin-bottom:24px;"> |