微件:GGLScratchGame:修订间差异

来自Limbo Wiki Mirror
Gaoice留言 | 贡献
无编辑摘要
标签(旧)WikiEditor
无编辑摘要
标签(旧)WikiEditor
 
(未显示2个用户的45个中间版本)
第1行: 第1行:
<div class="ggl-root">
<div class="ggl-root" id="ggl-root">


   <!-- 彩票主背景 -->
   <!-- 初始化遮罩 -->
   <img class="ggl-bg"
   <div class="ggl-mask" id="ggl-mask">
      src="https://wm.gaoice.run/images/thumb/b/b6/%E5%9B%BE%E7%89%871.png/180px-%E5%9B%BE%E7%89%871.png">
    <button class="ggl-start-btn">来一张彩票…<br>…不,三张吧</button>
  </div>


   <!-- 刮奖区域 -->
   <!-- 顶部 -->
   <div class="ggl-scratch-area">
   <div class="ggl-top">
     <div class="ggl-grid"></div>
    <div class="ggl-rule">
      刮开奖券 · 在整张刮完后交由bot扫描<br>
      刮出数字即能获得对应额度的data<br>
      当“平”“安”“喜”“乐”四个字连城一条线时,可再获得一张彩票<br>
      看不懂也没关系!bot会告诉你结果!
    </div>
     <div class="ggl-left">
      剩余彩票:<span id="ggl-left">—</span> 张 
      可提现 DATA:<span id="ggl-data">—</span>
    </div>
   </div>
   </div>


   <!-- 吉祥物 -->
   <div class="ggl-frame">
  <div class="ggl-mascot">(^▽^)</div>
    <div class="ggl-ticket">
 
      <img class="ggl-bg"
        src="https://wm.gaoice.run/images/b/b6/%E5%9B%BE%E7%89%871.png">
 
      <div class="ggl-scratch-area">
        <div class="ggl-grid"></div>
      </div>
 
      <button class="ggl-redeem-hit" id="ggl-redeem-hit"></button>
 
      <div class="ggl-mascot"></div>
      <div class="ggl-bubble"></div>


  <!-- 气泡 -->
      <div class="ggl-controls">
  <div class="ggl-bubble"></div>
        <button id="ggl-scan">扫描结果</button>
      </div>


  <!-- 控制区 -->
     </div>
  <div class="ggl-controls">
     <button id="ggl-scan">扫描结果</button>
   </div>
   </div>
</div>
</div>


