|
|
<!DOCTYPE html> |
|
|
<html lang="ko"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>eUM : Open Perflexity</title> |
|
|
<link rel="manifest" href="/manifest.json"> |
|
|
<link rel="stylesheet" href="style.css"> |
|
|
<style> |
|
|
* { |
|
|
margin: 0; |
|
|
padding: 0; |
|
|
box-sizing: border-box; |
|
|
} |
|
|
|
|
|
body { |
|
|
font-family: Arial, sans-serif; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
height: 100vh; |
|
|
} |
|
|
|
|
|
header { |
|
|
background-color: #f8f9fa; |
|
|
padding: 0.5rem; |
|
|
box-shadow: 0 1px 2px rgba(0,0,0,0.1); |
|
|
display: flex; |
|
|
align-items: center; |
|
|
gap: 1rem; |
|
|
font-size: 0.8rem; |
|
|
} |
|
|
|
|
|
iframe { |
|
|
flex: 1; |
|
|
width: 100%; |
|
|
border: none; |
|
|
} |
|
|
|
|
|
#installButton { |
|
|
display: none; |
|
|
position: fixed; |
|
|
bottom: 20px; |
|
|
left: 50%; |
|
|
transform: translateX(-50%); |
|
|
padding: 10px 20px; |
|
|
background-color: #007bff; |
|
|
color: white; |
|
|
border: none; |
|
|
border-radius: 5px; |
|
|
cursor: pointer; |
|
|
z-index: 1000; |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body> |
|
|
<header> |
|
|
|
|
|
</header> |
|
|
<iframe src="https://eum-lovat.vercel.app" allowfullscreen></iframe> |
|
|
|
|
|
<button id="installButton">Установить приложение</button> |
|
|
|
|
|
<script> |
|
|
let deferredPrompt; |
|
|
const installButton = document.getElementById('installButton'); |
|
|
|
|
|
function showInstallPromotion() { |
|
|
installButton.style.display = 'block'; |
|
|
installButton.addEventListener('click', async () => { |
|
|
if (deferredPrompt) { |
|
|
deferredPrompt.prompt(); |
|
|
const { outcome } = await deferredPrompt.userChoice; |
|
|
if (outcome === 'accepted') { |
|
|
console.log('User accepted the install prompt'); |
|
|
} else { |
|
|
console.log('User dismissed the install prompt'); |
|
|
} |
|
|
deferredPrompt = null; |
|
|
installButton.style.display = 'none'; |
|
|
} |
|
|
}); |
|
|
} |
|
|
|
|
|
window.addEventListener('beforeinstallprompt', (event) => { |
|
|
|
|
|
event.preventDefault(); |
|
|
deferredPrompt = event; |
|
|
|
|
|
showInstallPromotion(); |
|
|
}); |
|
|
|
|
|
if ('serviceWorker' in navigator) { |
|
|
window.addEventListener('load', () => { |
|
|
navigator.serviceWorker.register('/service-worker.js') |
|
|
.then((registration) => { |
|
|
console.log('Service Worker registered:', registration); |
|
|
}) |
|
|
.catch((error) => { |
|
|
console.log('Service Worker registration failed:', error); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
</script> |
|
|
</body> |
|
|
</html> |
|
|
|