Spaces:
Running
Running
Merge branch 'main' of https://github.com/daydreamer-json/hp
Browse files- gi_jukebox.html +7 -5
gi_jukebox.html
CHANGED
@@ -63,8 +63,8 @@
|
|
63 |
</style>
|
64 |
</head>
|
65 |
<body>
|
66 |
-
<div id='cover_bg_container'>
|
67 |
-
<img id='cover_bg' src='' style='display: none;'>
|
68 |
</div>
|
69 |
<div id='main'>
|
70 |
<h2 id='h2string1' class='do-not-select do-not-bold'> </h1>
|
@@ -102,9 +102,11 @@
|
|
102 |
document.getElementById('h2string1').textContent = atob(BASE_SETTINGS.base64var.h2string1);
|
103 |
}
|
104 |
function randomTrackSelector(db) {
|
105 |
-
let
|
106 |
-
|
107 |
-
let
|
|
|
|
|
108 |
return {
|
109 |
albumIndex: randomizedAlbumIndex,
|
110 |
discIndex: randomizedDiscIndex,
|
|
|
63 |
</style>
|
64 |
</head>
|
65 |
<body>
|
66 |
+
<div id='cover_bg_container' class='do-not-select'>
|
67 |
+
<img id='cover_bg' src='' style='display: none;' class='do-not-select'>
|
68 |
</div>
|
69 |
<div id='main'>
|
70 |
<h2 id='h2string1' class='do-not-select do-not-bold'> </h1>
|
|
|
102 |
document.getElementById('h2string1').textContent = atob(BASE_SETTINGS.base64var.h2string1);
|
103 |
}
|
104 |
function randomTrackSelector(db) {
|
105 |
+
let random32bitArray = new Uint32Array(3);
|
106 |
+
window.crypto.getRandomValues(random32bitArray);
|
107 |
+
let randomizedAlbumIndex = random32bitArray[0] % db.list.length;
|
108 |
+
let randomizedDiscIndex = random32bitArray[1] % db.list[randomizedAlbumIndex].discs.length;
|
109 |
+
let randomizedTrackIndex = random32bitArray[2] % db.list[randomizedAlbumIndex].discs[randomizedDiscIndex].tracks.length;
|
110 |
return {
|
111 |
albumIndex: randomizedAlbumIndex,
|
112 |
discIndex: randomizedDiscIndex,
|