打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

用户:Xp00000000/Sandbox:修订间差异

来自Rizline中文维基
 
(未显示同一用户的20个中间版本)
第1行: 第1行:
<html>
{{Infobox
<script>
|name  = SongInfo1
function cycleText(element) {
|state =
   const states = ["状态A", "状态B", "状态C"]; // 定义所有状态
|title = 详细信息
  const currentText = element.textContent.trim();
|headerstyle = background:#0055FF;
 
|labelstyle  = background:#00FF00;
  // 获取当前状态的索引
|label1  = 预览时间
   let currentIndex = states.indexOf(currentText);
|data1    = 114.5s-191.9s
  if(currentIndex === -1) currentIndex = 0;
|label2  = Riztime时间
 
|data2    = 100.1s-100.3s<br>100.6s-101.5s<br>166.7s-185.0s<br>200.0s-215.8s
  // 计算下一个状态索引(循环)
|header3  = 主题颜色
  const nextIndex = (currentIndex + 1) % states.length;
|label4   = 常规主题
    
|data4    = <span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span>
  // 更新文本
|label5   = Riztime主题1
  element.textContent = states[nextIndex];
|data5    = <span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span>
 
|label6   = Riztime主题2
  // 可选:存储当前状态(需要唯一ID)
|data6    = <span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span>
  if(element.id) {
|label7   = Riztime主题3
    localStorage.setItem('textState_' + element.id, nextIndex);
|data7    = <span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span>
  }
|label8   = Riztime主题4
}
|data8    = <span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span><br><span style="display: inline-block;width: 30px;height: 30px;background: #000000;color: white;"></span><span style="position: relative; left: 10px; top: -8px;"><big>#000000</big></span>
 
|header9  = 谱面信息
// 初始化恢复状态
|header10  = Tap/Drag/Hold
document.addEventListener('DOMContentLoaded', function() {
|label11  = {{diff|EZ|1}}
  const element = document.getElementById('cycleDemo');
|data11    = 25/35/45
   if(element && element.id) {
|label12   = {{diff|HD|5}}
    const savedIndex = localStorage.getItem('textState_' + element.id);
|data12    = 114/124/134
    if(savedIndex !== null) {
|label13  = {{diff|IN|9}}
      const states = ["状态A", "状态B", "状态C"];
|data13    = 350/234/233
      element.textContent = states[parseInt(savedIndex)];
|header14  = 线条数
    }
|label15  = {{diff|EZ|1}}
   }
|data15    = 250
});
|label16  = {{diff|HD|5}}
</script>
|data16    = 368
 
|label17  = {{diff|IN|9}}
<div id="cycleDemo" onclick="cycleText(this)"  
|data17    = 1145
    style="cursor:pointer; padding:10px; background:#f0f0f0; display:inline-block;">
}}
   状态A
</div>
</html>

2025年10月23日 (四) 13:53的最新版本

详细信息
预览时间 114.5s-191.9s
Riztime时间 100.1s-100.3s
100.6s-101.5s
166.7s-185.0s
200.0s-215.8s
主题颜色
常规主题 #000000
#000000
#000000
Riztime主题1 #000000
#000000
#000000
Riztime主题2 #000000
#000000
#000000
Riztime主题3 #000000
#000000
#000000
Riztime主题4 #000000
#000000
#000000
谱面信息
Tap/Drag/Hold
EZ 1 25/35/45
HD 5 114/124/134
IN 9 350/234/233
线条数
EZ 1 250
HD 5 368
IN 9 1145