Aleksmorshen commited on
Commit
5ed82df
·
verified ·
1 Parent(s): d01e5a0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +68 -153
index.html CHANGED
@@ -16,126 +16,12 @@
16
 
17
  <!-- Добавленный мета тег для проверки Google -->
18
  <meta name="google-site-verification" content="V6EqDTA9Oj9V1OfNbnBHj5RKrdcXlABD8tqfEFVUHJY" />
19
-
20
  <!-- Мета описание для SEO -->
21
  <meta name="description" content=" создание приложений, сайтов, искусственный интеллект для бизнеса Алматы и Бишкек .">
22
 
23
  <style>
24
- /* Общие стили */
25
- body {
26
- padding: 0;
27
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
28
- margin: 0;
29
- overflow: hidden; /* Предотвращает полосы прокрутки */
30
- }
31
-
32
- h1 {
33
- font-size: 1.2rem;
34
- margin-top: 0;
35
- }
36
-
37
- p {
38
- color: rgb(107, 114, 128);
39
- font-size: 0.9rem;
40
- margin-bottom: 0.5rem;
41
- margin-top: 0.25rem;
42
- }
43
-
44
- .card {
45
- max-width: 100%;
46
- margin: 0 auto;
47
- padding: 0.5rem;
48
- border: 1px solid lightgray;
49
- border-radius: 0.5rem;
50
- }
51
-
52
- .card p:last-child {
53
- margin-bottom: 0;
54
- }
55
-
56
- /* Адаптивные стили */
57
- @media (min-width: 640px) {
58
- body {
59
- padding: 0;
60
- }
61
- h1 {
62
- font-size: 1.6rem;
63
- }
64
- p {
65
- font-size: 1rem;
66
- }
67
- .card {
68
- max-width: 620px;
69
- padding: 1rem;
70
- border-radius: 1rem;
71
- }
72
- }
73
-
74
- /* Стили для iframe */
75
- iframe {
76
- position: fixed;
77
- top: 0;
78
- left: 0;
79
- width: 100%;
80
- height: 100%;
81
- border: none;
82
- margin: 0;
83
- padding: 0;
84
- }
85
-
86
- /* Стили для кнопок установки */
87
- #installButton, #iosInstallPrompt {
88
- display: none;
89
- position: fixed;
90
- bottom: 20px;
91
- left: 50%;
92
- transform: translateX(-50%);
93
- padding: 12px 20px;
94
- background-color: #007bff;
95
- color: white;
96
- border: none;
97
- border-radius: 5px;
98
- cursor: pointer;
99
- z-index: 1000;
100
- font-size: 16px;
101
- text-transform: uppercase;
102
- letter-spacing: 1px;
103
- box-shadow: 0 0 10px #007bff;
104
- transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
105
- }
106
-
107
- /* Hover эффект с усилением свечения и небольшим подъемом */
108
- #installButton:hover, #iosInstallPrompt:hover {
109
- box-shadow: 0 0 20px #007bff, 0 0 30px #007bff;
110
- transform: translateX(-50%) scale(1.05); /* Небольшое увеличение */
111
- }
112
-
113
- /* Дополнительный эффект пульсации с использованием keyframes */
114
- @keyframes pulse {
115
- 0% {
116
- box-shadow: 0 0 10px #007bff;
117
- }
118
- 50% {
119
- box-shadow: 0 0 20px #007bff, 0 0 30px #007bff;
120
- }
121
- 100% {
122
- box-shadow: 0 0 10px #007bff;
123
- }
124
- }
125
-
126
- /* Применение анимации к кнопке */
127
- #installButton.pulse-animation, #iosInstallPrompt.pulse-animation {
128
- animation: pulse 2s infinite;
129
- }
130
-
131
- #iosInstallPrompt {
132
- background-color: #28a745;
133
- box-shadow: 0 0 10px #28a745;
134
- }
135
-
136
- #iosInstallPrompt:hover {
137
- box-shadow: 0 0 20px #28a745, 0 0 30px #28a745;
138
- }
139
  </style>
140
  </head>
141
  <body>
@@ -146,12 +32,26 @@
146
  allowfullscreen></iframe>
147
 
148
  <button id="installButton">Установить приложение</button>
149
- <button id="iosInstallPrompt">Установить приложение </button>
 
 
 
 
 
 
 
 
 
 
 
 
150
 
151
  <script>
152
  let deferredPrompt;
153
  const installButton = document.getElementById('installButton');
154
  const iosInstallPrompt = document.getElementById('iosInstallPrompt');
 
 
155
 
