微件:GGLScratchGame:修订间差异

来自Limbo Wiki Mirror
Gaoice留言 | 贡献
无编辑摘要
标签(旧)WikiEditor
无编辑摘要
标签(旧)WikiEditor
 
(未显示2个用户的63个中间版本)
第1行: 第1行:
<noinclude>
<div class="ggl-root" id="ggl-root">
== 刮刮乐重构版 ==
 
调用方式:
  <!-- 初始化遮罩 -->
<pre>
  <div class="ggl-mask" id="ggl-mask">
{{#widget:GGLScratchGame
    <button class="ggl-start-btn">来一张彩票…<br>…不,三张吧</button>
|bg=图片1.png
  </div>
|cover=图片2.png
 
|revealed=图片3.png
  <!-- 顶部 -->
}}
  <div class="ggl-top">
</pre>
    <div class="ggl-rule">
</noinclude>
      刮开奖券 · 在整张刮完后交由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 class="ggl-frame">
    <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">
        <button id="ggl-scan">扫描结果</button>
      </div>
 
    </div>
  </div>
</div>


<includeonly>
<style>
<style>
/* === 核心容器 === */
/* 原样样式 */
.ggl-game-root {
.ggl-root{width:375px;margin:auto;font-family:sans-serif;position:relative}
    max-width: 400px; /* 限制最大显示宽度,防止在大屏太巨大 */
.ggl-mask{position:absolute;inset:0;background:#000d;z-index:99;display:flex;align-items:center;justify-content:center}
    margin: 20px auto;
.ggl-start-btn{padding:12px 20px;font-size:16px}
    font-family: 'Courier New', monospace;
 
    user-select: none;
.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
}
}


.game-header {
.ggl-mascot{position:absolute;left:6%;top:107%}
    text-align: center;
.ggl-bubble{position:absolute;left:6%;top:103%;width:60%;background:#fff;padding:6px;font-size:13px}
    color: #555;
.ggl-controls{position:absolute;right:6%;top:103%}
    margin-bottom: 10px;
#ggl-scan{opacity:.3}
    font-weight: bold;
#ggl-scan.active{opacity:1}
 
.ggl-redeem-hit{
  position:absolute;bottom:1%;left:2%;
  width:48%;height:10%;
  background:transparent;border:none
}
}


/* === 彩票视觉部分 === */
 
.ticket-wrapper {
#ggl-ending-container{
    position: relative;
  max-width:800px;
    width: 100%;
  margin:18px auto;
    /* 核心:保持 1075:1911 的宽高比 */
  padding:12px;
    padding-bottom: 177.76%;  
  background:#fff;
    background-size: 100% 100%;
  border:2px solid #ccc;
    background-repeat: no-repeat;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  font-family:inherit;
    border-radius: 8px;
  line-height:1.5;
}
}


