Skip to content

Commit b926134

Browse files
randomize store theme sorting
1 parent 0ae7673 commit b926134

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎appdata/store.html‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,15 +1149,24 @@ <h1 id="knowmuchupdates">12 Apps have updates</h1>
11491149

11501150

11511151
var networkretries = 0;
1152+
let shuffledEntries = null;
1153+
11521154
function loadThemes() {
11531155
const container = document.getElementById("themeslist");
11541156

1155-
fetch('https://adthoughtsglobal.github.io/Nova-Store/db/themes.json')
1156-
.then(response => response.json())
1157+
fetch('https://adthoughtsglobal.github.io/Nova-Store/db/themes.json', { cache: "no-store" })
1158+
.then(r => r.json())
11571159
.then(data => {
1158-
container.innerHTML = '';
1160+
if (!shuffledEntries) {
1161+
shuffledEntries = Object.entries(data);
1162+
for (let i = shuffledEntries.length - 1; i > 0; i--) {
1163+
const j = Math.floor(Math.random() * (i + 1));
1164+
[shuffledEntries[i], shuffledEntries[j]] = [shuffledEntries[j], shuffledEntries[i]];
1165+
}
1166+
}
11591167

1160-
Object.entries(data).forEach(([themeName, themeData]) => {
1168+
container.innerHTML = '';
1169+
shuffledEntries.forEach(([themeName, themeData]) => {
11611170
const themeContainer = document.createElement('div');
11621171
themeContainer.classList.add("themesing");
11631172
themeContainer.style.outline = `1px solid ${themeData.colors["--col-bg3"]}`;

‎nova.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
--col-bad: #d44343;
1616

1717
/* sizing */
18-
--sizing-normal: .3em;
18+
--sizing-normal: .5em;
1919
--sizing-huge: 1em;
20-
--sizing-nano: .2em;
20+
--sizing-nano: .3em;
2121

2222
--siz-radius1: 0.5em;
2323
--siz-radius2: 0.35em;

0 commit comments

Comments
 (0)