Update index.html
Browse files- index.html +67 -21
index.html
CHANGED
|
@@ -6,37 +6,38 @@
|
|
| 6 |
<title>Morshenalpha PWA</title>
|
| 7 |
<link rel="manifest" href="/manifest.json">
|
| 8 |
<link rel="stylesheet" href="style.css">
|
| 9 |
-
<link rel="apple-touch-icon" href="/icon.png">
|
| 10 |
-
<meta name="apple-mobile-web-app-capable" content="yes">
|
| 11 |
-
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
| 12 |
<link rel="icon" type="image/png" sizes="192x192" href="/icon.png">
|
| 13 |
|
| 14 |
<style>
|
| 15 |
-
/* Общие стили
|
| 16 |
body {
|
| 17 |
-
padding:
|
| 18 |
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
| 19 |
-
margin: 0;
|
|
|
|
| 20 |
}
|
| 21 |
|
| 22 |
h1 {
|
| 23 |
-
font-size: 1.2rem;
|
| 24 |
margin-top: 0;
|
| 25 |
}
|
| 26 |
|
| 27 |
p {
|
| 28 |
color: rgb(107, 114, 128);
|
| 29 |
-
font-size: 0.9rem;
|
| 30 |
-
margin-bottom: 0.5rem;
|
| 31 |
-
margin-top: 0.25rem;
|
| 32 |
}
|
| 33 |
|
| 34 |
.card {
|
| 35 |
-
max-width: 100%;
|
| 36 |
margin: 0 auto;
|
| 37 |
-
padding: 0.5rem;
|
| 38 |
border: 1px solid lightgray;
|
| 39 |
-
border-radius: 0.5rem;
|
| 40 |
}
|
| 41 |
|
| 42 |
.card p:last-child {
|
|
@@ -44,9 +45,9 @@
|
|
| 44 |
}
|
| 45 |
|
| 46 |
/* Адаптивные стили */
|
| 47 |
-
@media (min-width: 640px) {
|
| 48 |
body {
|
| 49 |
-
padding:
|
| 50 |
}
|
| 51 |
h1 {
|
| 52 |
font-size: 1.6rem;
|
|
@@ -63,30 +64,68 @@
|
|
| 63 |
|
| 64 |
/* Стили для iframe */
|
| 65 |
iframe {
|
|
|
|
|
|
|
|
|
|
| 66 |
width: 100%;
|
| 67 |
-
height:
|
| 68 |
border: none;
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
-
/*
|
| 72 |
#installButton, #iosInstallPrompt {
|
| 73 |
display: none;
|
| 74 |
position: fixed;
|
| 75 |
bottom: 20px;
|
| 76 |
left: 50%;
|
| 77 |
transform: translateX(-50%);
|
| 78 |
-
padding:
|
| 79 |
background-color: #007bff;
|
| 80 |
color: white;
|
| 81 |
border: none;
|
| 82 |
border-radius: 5px;
|
| 83 |
cursor: pointer;
|
| 84 |
z-index: 1000;
|
| 85 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
#iosInstallPrompt {
|
| 89 |
background-color: #28a745;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
}
|
| 91 |
</style>
|
| 92 |
</head>
|
|
@@ -97,8 +136,6 @@
|
|
| 97 |
frameborder="0"
|
| 98 |
allowfullscreen></iframe>
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
<button id="installButton">Установить приложение</button>
|
| 103 |
<button id="iosInstallPrompt">Установить приложение (инструкция для iOS)</button>
|
| 104 |
|
|
@@ -117,9 +154,17 @@
|
|
| 117 |
|
| 118 |
if (isIos() && !isInStandaloneMode()) {
|
| 119 |
iosInstallPrompt.style.display = 'block';
|
|
|
|
|
|
|
| 120 |
iosInstallPrompt.addEventListener('click', () => {
|
| 121 |
alert("1. Нажмите кнопку 'Поделиться' (иконка внизу Safari).\n2. Выберите 'Добавить на экран Домой'.\n3. Подтвердите установку.");
|
| 122 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
}
|
| 124 |
|
| 125 |
window.addEventListener('beforeinstallprompt', (event) => {
|
|
@@ -137,6 +182,7 @@
|
|
| 137 |
}
|
| 138 |
deferredPrompt = null;
|
| 139 |
installButton.style.display = 'none';
|
|
|
|
| 140 |
});
|
| 141 |
});
|
| 142 |
|
|
|
|
| 6 |
<title>Morshenalpha PWA</title>
|
| 7 |
<link rel="manifest" href="/manifest.json">
|
| 8 |
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<link rel="apple-touch-icon" href="/icon.png">
|
| 10 |
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
| 11 |
+
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
| 12 |
<link rel="icon" type="image/png" sizes="192x192" href="/icon.png">
|
| 13 |
|
| 14 |
<style>
|
| 15 |
+
/* Общие стили */
|
| 16 |
body {
|
| 17 |
+
padding: 0;
|
| 18 |
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
| 19 |
+
margin: 0;
|
| 20 |
+
overflow: hidden; /* Предотвращает полосы прокрутки */
|
| 21 |
}
|
| 22 |
|
| 23 |
h1 {
|
| 24 |
+
font-size: 1.2rem;
|
| 25 |
margin-top: 0;
|
| 26 |
}
|
| 27 |
|
| 28 |
p {
|
| 29 |
color: rgb(107, 114, 128);
|
| 30 |
+
font-size: 0.9rem;
|
| 31 |
+
margin-bottom: 0.5rem;
|
| 32 |
+
margin-top: 0.25rem;
|
| 33 |
}
|
| 34 |
|
| 35 |
.card {
|
| 36 |
+
max-width: 100%;
|
| 37 |
margin: 0 auto;
|
| 38 |
+
padding: 0.5rem;
|
| 39 |
border: 1px solid lightgray;
|
| 40 |
+
border-radius: 0.5rem;
|
| 41 |
}
|
| 42 |
|
| 43 |
.card p:last-child {
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
/* Адаптивные стили */
|
| 48 |
+
@media (min-width: 640px) {
|
| 49 |
body {
|
| 50 |
+
padding: 0;
|
| 51 |
}
|
| 52 |
h1 {
|
| 53 |
font-size: 1.6rem;
|
|
|
|
| 64 |
|
| 65 |
/* Стили для iframe */
|
| 66 |
iframe {
|
| 67 |
+
position: fixed;
|
| 68 |
+
top: 0;
|
| 69 |
+
left: 0;
|
| 70 |
width: 100%;
|
| 71 |
+
height: 100%;
|
| 72 |
border: none;
|
| 73 |
+
margin: 0;
|
| 74 |
+
padding: 0;
|
| 75 |
}
|
| 76 |
|
| 77 |
+
/* Стили для кнопок установки */
|
| 78 |
#installButton, #iosInstallPrompt {
|
| 79 |
display: none;
|
| 80 |
position: fixed;
|
| 81 |
bottom: 20px;
|
| 82 |
left: 50%;
|
| 83 |
transform: translateX(-50%);
|
| 84 |
+
padding: 12px 20px;
|
| 85 |
background-color: #007bff;
|
| 86 |
color: white;
|
| 87 |
border: none;
|
| 88 |
border-radius: 5px;
|
| 89 |
cursor: pointer;
|
| 90 |
z-index: 1000;
|
| 91 |
+
font-size: 16px;
|
| 92 |
+
text-transform: uppercase;
|
| 93 |
+
letter-spacing: 1px;
|
| 94 |
+
box-shadow: 0 0 10px #007bff;
|
| 95 |
+
transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/* Hover эффект с усилением свечения и небольшим подъемом */
|
| 99 |
+
#installButton:hover, #iosInstallPrompt:hover {
|
| 100 |
+
box-shadow: 0 0 20px #007bff, 0 0 30px #007bff;
|
| 101 |
+
transform: translateX(-50%) scale(1.05); /* Небольшое увеличение */
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
/* Дополнительный эффект пульсации с использованием keyframes */
|
| 105 |
+
@keyframes pulse {
|
| 106 |
+
0% {
|
| 107 |
+
box-shadow: 0 0 10px #007bff;
|
| 108 |
+
}
|
| 109 |
+
50% {
|
| 110 |
+
box-shadow: 0 0 20px #007bff, 0 0 30px #007bff;
|
| 111 |
+
}
|
| 112 |
+
100% {
|
| 113 |
+
box-shadow: 0 0 10px #007bff;
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
/* Применение анимации к кнопке */
|
| 118 |
+
#installButton.pulse-animation, #iosInstallPrompt.pulse-animation {
|
| 119 |
+
animation: pulse 2s infinite;
|
| 120 |
}
|
| 121 |
|
| 122 |
#iosInstallPrompt {
|
| 123 |
background-color: #28a745;
|
| 124 |
+
box-shadow: 0 0 10px #28a745;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
#iosInstallPrompt:hover {
|
| 128 |
+
box-shadow: 0 0 20px #28a745, 0 0 30px #28a745;
|
| 129 |
}
|
| 130 |
</style>
|
| 131 |
</head>
|
|
|
|
| 136 |
frameborder="0"
|
| 137 |
allowfullscreen></iframe>
|
| 138 |
|
|
|
|
|
|
|
| 139 |
<button id="installButton">Установить приложение</button>
|
| 140 |
<button id="iosInstallPrompt">Установить приложение (инструкция для iOS)</button>
|
| 141 |
|
|
|
|
| 154 |
|
| 155 |
if (isIos() && !isInStandaloneMode()) {
|
| 156 |
iosInstallPrompt.style.display = 'block';
|
| 157 |
+
installButton.style.display = 'none';
|
| 158 |
+
iosInstallPrompt.classList.add('pulse-animation');
|
| 159 |
iosInstallPrompt.addEventListener('click', () => {
|
| 160 |
alert("1. Нажмите кнопку 'Поделиться' (иконка внизу Safari).\n2. Выберите 'Добавить на экран Домой'.\n3. Подтвердите установку.");
|
| 161 |
});
|
| 162 |
+
} else {
|
| 163 |
+
installButton.style.display = deferredPrompt ? 'block' : 'none';
|
| 164 |
+
iosInstallPrompt.style.display = 'none';
|
| 165 |
+
if (deferredPrompt) {
|
| 166 |
+
installButton.classList.add('pulse-animation');
|
| 167 |
+
}
|
| 168 |
}
|
| 169 |
|
| 170 |
window.addEventListener('beforeinstallprompt', (event) => {
|
|
|
|
| 182 |
}
|
| 183 |
deferredPrompt = null;
|
| 184 |
installButton.style.display = 'none';
|
| 185 |
+
installButton.classList.remove('pulse-animation'); // Удаляем класс после установки
|
| 186 |
});
|
| 187 |
});
|
| 188 |
|