156
  function isIos() {
157
  return /iphone|ipad|ipod/i.test(navigator.userAgent);
@@ -161,51 +61,66 @@
161
  return window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone;
162
  }
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  if (isIos() && !isInStandaloneMode()) {
165
  iosInstallPrompt.style.display = 'block';
166
  installButton.style.display = 'none';
167
  iosInstallPrompt.classList.add('pulse-animation');
 
168
  iosInstallPrompt.addEventListener('click', () => {
169
- alert("1. Нажмите кнопку 'Поделиться' (иконка внизу Safari).\n2. Нажмите 'Добавить на экран Домой'.\n3. Подтвердите установку.");
 
170
  });
 
 
 
 
 
171
  } else {
172
- installButton.style.display = deferredPrompt ? 'block' : 'none';
173
  iosInstallPrompt.style.display = 'none';
174
  if (deferredPrompt) {
175
  installButton.classList.add('pulse-animation');
176
  }
177
- }
178
-
179
- window.addEventListener('beforeinstallprompt', (event) => {
180
- event.preventDefault();
181
- deferredPrompt = event;
182
- installButton.style.display = 'block';
183
-
184
- installButton.addEventListener('click', async () => {
185
- deferredPrompt.prompt();
186
- const { outcome } = await deferredPrompt.userChoice;
187
- if (outcome === 'accepted') {
188
- console.log('Пользователь принял запрос на установку');
189
- } else {
190
- console.log('Пользователь отклонил запрос на установку');
191
- }
192
- deferredPrompt = null;
193
- installButton.style.display = 'none';
194
- installButton.classList.remove('pulse-animation'); // Удаляем класс после установки
195
- });
196
- });
197
-
198
- if ('serviceWorker' in navigator) {
199
- window.addEventListener('load', () => {
200
- navigator.serviceWorker.register('/service-worker.js')
201
- .then((registration) => {
202
- console.log('Сервисный рабочий процесс зарегистрирован:', registration);
203
- })
204
- .catch((error) => {
205
- console.log('Ошибка регистрации сервисного рабочего процесса:', error);
206
- });
207
- });
208
- }
209
- </script>
210
  </body>
211
- </html>
 
16
 
17
  <!-- Добавленный мета тег для проверки Google -->
18
  <meta name="google-site-verification" content="V6EqDTA9Oj9V1OfNbnBHj5RKrdcXlABD8tqfEFVUHJY" />
19
+
20
  <!-- Мета описание для SEO -->
21
  <meta name="description" content=" создание приложений, сайтов, искусственный интеллект для бизнеса Алматы и Бишкек .">
22
 
23
  <style>
24
+ /* Общие стили (можно оставить пустым, если используете style.css) */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  </style>
26
  </head>
27
  <body>
 
32
  allowfullscreen></iframe>
33
 
34
  <button id="installButton">Установить приложение</button>
35
+ <button id="iosInstallPrompt">Установить приложение</button>
36
+
37
+ <!-- Модальное окно для iOS -->
38
+ <div id="iosInstallModal">
39
+ <div class="modal-content">
40
+ <h2>Установите приложение Morshen Alpha</h2>
41
+ <img src="https://huggingface.co/spaces/Morshen/alpha/resolve/main/pwa_ios.png" alt="Инструкция по установке PWA на iOS">
42
+ <p>1. Нажмите кнопку "Поделиться" внизу Safari.</p>
43
+ <p>2. Выберите "На экран «Домой»".</p>
44
+ <p>3. Подтвердите установку.</p>
45
+ <button id="closeIosModal">Закрыть</button>
46
+ </div>
47
+ </div>
48
 
49
  <script>
50
  let deferredPrompt;
51
  const installButton = document.getElementById('installButton');
52
  const iosInstallPrompt = document.getElementById('iosInstallPrompt');
53
+ const iosInstallModal = document.getElementById('iosInstallModal');
54
+ const closeIosModal = document.getElementById('closeIosModal');
55
 
56
  function isIos() {
57
  return /iphone|ipad|ipod/i.test(navigator.userAgent);
 
61
  return window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone;
62
  }
63
 
64
+ window.addEventListener('beforeinstallprompt', (event) => {
65
+ event.preventDefault();
66
+ deferredPrompt = event;
67
+ installButton.style.display = 'block';
68
+ installButton.classList.add('pulse-animation');
69
+
70
+ installButton.addEventListener('click', async () => {
71
+ deferredPrompt.prompt();
72
+ const { outcome } = await deferredPrompt.userChoice;
73
+ if (outcome === 'accepted') {
74
+ console.log('Пользователь принял запрос на установку');
75
+ } else {
76
+ console.log('Пользователь отклонил запрос на установку');
77
+ }
78
+ deferredPrompt = null;
79
+ installButton.style.display = 'none';
80
+ installButton.classList.remove('pulse-animation');
81
+ });
82
+ });
83
+
84
  if (isIos() && !isInStandaloneMode()) {
85
  iosInstallPrompt.style.display = 'block';
86
  installButton.style.display = 'none';
87
  iosInstallPrompt.classList.add('pulse-animation');
88
+
89
  iosInstallPrompt.addEventListener('click', () => {
90
+ iosInstallModal.style.display = 'block';
91
+ localStorage.setItem('iosInstallPromptShown', 'true');
92
  });
93
+
94
+ closeIosModal.addEventListener('click', () => {
95
+ iosInstallModal.style.display = 'none';
96
+ });
97
+
98
  } else {
99
+ installButton.style.display = deferredPrompt ? 'block' : 'none';
100
  iosInstallPrompt.style.display = 'none';
101
  if (deferredPrompt) {
102
  installButton.classList.add('pulse-animation');
103
  }
104
+ }
105
+
106
+ // При загрузке страницы:
107
+ if (isIos() && !isInStandaloneMode() && localStorage.getItem('iosInstallPromptShown') === 'true') {
108
+ setTimeout(() => {
109
+ iosInstallModal.style.display = 'block';
110
+ }, 5000); // 5 секунд
111
+ }
112
+
113
+ if ('serviceWorker' in navigator) {
114
+ window.addEventListener('load', () => {
115
+ navigator.serviceWorker.register('/service-worker.js')
116
+ .then((registration) => {
117
+ console.log('Сервисный рабочий процесс зарегистрирован:', registration);
118
+ })
119
+ .catch((error) => {
120
+ console.log('Ошибка регистрации сервисного рабочего процесса:', error);
121
+ });
122
+ });
123
+ }
124
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
125
  </body>
126
+ </html>