/* === 刮奖区定位 (关键) === */
.mw-collapsible{overflow:hidden}
.scratch-grid-overlay {
.wikitable{border-collapse:collapse;width:100%}
    position: absolute;
.wikitable th, .wikitable td{border:1px solid #aaa;padding:6px}
    /* 以下百分比是根据 1075x1911 图和 846x1020 区域计算得出 */
 
    width: 78.7%;   /* 846 / 1075 */
.poem{white-space:pre-wrap;font-family:serif;background:#f8f8f8;padding:8px;border-left:3px solid #ddd}
    height: 53.4%;  /* 1020 / 1911 */
</style>
    left: 10.65%;  /* (100% - 78.7%) / 2 */
 
    top: 34%;      /* 估算黄色区域距离顶部的距离,可根据实际效果微调 */
<script>
   
(function(){
    display: grid;
 
    grid-template-columns: repeat(5, 1fr);
const root  = document.querySelector('.ggl-root');
    grid-template-rows: repeat(6, 1fr);
const grid  = document.querySelector('.ggl-grid');
    /* 消除格子间隙,因为你的图是连续的 */
const bubble = document.querySelector('.ggl-bubble');
    gap: 0;  
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){
.grid-cell {
  const start = performance.now();
    width: 100%;
  const duration = 450;
    height: 100%;
  cover.style.pointerEvents = 'none';
     background-size: 100% 100%; /* 强制图片拉伸填满格子 */
  function frame(now){
     background-repeat: no-repeat;
     const p = Math.min((now - start) / duration, 1);
      
     cover.style.opacity = 1 - p;
    display: flex;
     if(p < 1){
     align-items: center;
      requestAnimationFrame(frame);
    justify-content: center;
     }else{
    cursor: pointer;
      cover.style.display = 'none';
   
      done && done();
    /* 初始文字透明 (刮开前看不到字) */
     }
    color: transparent;  
  }
     font-weight: bold;
  requestAnimationFrame(frame);
    font-size: 14px;
    /* 文字描边,防止在复杂背景看不清 */
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff;  
}
}


/* 刮开后的状态 */
function build(){
.grid-cell.revealed {
  if(finalized) return;
    cursor: default;
  const t = TICKETS[idx];
    color: #d32f2f; /* 刮开后文字颜色 */
  grid.innerHTML = '';
}
  revealed = 0;
  scanned = false;


/* === 底部控制区 (重写布局) === */
  leftEl.textContent = t.left;
.controls-area {
  dataEl.textContent = t.data;
    margin-top: 15px;
  mascot.textContent = t.mascot || '';
    display: flex;
  bubble.textContent = t.bubble || '';
    justify-content: space-between; /* 左右分布 */
    align-items: flex-end;
}


/* 左侧:气泡+颜文字 */
  scan.textContent = '扫描结果';
.mascot-box {
  scan.classList.remove('active');
    flex: 1;
    text-align: left;
    margin-right: 10px;
}
.speech-bubble {
    background: #fff;
    border: 1px solid #333;
    border-radius: 8px 8px 8px 0;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 5px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    min-height: 20px;
    line-height: 1.3;
}
.mascot-face {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-left: 5px;
}


/* 右侧:按钮 */
  for(let i=0;i<30;i++){
.action-btn {
     const c = document.createElement('div');
    padding: 0 20px;
     c.className = 'ggl-cell';
     height: 40px;
     c.innerHTML = `
     font-size: 14px;
      <img src="${OPEN}">
     background: #2196F3;
      <div class="ggl-reward">${t.rewards?.[i] || ''}</div>
    color: white;
      <div class="ggl-cover"></div>
    border: none;
     `;
    border-radius: 5px;
     const cover = c.querySelector('.ggl-cover');
     cursor: pointer;
     cover.onclick = ()=>{
     box-shadow: 2px 2px 0 #000;
      if(c.dataset.done || finalized) return;
     white-space: nowrap;
      c.dataset.done = 1;
}
      fadeOutCover(cover, ()=>{
.action-btn:active {
        if(++revealed === 30){
    transform: translate(2px, 2px);
          scan.classList.add('active');
    box-shadow: none;
        }
}
      });
.action-btn:disabled {
     };
     background: #ccc;
     grid.appendChild(c);
     box-shadow: none;
  }
}
}
.action-btn.next { background: #4CAF50; }
.action-btn.danger { background: #000; color: red; border: 1px solid red; }


/* 结局特效 */
function startInfiniteAlert(){
.invert-filter { filter: invert(100%); background: black !important; }
  if(alertTimer) return;
.crash-screen {
  const TEXT = '冲刺!冲刺!';
     position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  (function loop(){
     background: black; color: red; z-index: 99999;
     alert(TEXT);
    display: flex; align-items: center; justify-content: center;
     alertTimer = setTimeout(loop, 200);
    font-size: 30px;
  })();
}
}
</style>


<!-- HTML 结构 -->
function showRedeemModal(){
<div class="ggl-game-root" id="ggl-root">
  if(redeemLocked) return;
    <div class="game-header">
  redeemLocked = true;
        GGL-LOTTERY | 剩余: <span id="count-val">3</span>
    </div>


    <!-- 1. 彩票底图层 -->
  const overlay = document.createElement('div');
    <!-- 用 data-* 属性存放参数,避免style属性中的模板解析失败 -->
  overlay.style.cssText = `
    <div class="ticket-wrapper" id="ticket-bg" data-bg="{{{bg|图片1.png}}}" data-cover="{{{cover|刮开前.png}}}" data-revealed="{{{revealed|刮开后.jpg}}}">
    position:absolute;
       
    inset:0;
        <!-- 2. 刮奖区覆盖层 (绝对定位) -->
    background:rgba(0,0,0,.7);
        <div class="scratch-grid-overlay" id="scratch-grid">
    z-index:999;
            <!-- JS 生成格子 -->
    display:flex;
        </div>
    align-items:center;
    justify-content:center;
  `;


        <!-- ID 显示 (可选,定位在右上角或哪里,这里为了简洁先隐藏或微调) -->
  const box = document.createElement('div');
        <div style="position: absolute; top: 2%; right: 5%; color: white; font-weight: bold; font-size: 12px;">
  box.style.cssText = `
            NO.<span id="ticket-id">001</span>
    background:#fff;
        </div>
    padding:20px;
    </div>
    width:70%;
    text-align:center;
    font-size:14px;
  `;
  box.textContent = '无法兑奖';


    <!-- 3. 底部控制 -->
  overlay.appendChild(box);
    <div class="controls-area">
  document.querySelector('.ggl-ticket').appendChild(overlay);
        <div class="mascot-box">
            <div class="speech-bubble" id="mascot-text">请刮开所有区域...</div>
            <div class="mascot-face" id="mascot-face">(・ω・)</div>
        </div>
        <button id="main-btn" class="action-btn">扫描结果</button>
    </div>
</div>


<!-- 伪词条 -->
  setTimeout(()=>{
<div id="fake-wiki-entry" style="display:none; padding:20px; background:#fff; border:1px solid #ccc; max-width:800px; margin:20px auto;">
    box.innerHTML = `
    <h1 style="border-bottom: 1px solid #aaa;">六世恶言</h1>
      <div>系统已记录</div>
     <div style="margin-top:10px;">
      <div>给你一张彩票</div>
        <p><b>描述:</b>“六世恶言”是一种具有高度认知危害的网络异常...</p>
     `;
        <hr>
    const btn = document.createElement('button');
        <p><b>收藏品3:</b> [回复] <b>“它是我藏在赛博刮刮乐内的,是被惩罚的人。”</b></p>
    btn.textContent = '确定';
     </div>
    btn.style.marginTop = '12px';
</div>
    btn.onclick = ()=>{
      overlay.remove();
      redeemLocked = false;
      idx = 10;
      build();
    };
     box.appendChild(btn);
  }, 2200);
}


<script>
const INTERNAL_WIKITEXT = `
(function() {
== 收藏品 ==
    var root = document.getElementById('ggl-root');
冲刺!冲刺!
    if (!root) return;
收集时间:?
ottootto。


    // ===== 参数提取 =====
`;
    // 方法1: 从URL查询参数提取(备用)
    var params = new URLSearchParams(window.location.search);
    var imgBg = params.get('bg') || 'File:图片1.png';
    var imgCover = params.get('cover') || 'File:刮开前.png';
    var imgRevealed = params.get('revealed') || 'File:刮开后.jpg';
   
    // 确保使用File:前缀格式
    if (imgBg && !imgBg.startsWith('http') && !imgBg.startsWith('File:')) imgBg = 'File:' + imgBg;
    if (imgCover && !imgCover.startsWith('http') && !imgCover.startsWith('File:')) imgCover = 'File:' + imgCover;
    if (imgRevealed && !imgRevealed.startsWith('http') && !imgRevealed.startsWith('File:')) imgRevealed = 'File:' + imgRevealed;
   
    // 方法2: 如果有全局widget参数对象,尝试从中读取
    if (window.gglParams) {
        imgBg = window.gglParams.bg || imgBg;
        imgCover = window.gglParams.cover || imgCover;
        imgRevealed = window.gglParams.revealed || imgRevealed;
    }
   
    // 方法3: 尝试从第一个script标签的data属性读取
    var scriptTag = document.currentScript || document.scripts[document.scripts.length - 1];
    if (scriptTag) {
        imgBg = scriptTag.getAttribute('data-bg') || imgBg;
        imgCover = scriptTag.getAttribute('data-cover') || imgCover;
        imgRevealed = scriptTag.getAttribute('data-revealed') || imgRevealed;
    }


    // 应用背景图
function parseWikiToHtml(wikitext){
    var elTicketBg = document.getElementById('ticket-bg');
  let text = wikitext.replace(/\r\n/g, '\n');
    if (elTicketBg && imgBg) {
        elTicketBg.style.backgroundImage = "url('" + imgBg + "')";
    }
   
    // 调试:打印最终获取的参数
    console.log('Widget参数:', { imgBg, imgCover, imgRevealed });
    var TOTAL_CARDS = 11;
    var currentIdx = 0;
    var remain = 3;
    var isScanned = false;
    var revealedCount = 0;


    // DOM
  // 1) 处理 <poem> ... </poem>
    var elCount = root.querySelector('#count-val');
  text = text.replace(/<poem>([\s\S]*?)<\/poem>/gi, function(_, inner){
    var elGrid = root.querySelector('#scratch-grid');
     // 保留换行
     var elBtn = root.querySelector('#main-btn');
     const safe = escapeHtml(inner.trim());
     var elBubble = root.querySelector('#mascot-text');
     return `<div class="poem">${safe}</div>`;
    var elFace = root.querySelector('#mascot-face');
  });
     var elId = root.querySelector('#ticket-id');
    var elFakeEntry = document.getElementById('fake-wiki-entry');


    // 数据
  // 2) 处理 标题 == ... ==
    var cards = [
  text = text.replace(/^==\s*(.+?)\s*==$/gm, function(_, t){
        { type: 'n', face: '', text: '结果:谢谢惠顾。' },
    return `<h2>${escapeHtml(t)}</h2>`;
        { type: 'n', face: '(・ω・)', text: '检测到异常字符。' },
  });
        { type: 'b', face: '(^▽^)', text: '恭喜!触发连击,奖励+2张!' },
        { type: 'n', face: 'o(*≧▽≦)ツ', text: '结果:1 Data 2。好耶!' },
        { type: 'c', face: '( ・_・)', text: '结果:中奖...?数据好像变了。' },
        { type: 'x', face: '', text: '对象已消失。', val: 'Data' },
        { type: 'g', face: '...', text: 'ERR_#0x00 数据损坏', val: '???' },
        { type: 'p', face: '', text: '声音检测:"好痛!"', val: 'Pain' },
        { type: 't', face: '', text: '收到文本:"你是谁?"', val: 'Info' },
        { type: 's', face: '', text: '警告:立即停止操作。', val: '停下' },
        { type: 'f', face: 'ERROR', text: '你知道的太多了。', val: '平安喜乐' }
    ];


    function setMascot(txt, face) {
  // 3) 处理表格块 {|| ... |}
         if(txt) elBubble.innerText = txt;
  text = text.replace(/\{\|([\s\S]*?)\|\}/g, function(_, tableBody){
         if(face !== undefined) elFace.innerText = face;
    // 处理每一行
    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;
  });
  // 4) 其余换行转段落(简单处理)
  text = text.replace(/\n{2,}/g, '</p><p>');
  text = '<p>' + text + '</p>';
  // 清理空段落
  text = text.replace(/<p>\s*<\/p>/g, '');
  return text;
}


    function randVal() {
function escapeHtml(s){
        var arr = ['10mb', '50Gb', '5Kb', '1Tb', '福', '寿', '乐', '奖', '空'];
  return s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
        return arr[Math.floor(Math.random() * arr.length)];
}
    }


    function initCard(idx) {
/* ===== 终局:隐藏微件并插入解析后的 HTML ===== */
        isScanned = false;
function triggerFinal(){
        revealedCount = 0;
  if(finalized) return;
        elBtn.innerText = "扫描结果";
  finalized = true;
        elBtn.className = "action-btn";
        elBtn.disabled = false;
        elBtn.style = "";


        elId.innerText = (idx+1).toString().padStart(3,'0');
  try{ document.body.style.filter = 'invert(1)'; }catch(e){}
        elCount.innerText = remain;
  if(root) root.style.display = 'none';


        var d = cards[idx];
  // 解析内置 wiki 文本并插入
        elGrid.innerHTML = '';
  const html = parseWikiToHtml(INTERNAL_WIKITEXT);
        setMascot("请刮开所有区域...", d.face);
  const container = document.createElement('div');
  container.id = 'ggl-ending-container';
  container.innerHTML = html;


        if(d.type === 's') { // Stop
  if(root && root.parentNode){
            elBtn.style.border = "2px solid red";
    root.parentNode.insertBefore(container, root.nextSibling);
            elBtn.style.color = "red";
  }else{
        }
    document.body.appendChild(container);
  }
}


        for(var i=0; i<30; i++) {
/* ===== 交互逻辑 ===== */
            var cell = document.createElement('div');
scan.onclick = ()=>{
            cell.className = 'grid-cell';
  if(!scan.classList.contains('active') || finalized) return;
           
            // 1. 设置刮开前的图 (覆盖层)
            cell.style.backgroundImage = "url('" + imgCover + "')";


            // 决定内容
  if(idx === 9 && revealed === 30){
            var val = d.val ? d.val : randVal();
    startInfiniteAlert();
            if(idx === 2 && (i===10 || i===11)) val = "大奖";
    return;
            if(idx === 8) val = "你是谁";
  }


            cell.dataset.val = val;
  if(idx === 10 && revealed === 30){
    triggerFinal();
    return;
  }


            // 点击事件
  if(!scanned){
            (function(c, cIdx, cVal, idxI){
    scanned = true;
                c.addEventListener('click', function() {
    bubble.textContent = TICKETS[idx].onScan;
                    if(c.classList.contains('revealed') || isScanned) return;
    scan.textContent = '再来一张';
                   
    return;
                    // 2. 切换为刮开后的图
  }
                    c.classList.add('revealed');
                    c.style.backgroundImage = "url('" + imgRevealed + "')";
                    c.innerText = cVal; // 显示文字
                   
                    revealedCount++;


                    // 剧情触发
  idx++;
                    if(cIdx === 5) { // 消失
  build();
                        setMascot(["别点了","我在看你"][Math.floor(Math.random()*2)], "");
};
                        c.innerText = "";
                    }
                    if(cIdx === 7) { // 痛
                        c.innerText = ["痛!","别!"][Math.floor(Math.random()*2)];
                        c.style.color = "red";
                        setMascot("别挠我!", ">_<");
                    }
                    if(cIdx === 4 && revealedCount === 15) { // 改字
                        setMascot("诶...?", "(;゚д゚)");
                        if(elGrid.children[29]) {
                            elGrid.children[29].dataset.val = "中奖";
                        }
                    }
                });
            })(cell, idx, val, i);


            elGrid.appendChild(cell);
redeem.onclick = ()=>{
        }
  if(idx === 9 && revealed === 30){
    }
    showRedeemModal();
  }
};


    elBtn.addEventListener('click', function() {
mask.onclick = ()=>{
        if(isScanned) {
  mask.remove();
            // Next
  build();
            currentIdx++;
};
            if(currentIdx < TOTAL_CARDS) initCard(currentIdx);
        } else {
            // Scan
            if(revealedCount < 30 && currentIdx < 9) {
                if(!confirm("还没刮完,确定扫描吗?")) return;
            }
           
            var d = cards[currentIdx];
            isScanned = true;
            elBtn.innerText = "扫描中...";
           
            setTimeout(function(){
                setMascot(d.text);
               
                if(d.type === 'b') { remain += 2; elCount.innerText = remain; }
                if(d.type === 'f') { doEnd(); return; }
                if(d.type === 's') {
                    setTimeout(function(){
                        setMascot("严重错误。排出异物...");
                        elBtn.innerText = "取出未知票据";
                        elBtn.className = "action-btn danger";
                    }, 800);
                    return;
                }


                remain--;
document.addEventListener('keydown',e=>{
                elCount.innerText = remain;
  if(finalized) return;
                if(remain < 0) {
  if(e.shiftKey && e.key.toLowerCase()==='d'){
                    setMascot("票据耗尽。");
    grid.querySelectorAll('.ggl-cover').forEach(c=>c.style.display='none');
                    elBtn.disabled = true;
    revealed = 30;
                    return;
    scan.classList.add('active');
                }
  }
                elBtn.innerText = "再来一张";
});
                elBtn.classList.add('next');
            }, 500);
        }
    });


    function doEnd() {
if(!mask){
        document.body.classList.add('invert-filter');
  build();
        setTimeout(function(){
}
            var div = document.createElement('div');
            div.className = 'crash-screen';
            div.innerText = "FATAL ERROR";
            document.body.appendChild(div);
            setTimeout(function(){
                div.remove();
                document.body.classList.remove('invert-filter');
                root.style.display = 'none';
                if(elFakeEntry) elFakeEntry.style.display = 'block';
                window.scrollTo(0,0);
                alert("【系统提示】收到新短信。");
            }, 3000);
        }, 1500);
    }


    initCard(0);
})();
})();
</script>
</script>
</includeonly>

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>