版面切换改为直接显示3种

This commit is contained in:
枫谷剑仙 2024-04-19 01:19:01 +08:00
parent 543b1e757b
commit 07639b02ff
3 changed files with 20 additions and 25 deletions

View File

@ -130,32 +130,26 @@ class BoardSet
})();
constructor(...boards) {
const boardSet = this;
const switchFunction = function(event){ //在65、76、54之间循环切换
if (event.ctrlKey) {
boardSet.boards.forEach(board=>board.tableNode.classList.remove(className_displayNone));
return;
}
let showIdx = boardSet.boards.findIndex(board=>!board.tableNode.classList.contains(className_displayNone));
showIdx = (showIdx + 1) % boardSet.boards.length;
for (let i=0;i<boardSet.boards.length;i++) {
boardSet.boards[i].tableNode.classList.toggle(className_displayNone, i !== showIdx);
}
}
this.boards.push(...(boards.filter(board=>board instanceof Board)));
this.boards.forEach((board, idx)=>{
this.node.appendChild(board.tableNode);
boardSet.boards.push(...(boards.filter(board=>board instanceof Board)));
boardSet.boards.forEach((board, idx)=>{
boardSet.node.appendChild(board.tableNode);
const span = document.createElement("span");
span.dataset.columnCount = board.columnCount;
span.dataset.rowCount = board.rowCount;
span.onclick = switchFunction;
this.boardsLabel.push(span);
this.node.appendChild(span);
boardSet.boardsLabel.push(span);
boardSet.node.appendChild(span);
if (idx > 0) {
board.tableNode.classList.add(className_displayNone);
}
});
const span = document.createElement("span");
span.className = "show-all-board";
span.onclick = function(){
boardSet.boards.forEach(board=>board.tableNode.classList.remove(className_displayNone));
this.classList.add(className_displayNone);
};
boardSet.node.appendChild(span);
}
valueOf() {
return this.node;

View File

@ -25515,7 +25515,7 @@ const cachesMap = new Map([
],
[
"script-skill-parser.js",
"8f1d7a61871ebe366d301476d5afacb9"
"d298d99ce21c86143f6db51815aaf3ff"
],
[
"script-universal_function.js",
@ -25535,7 +25535,7 @@ const cachesMap = new Map([
],
[
"style.css",
"84fbec7513fec6f454535498e5f7a610"
"80ff7251f60ab0ba92b9acc76fa8382c"
],
[
"temp.js",

View File

@ -3064,12 +3064,13 @@ label[for="languages"]::after{
display: inline-block;
vertical-align: middle;
}
.board-set>span {
cursor: pointer;
margin: 0 3px;
}
.board-set>span::before {
content: attr(data-column-count)"×"attr(data-row-count)"🔁";
margin: 0 3px;
content: attr(data-column-count)"×"attr(data-row-count);
}
.board-set .show-all-board::before {
cursor: pointer;
content: "🔁";
}
.board.display-none+span {
display: none;