更多操作
Xp00000000(留言 | 贡献) 小无编辑摘要 |
Xp00000000(留言 | 贡献) 小无编辑摘要 |
||
(未显示同一用户的13个中间版本) | |||
第1行: | 第1行: | ||
<html> | <html> | ||
<script> | <script> | ||
function | // 切换难度(EZ 1 / HD 6 / IN 9) | ||
const states = JSON.parse(element.dataset.states | function cycleDifficulty(element) { | ||
const currentIndex = parseInt(element.dataset.current | 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; | ||
element.textContent = states[nextIndex]; | element.textContent = states[nextIndex]; | ||
element.dataset.current = nextIndex; | element.dataset.current = nextIndex; | ||
updateOutput(); // 更新输出 | |||
} | |||
// 切换比例(4:3 / 16:9) | |||
function cycleRatio(element) { | |||
const states = JSON.parse(element.dataset.states); | |||
const currentIndex = parseInt(element.dataset.current); | |||
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 output = outputRules[difficulty]?.[ratio] || "Unknown"; | |||
document.getElementById("output").textContent = output; | |||
} | } | ||
</script> | </script> | ||
<table width="100%" style="border:none; border-collapse:collapse;"> | |||
<div onclick=" | <tr> | ||
<td colspan="2" style="text-align:center; background-color:#A9FBFF;"><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></td> | ||
</tr> | |||
<tr> | |||
<td width="15%" height="300px" style="text-align:center; background-color:#ABCDEF;"><div id="ratio" onclick="cycleRatio(this)" | |||
data-states='["4:3", "16:9"]' data-current="0" style="cursor:pointer;"> | |||
4:3 | |||
</div></td> | |||
<td><span id="output">111aaa</span></td> | |||
</tr> | |||
</table> | |||
</html> | </html> |
2025年7月5日 (六) 10:45的最新版本
EZ 1
|
|
4:3
|
111aaa |