Add files via upload

This commit is contained in:
seb1k 2024-06-01 11:28:00 +02:00 committed by GitHub
parent c67c7e3a1f
commit 274bc75798
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

41
ui.min.js vendored
View file

@ -5098,4 +5098,45 @@ var ratio = w/ow
divms.height = h * ratio +"px"
divms.transform="scale("+ratio+")"
divms.transformOrigin="0 0";
}
go_PWA()
function go_PWA()
{
var href = window.location.href
var url = href.substring(0, href.lastIndexOf('/')) + "/";
var theme_color = "#ffffff"
if($('HTML')[0].classList.contains('dark-mode'))
theme_color = "#000000"
var myDynamicManifest = {
"name": "RounCube",
theme_color: theme_color,
"start_url": url,
"icons": [{
"src": url+"/skins/elastic2022/images/rc192x192.png",
"sizes": "192x192",
"purpose": "maskable",
"purpose": "any"},{
"src": url+"/skins/elastic2022/images/rc512x512.png",
"sizes": "512x512",
"purpose": "maskable",
"purpose": "any"
}],
"display": "standalone",
}
const stringManifest = JSON.stringify(myDynamicManifest);
const blob = new Blob([stringManifest], {type: 'application/json'});
let reader = new FileReader();
reader.readAsDataURL(blob);
reader.onload = function(){
var link = document.createElement('link');
link.href = reader.result
link.rel = 'manifest';
document.getElementsByTagName('head')[0].appendChild(link);
}
}