Initial commit: GamePortrait 竖屏版 - 深色豪华主题

This commit is contained in:
li
2026-01-16 17:47:53 +08:00
commit 40976e4b45
26611 changed files with 2843638 additions and 0 deletions
+1778
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
'use strict';
module.exports = function (items, comparator) {
comparator = comparator
? comparator
: (a, b) => {
if (a < b) return -1;
if (a > b) return 1;
return 0;
};
let stabilizedItems = items.map((el, index) => [el, index]);
const stableComparator = (a, b) => {
let order = comparator(a[0], b[0]);
if (order != 0) return order;
return a[1] - b[1];
};
stabilizedItems.sort(stableComparator);
for (let i = 0; i < items.length; i++) {
items[i] = stabilizedItems[i][0];
}
return items;
};