removing instructions

This commit is contained in:
Tobi 2024-04-09 10:51:16 +02:00
parent 9cda1eb6a5
commit 02b67bce24

View file

@ -76,22 +76,10 @@
color: #666;
font-size: 12px;
}
#install-instructions {
display: none;
text-align: center;
padding: 20px;
}
</style>
</head>
<body>
<h1>Exchange Rate Calculator</h1>
<!-- Installation instructions (initially hidden) -->
<div id="install-instructions">
<p>For the best experience, add this web app to your home screen:</p>
<p>1. Tap the <strong>Share</strong> button.</p>
<p>2. Tap <strong>Add to Home Screen</strong>.</p>
</div>
<form onsubmit="return convert(event)">
<label for="euro">Enter amount in Euro:</label>
@ -161,22 +149,6 @@
calculationList.appendChild(li);
});
}
// Show installation instructions only if accessed via browser
if (window.matchMedia('(display-mode: browser)').matches) {
document.getElementById('install-instructions').style.display = 'block';
}
// Hide installation instructions once installed as standalone PWA
window.addEventListener('beforeinstallprompt', (event) => {
event.preventDefault(); // Prevent default browser prompt
document.getElementById('install-instructions').style.display = 'none';
});
// Check if launched from home screen and hide instructions
if (window.matchMedia('(display-mode: standalone)').matches) {
document.getElementById('install-instructions').style.display = 'none';
}
</script>
</body>
</html>