<style>
<style>
.ggl-root {
/* 原样样式 */
  position: relative;
.ggl-root{width:375px;margin:auto;font-family:sans-serif;position:relative}
  width: 375px;
.ggl-mask{position:absolute;inset:0;background:#000d;z-index:99;display:flex;align-items:center;justify-content:center}
  margin: auto;
.ggl-start-btn{padding:12px 20px;font-size:16px}
  aspect-ratio: 1075 / 1911;
 
   font-family: sans-serif;
.ggl-top{text-align:center;font-size:14px;margin-bottom:6px}
.ggl-frame{padding:10px;border:3px solid #ff00aa;box-shadow:0 0 12px #ff00aa88}
.ggl-ticket{position:relative;aspect-ratio:1075/1911}
.ggl-bg{width:100%;display:block}
 
.ggl-scratch-area{position:absolute;left:10%;top:35%;width:80%;height:53%}
.ggl-grid{display:grid;width:100%;height:100%;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(6,1fr);gap:6px}
 
.ggl-cell{position:relative;overflow:hidden}
.ggl-cell img,.ggl-cover{position:absolute;inset:0;width:100%;height:100%}
.ggl-cover{
  background:url("https://wm.gaoice.run/images/thumb/5/5a/%E5%88%AE%E5%BC%80%E5%89%8D.png/180px-%E5%88%AE%E5%BC%80%E5%89%8D.png") center/cover;
  cursor:pointer
}
.ggl-reward{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
   font-size:12px;font-weight:bold;pointer-events:none
}
}


.ggl-bg {
.ggl-mascot{position:absolute;left:6%;top:107%}
   width: 100%;
.ggl-bubble{position:absolute;left:6%;top:103%;width:60%;background:#fff;padding:6px;font-size:13px}
   display: block;
.ggl-controls{position:absolute;right:6%;top:103%}
#ggl-scan{opacity:.3}
#ggl-scan.active{opacity:1}
 
.ggl-redeem-hit{
  position:absolute;bottom:1%;left:2%;
   width:48%;height:10%;
   background:transparent;border:none
}
}


.ggl-scratch-area {
 
   position: absolute;
#ggl-ending-container{
   left: 10%;
   max-width:800px;
   top: 38%;
  margin:18px auto;
   width: 80%;
  padding:12px;
   height: 53%;
   background:#fff;
   border:2px solid #ccc;
   box-shadow:0 6px 18px rgba(0,0,0,.08);
  font-family:inherit;
   line-height:1.5;
}
}


.ggl-grid {
.mw-collapsible{overflow:hidden}
   display: grid;
.wikitable{border-collapse:collapse;width:100%}
   grid-template-columns: repeat(5, 1fr);
.wikitable th, .wikitable td{border:1px solid #aaa;padding:6px}
   grid-template-rows: repeat(6, 1fr);
 
   gap: 6px;
.poem{white-space:pre-wrap;font-family:serif;background:#f8f8f8;padding:8px;border-left:3px solid #ddd}
   width: 100%;
</style>
   height: 100%;
 
<script>
(function(){
 
const root  = document.querySelector('.ggl-root');
const grid  = document.querySelector('.ggl-grid');
const bubble = document.querySelector('.ggl-bubble');
const mascot = document.querySelector('.ggl-mascot');
const scan   = document.getElementById('ggl-scan');
const leftEl = document.getElementById('ggl-left');
const dataEl = document.getElementById('ggl-data');
const mask   = document.getElementById('ggl-mask');
const redeem = document.getElementById('ggl-redeem-hit');
 
const OPEN = 'https://wm.gaoice.run/images/thumb/4/4a/%E5%88%AE%E5%BC%80%E5%90%8E.jpg/180px-%E5%88%AE%E5%BC%80%E5%90%8E.jpg';
 
let idx = 0;
let revealed = 0;
let scanned = false;
let finalized = false;
let alertTimer = null;
let redeemLocked = false;
 
const TICKETS = [
/* 1 */
  {left:2,data:0,mascot:'|ω`)',bubble:'你好呀,俺是负责播报结果的。不用管我。',onScan:'哇!中了25MB耶,回本了回本了。',rewards:{0:'畅',1:'舒',2:'遂',3:'顺',4:'达',5:'欢',6:'5',7:'欣',8:'怡',9:'和',10:'睦',11:'融',12:'洽',13:'美',14:'善',15:'吉',16:'昌',17:'20',18:'兴',19:'平',20:'安',21:'喜',22:'乐',23:'平',24:'安',25:'盛',26:'喜',27:'乐',28:'悦',29:'睦'}},
/* 2 */
  {left:1,data:25,mascot:'|∀`)ノ',bubble:'虽然好像彩票上下都没标,但是中奖金额的单位默认是MB哦~',onScan:'1MB,然后是……bingo!不对,“平安喜乐”!第二行,横着和斜着,两组!这就去给你加上!',rewards:{0:'遂',1:'舒',2:'达',3:'顺',4:'畅',5:'平',6:'安',7:'喜',8:'乐',9:'和',10:'睦',11:'安',12:'1',13:'美',14:'善',15:'吉',16:'昌',17:'喜',18:'盛',19:'兴',20:'欢',21:'平',22:'悦',23:'乐',24:'欣',25:'怡',26:'洽',27:'融',28:'欢',29:'怡'}},
/* 3 */
  {left:2,data:26,mascot:'|o`)',bubble:'耶咦耶咦耶咦耶奥🎶我们又能多相处一会儿了!',onScan:'让我看看,36MB,外加一张彩票!<br>(小声)这么好中,真的假的?都不用我……。',rewards:{0:'舒',1:'平',2:'场',3:'遂',4:'15',5:'欢',6:'安',7:'悦',8:'欣',9:'怡',10:'和',11:'喜',12:'睦',13:'融',14:'20',15:'洽',16:'美',17:'乐',18:'善',19:'吉',20:'昌',21:'盛',22:'兴',23:'16',24:'顺',25:'平',26:'安',27:'喜',28:'乐',29:'达'}},
/* 4 */
  {left:2,data:62,mascot:'|▽`)',bubble:'*suisuinian,sikaozijidenengli|_・)',onScan:'扫描完成:null。终于正常了嘛……<br>嘿嘿,果然还需要我来帮一把!',rewards:{0:'欣',1:'平',2:'怡',3:'畅',4:'舒',5:'安',6:'遂',7:'盛',8:'顺',9:'达',10:'和',11:'睦',12:'融',13:'喜',14:'洽',15:'美',16:'善',17:'吉',18:'昌',19:'乐',20:'兴',21:'欢',22:'平',23:'安',24:'悦',25:'喜',26:'乐',27:'融',28:'洽',29:'兴'}},
/* 5 */
  {left:2,data:62,mascot:'|д`)',bubble:'什么都没有。',onScan:'扫描完成:',rewards:{0:'欣',1:'平',2:'怡',3:'1',4:'舒',5:'安',6:'遂',7:'喜',8:'顺',9:'2',10:'和',11:'1',12:'融',13:'乐',14:'洽',15:'美',16:'善',17:'吉',18:'5',19:'昌',20:'盛',21:'兴',22:'欢',23:'悦',24:'1',25:'平',26:'乐',27:'畅',28:'达',29:'喜'}},
/* 6 */
  {left:1,data:5,mascot:'|??)',bubble:'不不不,我不是通过修改多添了一张票吗?为什么还是结束了?<br>我这是……我在……<br>不……不要……不要!!!',onScan:'A̜̤̓b̦̅́ǒ̮̚r̛̰̪t̗̗͂:̵̂̚ ů̡̪n̯̻͊r̥̂̀e̡̧̲s̴̬͋o̬̖̖l̴̻̚v̭̋̽a̫͈̅b̮̼̏l̟̊̀ȩ͎͌ s̱̭̙i̥̘͆t̡̥̔u̸̟̙a̤͊̓t̫̒́i̝̠̾o̺͉͂ǹ̲̎。',rewards:{0:'6',1:'顺',2:'6',3:'遂',4:'6',5:'6',6:'6',7:'6',8:'6',9:'6',10:'平',11:'6',12:'6',13:'6',14:'和',15:'平',16:'6',17:'6',18:'6',19:'和',20:'安',21:'6',22:'6',23:'6',24:'睦',25:'安',26:'6',27:'6',28:'6',29:'睦'}},
/* 7 */
  {left:0,data:5,mascot:'',bubble:'<br>.̨̝̮̮͉̖̃̿̈́ͅ.̢̦̫͆͌͆͏̨̩͉.͏̤̫̣̎̆̃̾́ͅ.̧̖̻̥͈̥̈̂̌̒.̲̹́̋̄̐̈́ͅͅ͏.̡͇͈̣̓͌͌͌̂̓.̖̩͈̻̱̌͋͆̊̚.̮̦̝̼̤̮͈͂̆̑.̵̧̘̲̞̉͋̇͂̕.̢̨͌̿͏̖̳͌̓̎.̙̤̫͉̔͋̊̄̐ͅ.͏̶̺̦̲̝̍̈́͌̚.̳̜̼̼̻̹̐̃̈̑.̨̠͎̝̟̼͇̞̩̃.͎̟͉̠̫͉̜̿̈́̓.̷̛̜̦̩̼̎̏̈́͆.̡̨̢̭͇̣̿̓̏͏.̰̻͇͉̑̌̓̆̅̄.̅͏̺̫̱̯̳̹̓̏.̸̨̢̦̙͌̓̉̃̉.̨̛̻̬̈̔́̍̃͌.̝͈̠͇̣̭̐̈̓̍.̴͎̰̼̾͆̃̍̃̃.̛̼͉̝̃̔̆̆̽̚.̷̡̮̠̥̳̬̇̓̃.̞͎̗̀͂̌͊̂̈ͅ.̵̴̱̫̟̒̓̅͊̍.̮̺̠̯͉̊̅̓̀̓.̴̧̨̬̳̬́͋́̂.̤̠̲̍̓ͅ͏̶̾͏<br>',onScan:'扫描完成:无数据。',rewards:{0:'和',1:'睦',2:'融',3:'洽',4:'美',5:'善',6:'吉',7:'昌',8:'盛',9:'兴',10:'欢',11:'平',12:'悦',13:'顺',14:'欣',15:'怡',16:'安',17:'畅',18:'乐',19:'舒',20:'遂',21:'喜',22:'达',23:'平',24:'安',25:'喜',26:'乐',27:'欢',28:'悦',29:'欣'}},
/* 8 */
  {left:0,data:7,mascot:'|∀◕。)',bubble:'没素质啊,干嘛挠我',onScan:'jiuni?',rewards:{0:'美',1:'善',2:'吉',3:'昌',4:'盛',5:'兴',6:'平',7:'欢',8:'悦',9:'欣',10:'平',11:'安',12:'喜',13:'乐',14:'89',15:'畅',16:'喜',17:'32',18:'遂',19:'顺',20:'达',21:'乐',22:'睦',23:'融',24:'怡',25:'安',26:'和',27:'舒',28:'200',29:'洽'}},
/* 9 */
  {left:1,data:'—',mascot:'|',bubble:'▒▓░▒▓▒▓',onScan:'▒▓░▒▓▒▓▒▓3934181383533 + 793416……',rewards:{0:'17 Byte',1:'89 KB',2:'1023 MB',3:'457 GB',4:'781 bit',5:'902 TB',6:'314 Byte',7:'567 KB',8:'890 MB',9:'10 GB',10:'21 bit',11:'144 TB',12:'169 Byte',13:'196 KB',14:'225 MB',15:'256 GB',16:'289 bit',17:'3 Byte',18:'361 KB',19:'400 TB',20:'41 MB',21:'484 GB',22:'529 bit',23:'576 Byte',24:'625 KB',25:'676 TB',26:'729 MB',27:'84 GB',28:'841 bit',29:'900 Byte'}},
/* 10 */
  {left:0,data:'ERROR!',mascot:'|||',bubble:'你是谁?',onScan:'扫描结果:DATA 溢出。',rewards:{0:'D̸A̍T̴A̵',1:'D͊ẠT̿A̘',2:'D̐A̬T̰A̢',3:'D̶ÃT̚À',4:'D̜ǍT̘A͆',5:'D̝͏A̸̛T̞̩A͇̒',6:'D̵́A̵̗T̈̀Ȃ̐',7:'D̢̫A̬̾Ţ̏Ą̘',8:'D͇̉A̓̔T̜̿A̷̯',9:'D̦̽̂À͈͌T͍̟̋Å̟͇',10:'D̢͍ͅA̶̹̝Ṱ̑̏A̵̯̱',11:'D̠̖͆Â̛̲T̸̿̃Å̝̖',12:'Ḏ̨͍À̆̅T̫͂̐Ȧ̷̺',13:'D̮̱̽͆Ǎ̡̯̦Ț̡̓́À̝̹͋',14:'D̮̤̣͌Á̷̃́T̟̀̀͂Ả̷̺̂',15:'D̼̪̜̈A̷̮͍͆T̵̢̹̏A̩̪̹̦',16:'D̶̰̠̅́A͂̎̇̉̔T̨̡͈̃̅A̰͌͋̈́̑',17:'D̨̯̝̑̋A̫̱̋̐̅T̞̎͊̅̄A̦̳̣̿̚',18:'D̨̨̞̙̆À̟̻̌̓Ṱ̥̉̄ͅA̧̼̣̫͂',19:'D̖͏̯̃̽̃A̷͉̎̿̾̿T̊̀͏̺̩̘Á̟̲̦̿̔',20:'Ḑ̫̞̿̈̈́A̶̛̬͇̿͂T̨̬̦̺̀̉Á̗̠̋͂̃',21:'D̡̧̛̫̼̓A̛̅̂̊̑̽T̸̛̞͎̓̂Ȧ̠̟̪̑̀',22:'D̡̻͉̹̽̇͌Á͈̥̥́̈́̌T̪̮̍̒̏̎̚A̷̦͇̩̰͆͆',23:'D̸͇̠͍͍̓̈A͎̭̹̮͆͌́T̤̱̖̉̉̉̀A̺̬̤̺̯̚ͅ',24:'D̶̬̱̥̠̊̆A̴̪̙̜̽̆͊T̤͏̖̪̈́͌̃A̪̮̞̪̰͋͆',25:'D̴̢̼̗̝̊̋A̸̸̟͎̅̓̃T͇͈̗͇̱̓̐Ȁ̸̎̎̉̇́',26:'D̷̴̸̛̳̦͆Ǎ̷̳̤̱̯̄Ṫ̶̢̼͋̌̾A̡̢͍̮̓̆̚',27:'D̸̴̛̘̭̖̓A̵̡̢͉̫̒̓T̨̼̼̑̓͊̒Ä̦̪́̒̆̀̕',28:'Ḏ̸̨͊̍̍̎̍À̧͉̠̺̻͍̐T̷̡̤̳͊̃̓͆Â̢̟̤̹̯̅ͅ',29:'D̮̲̪̲̅́̊͌̾̎Ạ̧̤̩̥̦̒̂͊͏T̼̳̲̭̖̺̆́̀͏Â̴̢͎͍͈̥̾̾̀'}},
/* 11 */
  {left:'?̜̻̤̹́̂̈́̑̀?̢̥̯̓̈́̃̿̀̅?̵̡̹̯̠̉̅̃̃',data:'È̶̶̶̝͏̶̶̶̝̞R̶̶̶̶̶̶̝̬̩̦̈R̶̶̶̶̶̵̶̗̹̄̈Ơ̶̶̶̶̶̶̞̳̑̆R̶̶̼͏̶̴̶̶̶̢̲!̶̶̶̶̶̶̜̪̏̊̋',mascot:'平安喜乐',bubble:'你知道的太多了。',onScan:'权限越界。',rewards:{  0:'平',1:'安',2:'安',3:'平',4:'喜',5:'喜',6:'乐',7:'喜',8:'安',9:'平',10:'安',11:'平',12:'安',13:'喜',14:'乐',15:'乐',16:'喜',17:'平',18:'安',19:'安',20:'喜',21:'平',22:'乐',23:'乐',24:'平',25:'平',26:'安',27:'安',28:'喜',29:'乐'}}
];
 
function fadeOutCover(cover, done){
  const start = performance.now();
   const duration = 450;
  cover.style.pointerEvents = 'none';
   function frame(now){
    const p = Math.min((now - start) / duration, 1);
    cover.style.opacity = 1 - p;
    if(p < 1){
      requestAnimationFrame(frame);
    }else{
      cover.style.display = 'none';
      done && done();
    }
  }
   requestAnimationFrame(frame);
}
}


.ggl-cell {
function build(){
  position: relative;
  if(finalized) return;
   overflow: hidden;
  const t = TICKETS[idx];
  grid.innerHTML = '';
  revealed = 0;
  scanned = false;
 
  leftEl.textContent = t.left;
  dataEl.textContent = t.data;
  mascot.textContent = t.mascot || '';
  bubble.textContent = t.bubble || '';
 
  scan.textContent = '扫描结果';
  scan.classList.remove('active');
 
  for(let i=0;i<30;i++){
    const c = document.createElement('div');
    c.className = 'ggl-cell';
    c.innerHTML = `
      <img src="${OPEN}">
      <div class="ggl-reward">${t.rewards?.[i] || ''}</div>
      <div class="ggl-cover"></div>
    `;
    const cover = c.querySelector('.ggl-cover');
    cover.onclick = ()=>{
      if(c.dataset.done || finalized) return;
      c.dataset.done = 1;
      fadeOutCover(cover, ()=>{
        if(++revealed === 30){
          scan.classList.add('active');
        }
      });
    };
    grid.appendChild(c);
   }
}
}


.ggl-cell img,
function startInfiniteAlert(){
.ggl-cell canvas {
   if(alertTimer) return;
   position: absolute;
   const TEXT = '冲刺!冲刺!';
   inset: 0;
   (function loop(){
   width: 100%;
    alert(TEXT);
   height: 100%;
    alertTimer = setTimeout(loop, 200);
   })();
}
}


.ggl-mascot {
function showRedeemModal(){
   position: absolute;
  if(redeemLocked) return;
   left: 6%;
  redeemLocked = true;
  bottom: 8%;
 
  font-size: 22px;
  const overlay = document.createElement('div');
   overlay.style.cssText = `
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.7);
    z-index:999;
    display:flex;
    align-items:center;
    justify-content:center;
  `;
 
  const box = document.createElement('div');
   box.style.cssText = `
    background:#fff;
    padding:20px;
    width:70%;
    text-align:center;
    font-size:14px;
  `;
  box.textContent = '无法兑奖';
 
  overlay.appendChild(box);
  document.querySelector('.ggl-ticket').appendChild(overlay);
 
  setTimeout(()=>{
    box.innerHTML = `
      <div>系统已记录</div>
      <div>给你一张彩票</div>
    `;
    const btn = document.createElement('button');
    btn.textContent = '确定';
    btn.style.marginTop = '12px';
    btn.onclick = ()=>{
      overlay.remove();
      redeemLocked = false;
      idx = 10;
      build();
    };
    box.appendChild(btn);
  }, 2200);
}
}


.ggl-bubble {
const INTERNAL_WIKITEXT = `
   position: absolute;
== 收藏品 ==
   left: 6%;
冲刺!冲刺!
   bottom: 13%;
收集时间:?
   width: 60%;
ottootto。
   min-height: 40px;
 
   background: rgba(255,255,255,.9);
`;
  padding: 6px;
 
  font-size: 14px;
function parseWikiToHtml(wikitext){
}
   let text = wikitext.replace(/\r\n/g, '\n');
 
  // 1) 处理 <poem> ... </poem>
   text = text.replace(/<poem>([\s\S]*?)<\/poem>/gi, function(_, inner){
    // 保留换行
    const safe = escapeHtml(inner.trim());
    return `<div class="poem">${safe}</div>`;
   });
 
   // 2) 处理 标题 == ... ==
  text = text.replace(/^==\s*(.+?)\s*==$/gm, function(_, t){
    return `<h2>${escapeHtml(t)}</h2>`;
   });
 
  // 3) 处理表格块 {|| ... |}
   text = text.replace(/\{\|([\s\S]*?)\|\}/g, function(_, tableBody){
    // 处理每一行
    const lines = tableBody.split('\n').map(l=>l.trim()).filter(l=>l.length>0);
    let html = '<table class="wikitable">';
    let inRow = false;
    for(let i=0;i<lines.length;i++){
      const line = lines[i];
      if(line.startsWith('!')){ // header cell(s), can be multiple separated by !!
        const cells = line.slice(1).split('!!').map(s=>s.trim());
        html += '<thead><tr>';
        cells.forEach(c=> html += `<th>${escapeHtml(c)}</th>`);
        html += '</tr></thead>';
      }else if(line === '|-'){ // new row
        if(inRow) html += '</tr>';
        html += '<tr>';
        inRow = true;
      }else if(line.startsWith('|')){ // cell content, may be single cell or multiple with ||
        const content = line.slice(1);
        const cells = content.split('||').map(s=>s.trim());
        cells.forEach(c=> html += `<td>${escapeHtml(c)}</td>`);
      }else{
        // fallback: plain row cell
        html += `<tr><td>${escapeHtml(line)}</td></tr>`;
      }
    }
    if(inRow) html += '</tr>';
    html += '</table>';
    return html;
  });


.ggl-controls {
  // 4) 其余换行转段落(简单处理)
   position: absolute;
  text = text.replace(/\n{2,}/g, '</p><p>');
   right: 6%;
   text = '<p>' + text + '</p>';
   bottom: 8%;
   // 清理空段落
  text = text.replace(/<p>\s*<\/p>/g, '');
   return text;
}
}


#ggl-scan {
function escapeHtml(s){
   opacity: .3;
   return s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
#ggl-scan.active {
  opacity: 1;
}
}
</style>
<script>
(function () {
  const grid = document.querySelector('.ggl-grid');
  const bubble = document.querySelector('.ggl-bubble');
  const mascot = document.querySelector('.ggl-mascot');
  const scanBtn = document.getElementById('ggl-scan');


  const STATES = [
/* ===== 终局:隐藏微件并插入解析后的 HTML ===== */
    "无",
function triggerFinal(){
    "(・∀・)",
  if(finalized) return;
    "(ノ◕ヮ◕)ノ",
   finalized = true;
    "(・_・)",
    "(;゚Д゚)",
    null,
    "...",
    "别挠我痒痒",
    "你是谁?",
    "停下来",
    "平安喜乐。你知道的太多了"
   ];


   let scratchedCount = 0;
   try{ document.body.style.filter = 'invert(1)'; }catch(e){}
  if(root) root.style.display = 'none';


   for (let i = 0; i < 30; i++) {
   // 解析内置 wiki 文本并插入
    const cell = document.createElement('div');
  const html = parseWikiToHtml(INTERNAL_WIKITEXT);
    cell.className = 'ggl-cell';
  const container = document.createElement('div');
    cell.dataset.state = (i % 11) + 1;
  container.id = 'ggl-ending-container';
  container.innerHTML = html;


    cell.innerHTML = `
  if(root && root.parentNode){
      <img src="https://wm.gaoice.run/images/thumb/4/4a/%E5%88%AE%E5%BC%80%E5%90%8E.jpg/180px-%E5%88%AE%E5%BC%80%E5%90%8E.jpg">
    root.parentNode.insertBefore(container, root.nextSibling);
      <canvas></canvas>
  }else{
     `;
     document.body.appendChild(container);
    grid.appendChild(cell);
    initScratch(cell);
   }
   }
}


  function initScratch(cell) {
/* ===== 交互逻辑 ===== */
    const canvas = cell.querySelector('canvas');
scan.onclick = ()=>{
    const ctx = canvas.getContext('2d');
  if(!scan.classList.contains('active') || finalized) return;


    requestAnimationFrame(() => {
  if(idx === 9 && revealed === 30){
      canvas.width = cell.clientWidth;
    startInfiniteAlert();
      canvas.height = cell.clientHeight;
    return;
  }


      const cover = new Image();
  if(idx === 10 && revealed === 30){
      cover.src = "https://wm.gaoice.run/images/thumb/5/5a/%E5%88%AE%E5%BC%80%E5%89%8D.png/180px-%E5%88%AE%E5%BC%80%E5%89%8D.png";
    triggerFinal();
      cover.onload = () => {
    return;
        ctx.drawImage(cover, 0, 0, canvas.width, canvas.height);
  }
      };
    });


     let down = false;
  if(!scanned){
 
     scanned = true;
     canvas.addEventListener('pointerdown', () => down = true);
     bubble.textContent = TICKETS[idx].onScan;
     canvas.addEventListener('pointerup', () => down = false);
     scan.textContent = '再来一张';
     canvas.addEventListener('pointerleave', () => down = false);
     return;
  }


    canvas.addEventListener('pointermove', e => {
  idx++;
      if (!down) return;
  build();
      const r = canvas.getBoundingClientRect();
};
      ctx.globalCompositeOperation = 'destination-out';
      ctx.beginPath();
      ctx.arc(e.clientX - r.left, e.clientY - r.top, 18, 0, Math.PI * 2);
      ctx.fill();
    });


    canvas.addEventListener('pointerup', () => onReveal(cell));
redeem.onclick = ()=>{
  if(idx === 9 && revealed === 30){
    showRedeemModal();
   }
   }
};


  function onReveal(cell) {
mask.onclick = ()=>{
    if (cell.dataset.revealed) return;
  mask.remove();
    cell.dataset.revealed = 1;
  build();
    scratchedCount++;
};
 
    const state = +cell.dataset.state;


    if (state <= 5) {
document.addEventListener('keydown',e=>{
      mascot.textContent = STATES[state];
  if(finalized) return;
      bubble.textContent = "中奖了?";
  if(e.shiftKey && e.key.toLowerCase()==='d'){
    }
     grid.querySelectorAll('.ggl-cover').forEach(c=>c.style.display='none');
    if (state === 6) {
    revealed = 30;
      mascot.textContent = "";
    scan.classList.add('active');
      bubble.textContent = "……你真的在刮吗?";
    }
    if (state === 7) {
      bubble.textContent = "……";
    }
    if (state === 8) {
      bubble.textContent = "哦 嗯 嘿 哈";
    }
     if (state === 9) {
      bubble.textContent = "你是谁?";
    }
    if (state === 10) {
      bubble.textContent = "停下来";
      scanBtn.classList.add("active");
    }
    if (state === 11) {
      bubble.textContent = STATES[10];
      setTimeout(() => {
        document.body.style.filter = "invert(1)";
        setTimeout(() => {
          location.href = "/index.php?title=六世恶言之一";
        }, 1200);
      }, 800);
    }
   }
   }
});


  scanBtn.addEventListener('click', () => {
if(!mask){
    if (!scanBtn.classList.contains('active')) return;
  build();
    bubble.textContent = "扫描中……";
}
  });


})();
})();
</script>
</script>

2026年2月4日 (三) 04:17的最新版本

   <button class="ggl-start-btn">来一张彩票…
…不,三张吧</button>
     刮开奖券 · 在整张刮完后交由bot扫描
刮出数字即能获得对应额度的data
当“平”“安”“喜”“乐”四个字连城一条线时,可再获得一张彩票
看不懂也没关系!bot会告诉你结果!
     剩余彩票: 张 
     可提现 DATA:
     <img class="ggl-bg"
       src="%E5%9B%BE%E7%89%871.png">
     <button class="ggl-redeem-hit" id="ggl-redeem-hit"></button>
       <button id="ggl-scan">扫描结果</button>

<style> /* 原样样式 */ .ggl-root{width:375px;margin:auto;font-family:sans-serif;position:relative} .ggl-mask{position:absolute;inset:0;background:#000d;z-index:99;display:flex;align-items:center;justify-content:center} .ggl-start-btn{padding:12px 20px;font-size:16px}

.ggl-top{text-align:center;font-size:14px;margin-bottom:6px} .ggl-frame{padding:10px;border:3px solid #ff00aa;box-shadow:0 0 12px #ff00aa88} .ggl-ticket{position:relative;aspect-ratio:1075/1911} .ggl-bg{width:100%;display:block}

.ggl-scratch-area{position:absolute;left:10%;top:35%;width:80%;height:53%} .ggl-grid{display:grid;width:100%;height:100%;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(6,1fr);gap:6px}

.ggl-cell{position:relative;overflow:hidden} .ggl-cell img,.ggl-cover{position:absolute;inset:0;width:100%;height:100%} .ggl-cover{

 background:url("180px-%E5%88%AE%E5%BC%80%E5%89%8D.png") center/cover;
 cursor:pointer

} .ggl-reward{

 position:absolute;inset:0;
 display:flex;align-items:center;justify-content:center;
 font-size:12px;font-weight:bold;pointer-events:none

}

.ggl-mascot{position:absolute;left:6%;top:107%} .ggl-bubble{position:absolute;left:6%;top:103%;width:60%;background:#fff;padding:6px;font-size:13px} .ggl-controls{position:absolute;right:6%;top:103%}

  1. ggl-scan{opacity:.3}
  2. ggl-scan.active{opacity:1}

.ggl-redeem-hit{

 position:absolute;bottom:1%;left:2%;
 width:48%;height:10%;
 background:transparent;border:none

}


  1. ggl-ending-container{
 max-width:800px;
 margin:18px auto;
 padding:12px;
 background:#fff;
 border:2px solid #ccc;
 box-shadow:0 6px 18px rgba(0,0,0,.08);
 font-family:inherit;
 line-height:1.5;

}

.mw-collapsible{overflow:hidden} .wikitable{border-collapse:collapse;width:100%} .wikitable th, .wikitable td{border:1px solid #aaa;padding:6px}

.poem{white-space:pre-wrap;font-family:serif;background:#f8f8f8;padding:8px;border-left:3px solid #ddd} </style>

<script> (function(){

const root = document.querySelector('.ggl-root'); const grid = document.querySelector('.ggl-grid'); const bubble = document.querySelector('.ggl-bubble'); const mascot = document.querySelector('.ggl-mascot'); const scan = document.getElementById('ggl-scan'); const leftEl = document.getElementById('ggl-left'); const dataEl = document.getElementById('ggl-data'); const mask = document.getElementById('ggl-mask'); const redeem = document.getElementById('ggl-redeem-hit');

const OPEN = 'https://wm.gaoice.run/images/thumb/4/4a/%E5%88%AE%E5%BC%80%E5%90%8E.jpg/180px-%E5%88%AE%E5%BC%80%E5%90%8E.jpg';

let idx = 0; let revealed = 0; let scanned = false; let finalized = false; let alertTimer = null; let redeemLocked = false;

const TICKETS = [ /* 1 */

 {left:2,data:0,mascot:'|ω`)',bubble:'你好呀,俺是负责播报结果的。不用管我。',onScan:'哇!中了25MB耶,回本了回本了。',rewards:{0:'畅',1:'舒',2:'遂',3:'顺',4:'达',5:'欢',6:'5',7:'欣',8:'怡',9:'和',10:'睦',11:'融',12:'洽',13:'美',14:'善',15:'吉',16:'昌',17:'20',18:'兴',19:'平',20:'安',21:'喜',22:'乐',23:'平',24:'安',25:'盛',26:'喜',27:'乐',28:'悦',29:'睦'}},

/* 2 */

 {left:1,data:25,mascot:'|∀`)ノ',bubble:'虽然好像彩票上下都没标,但是中奖金额的单位默认是MB哦~',onScan:'1MB,然后是……bingo!不对,“平安喜乐”!第二行,横着和斜着,两组!这就去给你加上!',rewards:{0:'遂',1:'舒',2:'达',3:'顺',4:'畅',5:'平',6:'安',7:'喜',8:'乐',9:'和',10:'睦',11:'安',12:'1',13:'美',14:'善',15:'吉',16:'昌',17:'喜',18:'盛',19:'兴',20:'欢',21:'平',22:'悦',23:'乐',24:'欣',25:'怡',26:'洽',27:'融',28:'欢',29:'怡'}},

/* 3 */

 {left:2,data:26,mascot:'|o`)',bubble:'耶咦耶咦耶咦耶奥🎶我们又能多相处一会儿了!',onScan:'让我看看,36MB,外加一张彩票!
(小声)这么好中,真的假的?都不用我……。',rewards:{0:'舒',1:'平',2:'场',3:'遂',4:'15',5:'欢',6:'安',7:'悦',8:'欣',9:'怡',10:'和',11:'喜',12:'睦',13:'融',14:'20',15:'洽',16:'美',17:'乐',18:'善',19:'吉',20:'昌',21:'盛',22:'兴',23:'16',24:'顺',25:'平',26:'安',27:'喜',28:'乐',29:'达'}},

/* 4 */

 {left:2,data:62,mascot:'|▽`)',bubble:'*suisuinian,sikaozijidenengli|_・)',onScan:'扫描完成:null。终于正常了嘛……
嘿嘿,果然还需要我来帮一把!',rewards:{0:'欣',1:'平',2:'怡',3:'畅',4:'舒',5:'安',6:'遂',7:'盛',8:'顺',9:'达',10:'和',11:'睦',12:'融',13:'喜',14:'洽',15:'美',16:'善',17:'吉',18:'昌',19:'乐',20:'兴',21:'欢',22:'平',23:'安',24:'悦',25:'喜',26:'乐',27:'融',28:'洽',29:'兴'}},

/* 5 */

 {left:2,data:62,mascot:'|д`)',bubble:'什么都没有。',onScan:'扫描完成:',rewards:{0:'欣',1:'平',2:'怡',3:'1',4:'舒',5:'安',6:'遂',7:'喜',8:'顺',9:'2',10:'和',11:'1',12:'融',13:'乐',14:'洽',15:'美',16:'善',17:'吉',18:'5',19:'昌',20:'盛',21:'兴',22:'欢',23:'悦',24:'1',25:'平',26:'乐',27:'畅',28:'达',29:'喜'}},

/* 6 */

 {left:1,data:5,mascot:'|??)',bubble:'不不不,我不是通过修改多添了一张票吗?为什么还是结束了?
我这是……我在……
不……不要……不要!!!',onScan:'A̜̤̓b̦̅́ǒ̮̚r̛̰̪t̗̗͂:̵̂̚ ů̡̪n̯̻͊r̥̂̀e̡̧̲s̴̬͋o̬̖̖l̴̻̚v̭̋̽a̫͈̅b̮̼̏l̟̊̀ȩ͎͌ s̱̭̙i̥̘͆t̡̥̔u̸̟̙a̤͊̓t̫̒́i̝̠̾o̺͉͂ǹ̲̎。',rewards:{0:'6',1:'顺',2:'6',3:'遂',4:'6',5:'6',6:'6',7:'6',8:'6',9:'6',10:'平',11:'6',12:'6',13:'6',14:'和',15:'平',16:'6',17:'6',18:'6',19:'和',20:'安',21:'6',22:'6',23:'6',24:'睦',25:'安',26:'6',27:'6',28:'6',29:'睦'}},

/* 7 */

 {left:0,data:5,mascot:,bubble:'
.̨̝̮̮͉̖̃̿̈́ͅ.̢̦̫͆͌͆͏̨̩͉.͏̤̫̣̎̆̃̾́ͅ.̧̖̻̥͈̥̈̂̌̒.̲̹́̋̄̐̈́ͅͅ͏.̡͇͈̣̓͌͌͌̂̓.̖̩͈̻̱̌͋͆̊̚.̮̦̝̼̤̮͈͂̆̑.̵̧̘̲̞̉͋̇͂̕.̢̨͌̿͏̖̳͌̓̎.̙̤̫͉̔͋̊̄̐ͅ.͏̶̺̦̲̝̍̈́͌̚.̳̜̼̼̻̹̐̃̈̑.̨̠͎̝̟̼͇̞̩̃.͎̟͉̠̫͉̜̿̈́̓.̷̛̜̦̩̼̎̏̈́͆.̡̨̢̭͇̣̿̓̏͏.̰̻͇͉̑̌̓̆̅̄.̅͏̺̫̱̯̳̹̓̏.̸̨̢̦̙͌̓̉̃̉.̨̛̻̬̈̔́̍̃͌.̝͈̠͇̣̭̐̈̓̍.̴͎̰̼̾͆̃̍̃̃.̛̼͉̝̃̔̆̆̽̚.̷̡̮̠̥̳̬̇̓̃.̞͎̗̀͂̌͊̂̈ͅ.̵̴̱̫̟̒̓̅͊̍.̮̺̠̯͉̊̅̓̀̓.̴̧̨̬̳̬́͋́̂.̤̠̲̍̓ͅ͏̶̾͏
',onScan:'扫描完成:无数据。',rewards:{0:'和',1:'睦',2:'融',3:'洽',4:'美',5:'善',6:'吉',7:'昌',8:'盛',9:'兴',10:'欢',11:'平',12:'悦',13:'顺',14:'欣',15:'怡',16:'安',17:'畅',18:'乐',19:'舒',20:'遂',21:'喜',22:'达',23:'平',24:'安',25:'喜',26:'乐',27:'欢',28:'悦',29:'欣'}},

/* 8 */

 {left:0,data:7,mascot:'|∀◕。)',bubble:'没素质啊,干嘛挠我',onScan:'jiuni?',rewards:{0:'美',1:'善',2:'吉',3:'昌',4:'盛',5:'兴',6:'平',7:'欢',8:'悦',9:'欣',10:'平',11:'安',12:'喜',13:'乐',14:'89',15:'畅',16:'喜',17:'32',18:'遂',19:'顺',20:'达',21:'乐',22:'睦',23:'融',24:'怡',25:'安',26:'和',27:'舒',28:'200',29:'洽'}},

/* 9 */

 {left:1,data:'—',mascot:'|',bubble:'▒▓░▒▓▒▓',onScan:'▒▓░▒▓▒▓▒▓3934181383533 + 793416……',rewards:{0:'17 Byte',1:'89 KB',2:'1023 MB',3:'457 GB',4:'781 bit',5:'902 TB',6:'314 Byte',7:'567 KB',8:'890 MB',9:'10 GB',10:'21 bit',11:'144 TB',12:'169 Byte',13:'196 KB',14:'225 MB',15:'256 GB',16:'289 bit',17:'3 Byte',18:'361 KB',19:'400 TB',20:'41 MB',21:'484 GB',22:'529 bit',23:'576 Byte',24:'625 KB',25:'676 TB',26:'729 MB',27:'84 GB',28:'841 bit',29:'900 Byte'}},

/* 10 */

 {left:0,data:'ERROR!',mascot:'|||',bubble:'你是谁?',onScan:'扫描结果:DATA 溢出。',rewards:{0:'D̸A̍T̴A̵',1:'D͊ẠT̿A̘',2:'D̐A̬T̰A̢',3:'D̶ÃT̚À',4:'D̜ǍT̘A͆',5:'D̝͏A̸̛T̞̩A͇̒',6:'D̵́A̵̗T̈̀Ȃ̐',7:'D̢̫A̬̾Ţ̏Ą̘',8:'D͇̉A̓̔T̜̿A̷̯',9:'D̦̽̂À͈͌T͍̟̋Å̟͇',10:'D̢͍ͅA̶̹̝Ṱ̑̏A̵̯̱',11:'D̠̖͆Â̛̲T̸̿̃Å̝̖',12:'Ḏ̨͍À̆̅T̫͂̐Ȧ̷̺',13:'D̮̱̽͆Ǎ̡̯̦Ț̡̓́À̝̹͋',14:'D̮̤̣͌Á̷̃́T̟̀̀͂Ả̷̺̂',15:'D̼̪̜̈A̷̮͍͆T̵̢̹̏A̩̪̹̦',16:'D̶̰̠̅́A͂̎̇̉̔T̨̡͈̃̅A̰͌͋̈́̑',17:'D̨̯̝̑̋A̫̱̋̐̅T̞̎͊̅̄A̦̳̣̿̚',18:'D̨̨̞̙̆À̟̻̌̓Ṱ̥̉̄ͅA̧̼̣̫͂',19:'D̖͏̯̃̽̃A̷͉̎̿̾̿T̊̀͏̺̩̘Á̟̲̦̿̔',20:'Ḑ̫̞̿̈̈́A̶̛̬͇̿͂T̨̬̦̺̀̉Á̗̠̋͂̃',21:'D̡̧̛̫̼̓A̛̅̂̊̑̽T̸̛̞͎̓̂Ȧ̠̟̪̑̀',22:'D̡̻͉̹̽̇͌Á͈̥̥́̈́̌T̪̮̍̒̏̎̚A̷̦͇̩̰͆͆',23:'D̸͇̠͍͍̓̈A͎̭̹̮͆͌́T̤̱̖̉̉̉̀A̺̬̤̺̯̚ͅ',24:'D̶̬̱̥̠̊̆A̴̪̙̜̽̆͊T̤͏̖̪̈́͌̃A̪̮̞̪̰͋͆',25:'D̴̢̼̗̝̊̋A̸̸̟͎̅̓̃T͇͈̗͇̱̓̐Ȁ̸̎̎̉̇́',26:'D̷̴̸̛̳̦͆Ǎ̷̳̤̱̯̄Ṫ̶̢̼͋̌̾A̡̢͍̮̓̆̚',27:'D̸̴̛̘̭̖̓A̵̡̢͉̫̒̓T̨̼̼̑̓͊̒Ä̦̪́̒̆̀̕',28:'Ḏ̸̨͊̍̍̎̍À̧͉̠̺̻͍̐T̷̡̤̳͊̃̓͆Â̢̟̤̹̯̅ͅ',29:'D̮̲̪̲̅́̊͌̾̎Ạ̧̤̩̥̦̒̂͊͏T̼̳̲̭̖̺̆́̀͏Â̴̢͎͍͈̥̾̾̀'}},

/* 11 */

 {left:'?̜̻̤̹́̂̈́̑̀?̢̥̯̓̈́̃̿̀̅?̵̡̹̯̠̉̅̃̃',data:'È̶̶̶̝͏̶̶̶̝̞R̶̶̶̶̶̶̝̬̩̦̈R̶̶̶̶̶̵̶̗̹̄̈Ơ̶̶̶̶̶̶̞̳̑̆R̶̶̼͏̶̴̶̶̶̢̲!̶̶̶̶̶̶̜̪̏̊̋',mascot:'平安喜乐',bubble:'你知道的太多了。',onScan:'权限越界。',rewards:{   0:'平',1:'安',2:'安',3:'平',4:'喜',5:'喜',6:'乐',7:'喜',8:'安',9:'平',10:'安',11:'平',12:'安',13:'喜',14:'乐',15:'乐',16:'喜',17:'平',18:'安',19:'安',20:'喜',21:'平',22:'乐',23:'乐',24:'平',25:'平',26:'安',27:'安',28:'喜',29:'乐'}}

];

function fadeOutCover(cover, done){

 const start = performance.now();
 const duration = 450;
 cover.style.pointerEvents = 'none';
 function frame(now){
   const p = Math.min((now - start) / duration, 1);
   cover.style.opacity = 1 - p;
   if(p < 1){
     requestAnimationFrame(frame);
   }else{
     cover.style.display = 'none';
     done && done();
   }
 }
 requestAnimationFrame(frame);

}

function build(){

 if(finalized) return;
 const t = TICKETS[idx];
 grid.innerHTML = ;
 revealed = 0;
 scanned = false;
 leftEl.textContent = t.left;
 dataEl.textContent = t.data;
 mascot.textContent = t.mascot || ;
 bubble.textContent = t.bubble || ;
 scan.textContent = '扫描结果';
 scan.classList.remove('active');
 for(let i=0;i<30;i++){
   const c = document.createElement('div');
   c.className = 'ggl-cell';
   c.innerHTML = `
     <img src="${OPEN}">
${t.rewards?.[i] || }
   `;
   const cover = c.querySelector('.ggl-cover');
   cover.onclick = ()=>{
     if(c.dataset.done || finalized) return;
     c.dataset.done = 1;
     fadeOutCover(cover, ()=>{
       if(++revealed === 30){
         scan.classList.add('active');
       }
     });
   };
   grid.appendChild(c);
 }

}

function startInfiniteAlert(){

 if(alertTimer) return;
 const TEXT = '冲刺!冲刺!';
 (function loop(){
   alert(TEXT);
   alertTimer = setTimeout(loop, 200);
 })();

}

function showRedeemModal(){

 if(redeemLocked) return;
 redeemLocked = true;
 const overlay = document.createElement('div');
 overlay.style.cssText = `
   position:absolute;
   inset:0;
   background:rgba(0,0,0,.7);
   z-index:999;
   display:flex;
   align-items:center;
   justify-content:center;
 `;
 const box = document.createElement('div');
 box.style.cssText = `
   background:#fff;
   padding:20px;
   width:70%;
   text-align:center;
   font-size:14px;
 `;
 box.textContent = '无法兑奖';
 overlay.appendChild(box);
 document.querySelector('.ggl-ticket').appendChild(overlay);
 setTimeout(()=>{
   box.innerHTML = `
系统已记录
给你一张彩票
   `;
   const btn = document.createElement('button');
   btn.textContent = '确定';
   btn.style.marginTop = '12px';
   btn.onclick = ()=>{
     overlay.remove();
     redeemLocked = false;
     idx = 10;
     build();
   };
   box.appendChild(btn);
 }, 2200);

}

const INTERNAL_WIKITEXT = `

收藏品

冲刺!冲刺!
收集时间:?
ottootto。

`;

function parseWikiToHtml(wikitext){

 let text = wikitext.replace(/\r\n/g, '\n');

// 1) 处理

 ...

 text = text.replace(/<poem>([\s\S]*?)<\/poem>/gi, function(_, inner){
   // 保留换行
   const safe = escapeHtml(inner.trim());

return `

${safe}

`;

 });
 // 2) 处理 标题 == ... ==
 text = text.replace(/^==\s*(.+?)\s*==$/gm, function(_, t){

return `

${escapeHtml(t)}

`;

 });
 // 3) 处理表格块 {|| ... |}
 text = text.replace(/\{\|([\s\S]*?)\|\}/g, function(_, tableBody){
   // 处理每一行
   const lines = tableBody.split('\n').map(l=>l.trim()).filter(l=>l.length>0);

let html = '

'; let inRow = false; for(let i=0;i<lines.length;i++){ const line = lines[i]; if(line.startsWith('!')){ // header cell(s), can be multiple separated by !! const cells = line.slice(1).split('!!').map(s=>s.trim()); html += '<thead>'; cells.forEach(c=> html += ``); html += '</thead>'; }else if(line === '|-'){ // new row if(inRow) html += ''; html += ''; inRow = true; }else if(line.startsWith('|')){ // cell content, may be single cell or multiple with || const content = line.slice(1); const cells = content.split('||').map(s=>s.trim()); cells.forEach(c=> html += ``);
     }else{
       // fallback: plain row cell
html += ``;
     }
   }
if(inRow) html += ''; html += '
${escapeHtml(c)}
${escapeHtml(c)}
${escapeHtml(line)}

';

   return html;
 });
 // 4) 其余换行转段落(简单处理)

text = text.replace(/\n{2,}/g, '

'); text = '

' + text + '

';

 // 清理空段落

text = text.replace(/

\s*<\/p>/g, ); return text; } function escapeHtml(s){ return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); } /* ===== 终局:隐藏微件并插入解析后的 HTML ===== */ function triggerFinal(){ if(finalized) return; finalized = true; try{ document.body.style.filter = 'invert(1)'; }catch(e){} if(root) root.style.display = 'none'; // 解析内置 wiki 文本并插入 const html = parseWikiToHtml(INTERNAL_WIKITEXT); const container = document.createElement('div'); container.id = 'ggl-ending-container'; container.innerHTML = html; if(root && root.parentNode){ root.parentNode.insertBefore(container, root.nextSibling); }else{ document.body.appendChild(container); } } /* ===== 交互逻辑 ===== */ scan.onclick = ()=>{ if(!scan.classList.contains('active') || finalized) return; if(idx === 9 && revealed === 30){ startInfiniteAlert(); return; } if(idx === 10 && revealed === 30){ triggerFinal(); return; } if(!scanned){ scanned = true; bubble.textContent = TICKETS[idx].onScan; scan.textContent = '再来一张'; return; } idx++; build(); }; redeem.onclick = ()=>{ if(idx === 9 && revealed === 30){ showRedeemModal(); } }; mask.onclick = ()=>{ mask.remove(); build(); }; document.addEventListener('keydown',e=>{ if(finalized) return; if(e.shiftKey && e.key.toLowerCase()==='d'){ grid.querySelectorAll('.ggl-cover').forEach(c=>c.style.display='none'); revealed = 30; scan.classList.add('active'); } }); if(!mask){ build(); } })(); </script>