This commit is contained in:
retoor 2025-02-17 22:31:17 +01:00
parent 2ab4341d00
commit e21880b4f5
2 changed files with 30 additions and 12 deletions

View File

@ -1,7 +1,20 @@
{ {
"id": "snek",
"name": "Snek", "name": "Snek",
"description": "Danger noodle", "description": "Danger noodle",
"display": "standalone", "display": "standalone",
"orientation": "portrait",
"scope": "/web.html",
"theme_color": "#000000",
"background_color": "#000000",
"related_applications": [],
"prefer_related_applications": false,
"screenshots": [],
"dir": "ltr",
"lang": "en-US",
"launch_path": "/web.html",
"display_override": ["browser"],
"short_name": "Snek",
"start_url": "/web.html", "start_url": "/web.html",
"icons": [ "icons": [
{ {

View File

@ -3,9 +3,12 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="manifest" href="/manifest.json" />
<title>Snek</title> <title>Snek</title>
<style>{{highlight_styles}}</style> <style>{{highlight_styles}}</style>
<!--
<script src="/push.js"></script> <script src="/push.js"></script>
-->
<script src="/fancy-button.js"></script> <script src="/fancy-button.js"></script>
<script src="/upload-button.js"></script> <script src="/upload-button.js"></script>
<script src="/generic-form.js"></script> <script src="/generic-form.js"></script>
@ -13,7 +16,7 @@
<script src="/schedule.js"></script> <script src="/schedule.js"></script>
<script src="/app.js"></script> <script src="/app.js"></script>
<link rel="stylesheet" href="/base.css"> <link rel="stylesheet" href="/base.css">
<link rel="manifest" href="/manifest.json" />
<link rel="icon" type="image/png" href="/image/snek1.png" sizes="32x32"> <link rel="icon" type="image/png" href="/image/snek1.png" sizes="32x32">
</head> </head>
<body> <body>
@ -45,20 +48,22 @@
</main> </main>
<script> <script>
let installPrompt = null let installPrompt = null
window.addEventListener("beforeinstallprompt", async(event) => { window.addEventListener("beforeinstallprompt", (e) => {
event.preventDefault(); //e.preventDefault();
installPrompt = event; installPrompt = e;
document.addEventListener("DOMContentLoaded", () => { //document.addEventListener("DOMContentLoaded", () => {
alert("Jaaah")
const button = document.getElementById("install-button") const button = document.getElementById("install-button")
button.addEventListener("click", async ()=>{
const result = await installPrompt.prompt()
console.info(result.outcome)
})
button.style.display = 'inline-block' button.style.display = 'inline-block'
button.addEventListener("click", async ()=>{
const result = await installPrompt.prompt()
console.info(result.outcome)
}) })
});
})
; ;
</script> </script>
</body> </body>