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

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

来自Rizline中文维基
Xp00000000留言 | 贡献
无编辑摘要
Xp00000000留言 | 贡献
无编辑摘要
第70行: 第70行:
<html>
<html>
<script>
<script>
function cycleTextData(element) {
// 切换难度(EZ 1 / HD 6 / IN 9)
   const states = JSON.parse(element.dataset.states || '["A", "B", "C"]');
function cycleDifficulty(element) {
   const currentIndex = parseInt(element.dataset.current || 0);
   const states = JSON.parse(element.dataset.states);
   const currentIndex = parseInt(element.dataset.current);
   const nextIndex = (currentIndex + 1) % states.length;
   const nextIndex = (currentIndex + 1) % states.length;
    
    
第78行: 第79行:
   element.dataset.current = nextIndex;
   element.dataset.current = nextIndex;
    
    
  // 根据当前文本更新另一个位置的输出
   updateOutput(); // 更新输出
   updateOutput(element.textContent);
}
}


function updateOutput(currentText) {
// 切换比例(4:3 / 16:9)
   const outputMap = {
function cycleRatio(element) {
     "EZ 1": "aaa",
  const states = JSON.parse(element.dataset.states);
     "HD 6": "bbb",
  const currentIndex = parseInt(element.dataset.current);
     "IN 9": "ccc"
  const nextIndex = (currentIndex + 1) % states.length;
 
  element.textContent = states[nextIndex];
  element.dataset.current = nextIndex;
 
  updateOutput(); // 更新输出
}
 
// 根据当前难度和比例更新输出
function updateOutput() {
   const difficulty = document.getElementById("difficulty").textContent;
  const ratio = document.getElementById("ratio").textContent;
 
  // 定义输出规则
  const outputRules = {
     "EZ 1": { "4:3": "111aaa", "16:9": "222aaa" },
     "HD 6": { "4:3": "111bbb", "16:9": "222bbb" },
     "IN 9": { "4:3": "111ccc", "16:9": "222ccc" }
   };
   };
    
    
   const outputElement = document.getElementById("output");
  // 获取当前输出
  outputElement.textContent = outputMap[currentText] || "Unknown";
   const output = outputRules[difficulty]?.[ratio] || "Unknown";
  document.getElementById("output").textContent = output;
}
}
</script>
</script>


<div onclick="cycleTextData(this)" data-states='["EZ 1", "HD 6", "IN 9"]'  
<!-- 难度选择(EZ 1 / HD 6 / IN 9) -->
    data-current="0" style="cursor:pointer;">
<div id="difficulty" onclick="cycleDifficulty(this)"  
    data-states='["EZ 1", "HD 6", "IN 9"]' data-current="0" style="cursor:pointer;">
   EZ 1
   EZ 1
</div>
</div>


<!-- 这里显示动态输出 -->
<!-- 比例选择(4:3 / 16:9) -->
<p>当前输出: <span id="output">aaa</span></p>
<div id="ratio" onclick="cycleRatio(this)"
    data-states='["4:3", "16:9"]' data-current="0" style="cursor:pointer;">
  4:3
</div>
 
<!-- 输出结果 -->
<p>当前输出: <span id="output">111aaa</span></p>
</html>
</html>

2025年7月5日 (六) 10:11的版本

EZ 1
4:3
abc

EZ 1
4:3
a_ccc_1234.png


EZ 1
4:3

当前输出: 111aaa