hp / gi_jukebox.html
daydreamer-json
gi_jukebox.html webp update
6c93177 unverified
<!DOCTYPE html>
<html lang='en'>
<head>
<title>N/A</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.00">
<meta name="robots" content="noindex,nofollow,noarchive">
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js" integrity="sha512-6+YN/9o9BWrk6wSfGxQGpt3EUK6XeHi6yeHV+TYD2GR0Sj/cggRpXr1BrAQf0as6XslxomMUxXp2vIl+fv0QRA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.plyr.io/3.7.3/plyr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest/dist/hls.min.js"></script>
<link rel="stylesheet" href="https://cdn.plyr.io/3.7.3/plyr.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/gh/daydreamer-json/SomeFontRepo@main/somefontrepo.css" rel="stylesheet" type="text/css" media="all">
<style>
html, body {
color: #fff;
background: #000;
margin: 0;
padding: 0;
line-height: 1;
width: 100vw;
height: 100vh;
font-family: 'SDK_JP_Web', system-ui;
}
#h2string1 {
margin: 0;
padding: 0;
line-height: 1;
}
#main {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
margin: 0;
padding: 0;
white-space: normal;
letter-spacing: -0.02em;
text-shadow: 0 0 30px #cccccc;
z-index: 100;
}
#cover_bg_container {
width: 100vw;
height: 100vh;
overflow: hidden;
}
#cover_bg {
z-index: 95;
width: 100vw;
height: 100vh;
opacity: 0.3;
object-fit: cover;
object-position: 50% 50%;
}
.do-not-select {
user-select: none;
}
.do-not-bold {
font-weight: normal;
}
</style>
</head>
<body>
<div id='cover_bg_container' class='do-not-select'>
<img id='cover_bg' src='' style='display: none;' class='do-not-select'>
</div>
<div id='main'>
<h2 id='h2string1' class='do-not-select do-not-bold'>&nbsp;</h1>
<h1 id='h1string1' class='do-not-select do-not-bold'>&nbsp;</h1>
<div id='trackInfo' class='do-not-select'>
<h3 id='trackInfo_trackName' class='do-not-bold' style='display: none;'>&nbsp;</h3>
<h4 id='trackInfo_albumName' class='do-not-bold' style='display: none;'>&nbsp;</h4>
<h4 id='trackInfo_artistName' class='do-not-bold' style='display: none;'>&nbsp;</h4>
<p id='trackInfo_copyright' style='display: none;'>&nbsp;</p>
</div>
</div>
<script>
let BASE_SETTINGS = {
base64var: {
pageTitle: 'R2Vuc2hpbiBJbXBhY3QgTXVzaWMgSnVrZWJveA==',
h2string1: 'R2Vuc2hpbiBJbXBhY3QgTXVzaWMgSnVrZWJveA=='
},
audioRootURL: 'https://raw.githubusercontent.com/daydreamer-json/discography_cdn_005/main/mhy/genshin',
playStartButtonText_init_pc: 'CLICK TO PLAY',
playStartButtonText_init_mobile: 'TAP TO PLAY',
playStartButtonText_loading: 'LOADING ...',
playStartButtonText_playing: 'NOW PLAYING',
trackInfoLabel_loading: 'Loading ...',
forceCompressedFormat: true
};
function detectMobileDevice() {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
return 'mobile'
} else {
return 'pc'
}
}
function display_deobfuscate() {
document.title = atob(BASE_SETTINGS.base64var.pageTitle);
document.getElementById('h2string1').textContent = atob(BASE_SETTINGS.base64var.h2string1);
}
function randomTrackSelector(db) {
let random32bitArray = new Uint32Array(3);
window.crypto.getRandomValues(random32bitArray);
let randomizedAlbumIndex = random32bitArray[0] % db.list.length;
let randomizedDiscIndex = random32bitArray[1] % db.list[randomizedAlbumIndex].discs.length;
let randomizedTrackIndex = random32bitArray[2] % db.list[randomizedAlbumIndex].discs[randomizedDiscIndex].tracks.length;
return {
albumIndex: randomizedAlbumIndex,
discIndex: randomizedDiscIndex,
trackIndex: randomizedTrackIndex
};
}
function playAudioURLBuilder(db, randomTrackSelectorOutput) {
let deviceType = detectMobileDevice();
/*
let bpsArray = new Array();
for (let i = 0; i < db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length; i++) {
bpsArray.push(db.list[randomTrackSelectorOutput.albumIndex].availableFmts[i].bps);
};
bpsArray.sort((a, b) => b - a);
*/
let formatPath = '';
let formatExt = '';
if (BASE_SETTINGS.forceCompressedFormat) {
formatPath = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].path;
formatExt = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].ext;
} else if (deviceType == 'pc') {
formatPath = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[0].path;
formatExt = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[0].ext;
} else if (deviceType == 'mobile') {
formatPath = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].path;
formatExt = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].ext;
}
let trackTotal = 0;
let trackCountArray = new Array();
for (let i = 0; i < db.list[randomTrackSelectorOutput.albumIndex].discs.length; i++) {
trackTotal += db.list[randomTrackSelectorOutput.albumIndex].discs[i].tracks.length;
trackCountArray.push(db.list[randomTrackSelectorOutput.albumIndex].discs[i].tracks.length);
};
let selectedTrackNum = 0;
if (randomTrackSelectorOutput.discIndex == 0) {
selectedTrackNum = randomTrackSelectorOutput.trackIndex + 1;
} else {
let E7BF25ECDBAAF938 = 0;
for (let i = 0; i < randomTrackSelectorOutput.discIndex; i++) {
E7BF25ECDBAAF938 += trackCountArray[i];
}
selectedTrackNum = E7BF25ECDBAAF938 + randomTrackSelectorOutput.trackIndex + 1;
}
let selectedTrackNumStr = '';
if (trackTotal >= 100) {
selectedTrackNumStr = selectedTrackNum.toString().padStart(3, '0');
} else if (trackTotal < 100) {
selectedTrackNumStr = selectedTrackNum.toString().padStart(2, '0');
}
let filename = encodeURIComponent(db.list[randomTrackSelectorOutput.albumIndex].discs[randomTrackSelectorOutput.discIndex].tracks[randomTrackSelectorOutput.trackIndex].trackName['en-US'].replace(/'/g, '_'));
let buildedURL = `${BASE_SETTINGS.audioRootURL}/${db.list[randomTrackSelectorOutput.albumIndex].rootPath}/${formatPath}/${selectedTrackNumStr}_${filename}.${formatExt}`;
return buildedURL;
}
function playAudio() {
document.getElementById('h1string1').removeEventListener('click', playAudio);
if (typeof audioPlayer !== 'undefined') {
audioPlayer.unload();
};
fetch(`${BASE_SETTINGS.audioRootURL}/db.json`)
.then(response => response.json())
.then(data => {
console.log('Database loaded successfully');
const FILE_DATABASE = data;
let deviceType = detectMobileDevice();
let randomTrackSelectorOutput = randomTrackSelector(FILE_DATABASE);
var audioPlayer = new Howl ({
src: [playAudioURLBuilder(FILE_DATABASE, randomTrackSelectorOutput)],
html5: true
});
window.audioPlayer = audioPlayer;
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_loading;
document.getElementById('trackInfo_trackName').textContent = BASE_SETTINGS.trackInfoLabel_loading;
document.getElementById('trackInfo_albumName').textContent = BASE_SETTINGS.trackInfoLabel_loading;
document.getElementById('trackInfo_artistName').textContent = BASE_SETTINGS.trackInfoLabel_loading;
document.getElementById('trackInfo_copyright').textContent = BASE_SETTINGS.trackInfoLabel_loading;
audioPlayer.on('loaderror', function(){
console.error('Audio "loaderror" has occured. Retrying ...');
playAudio();
});
audioPlayer.on('playerror', function(){
console.error('Audio "playerror" has occured. Retrying ...');
playAudio();
});
audioPlayer.on('load', function(){
audioPlayer.play();
document.getElementById('h1string1').addEventListener('click', playAudio);
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_playing;
console.log(`Now playing "${FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].discs[randomTrackSelectorOutput.discIndex].tracks[randomTrackSelectorOutput.trackIndex].trackName['en-US']}"`);
console.log(`URL: ${audioPlayer._src}`);
document.getElementById('trackInfo_trackName').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].discs[randomTrackSelectorOutput.discIndex].tracks[randomTrackSelectorOutput.trackIndex].trackName['en-US'];
document.getElementById('trackInfo_albumName').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].albumTitle;
document.getElementById('trackInfo_artistName').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].albumArtist;
document.getElementById('trackInfo_copyright').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].copyright;
document.getElementById('cover_bg').src = `${BASE_SETTINGS.audioRootURL}/${FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].rootPath}/cover.webp`;
if (document.getElementById('trackInfo_trackName').style.display == 'none' && document.getElementById('trackInfo_albumName').style.display == 'none' && document.getElementById('trackInfo_artistName').style.display == 'none' && document.getElementById('trackInfo_copyright').style.display == 'none' && document.getElementById('cover_bg').style.display == 'none') {
document.getElementById('trackInfo_trackName').style.display = 'block';
document.getElementById('trackInfo_albumName').style.display = 'block';
document.getElementById('trackInfo_artistName').style.display = 'block';
document.getElementById('trackInfo_copyright').style.display = 'block';
document.getElementById('cover_bg').style.display = 'block';
}
audioPlayer.on('end', playAudio);
});
})
.catch(error => {
console.error(error);
alert('Failed to load database file');
});
}
document.addEventListener('DOMContentLoaded', function() {
display_deobfuscate();
let deviceType = detectMobileDevice();
if (deviceType == 'pc') {
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_init_pc;
} else if (deviceType == 'mobile') {
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_init_mobile;
};
var audioPlayer = new Howl ({
src: ['https://archive.org/download/audio-silent-wavs-one-second-half-second-quarter-second/silent_quarter-second.mp3']
});
window.audioPlayer = audioPlayer;
});
window.onload = function () {
document.getElementById('h1string1').addEventListener('click', playAudio);
}
</script>
</body>
</html>