adds install button
This commit is contained in:
parent
cd9942068f
commit
fc82d0397f
BIN
src/main/resources/META-INF/resources/192.png
Normal file
BIN
src/main/resources/META-INF/resources/192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
src/main/resources/META-INF/resources/512.png
Normal file
BIN
src/main/resources/META-INF/resources/512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
18
src/main/resources/META-INF/resources/manifest.json
Normal file
18
src/main/resources/META-INF/resources/manifest.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Dice-Tower",
|
||||
"icons": [
|
||||
{
|
||||
"src": "192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
},
|
||||
{
|
||||
"src": "512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": "/",
|
||||
"display_override": ["window-controls-overlay", "minimal-ui"],
|
||||
"display": "standalone"
|
||||
}
|
@ -32,6 +32,22 @@ button:active {
|
||||
background: #222222;
|
||||
}
|
||||
|
||||
#install {
|
||||
padding: 10px;
|
||||
border: #666666 3px solid;
|
||||
border-radius: 10px;
|
||||
background: #666666;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
#install:hover {
|
||||
background: #444444;
|
||||
}
|
||||
|
||||
#install:active {
|
||||
background: #222222;
|
||||
}
|
||||
|
||||
input {
|
||||
margin: 10px;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>Dice-Tower</title>
|
||||
<meta name="version" content="{version}">
|
||||
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<link rel="stylesheet" href="/vendor/w3css/4/w3.css">
|
||||
<link rel="stylesheet" href="/vendor/font-awesome/css/fontawesome.css">
|
||||
<link rel="stylesheet" href="/vendor/font-awesome/css/all.css">
|
||||
@ -33,6 +33,17 @@
|
||||
if (!localStorage.getItem("userId")) {
|
||||
localStorage.setItem("userId", self.crypto.randomUUID());
|
||||
}
|
||||
addEventListener("beforeinstallprompt", (event) => {
|
||||
event.preventDefault()
|
||||
let install = document.createElement('button');
|
||||
install.id = 'install'
|
||||
install.style.position = 'absolute'
|
||||
install.style.top = '25px'
|
||||
install.style.right = '25px'
|
||||
install.innerHTML = 'Install Dice-Tower'
|
||||
install.onclick = () => event.prompt()
|
||||
document.body.appendChild(install)
|
||||
});
|
||||
</script>
|
||||
<div class="w3-container w3-content"
|
||||
style="height: 95vh; display: flex; flex-direction: column; justify-content: space-between; padding: 25px">
|
||||
|
Loading…
x
Reference in New Issue
Block a user