Aleksmorshen commited on
Commit
d1900e5
·
verified ·
1 Parent(s): 9e4001f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +159 -6
index.html CHANGED
@@ -1,6 +1,159 @@
1
- <iframe
2
- src="https://teplostil.kg/"
3
- frameborder="0"
4
- width="850"
5
- height="1000"
6
- ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>TeploStil 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"> <!-- Для iOS -->
10
+ <meta name="apple-mobile-web-app-capable" content="yes"> <!-- Для iOS -->
11
+ <meta name="apple-mobile-web-app-status-bar-style" content="default"> <!-- Для iOS -->
12
+ <link rel="icon" type="image/png" sizes="192x192" href="/icon.png">
13
+
14
+ <style>
15
+ /* Общие стили из вашего CSS, но с адаптивными улучшениями */
16
+ body {
17
+ padding: 1rem; /* Уменьшил отступ для мобильных */
18
+ font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
19
+ margin: 0; /* Убрал margin по умолчанию */
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 {
43
+ margin-bottom: 0;
44
+ }
45
+
46
+ /* Адаптивные стили */
47
+ @media (min-width: 640px) { /* Для экранов больше 640px */
48
+ body {
49
+ padding: 2rem;
50
+ }
51
+ h1 {
52
+ font-size: 1.6rem;
53
+ }
54
+ p {
55
+ font-size: 1rem;
56
+ }
57
+ .card {
58
+ max-width: 620px;
59
+ padding: 1rem;
60
+ border-radius: 1rem;
61
+ }
62
+ }
63
+
64
+ /* Стили для iframe */
65
+ iframe {
66
+ width: 100%;
67
+ height: 600px; /* Начальная высота, можно изменить */
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: 10px 15px;
79
+ background-color: #007bff;
80
+ color: white;
81
+ border: none;
82
+ border-radius: 5px;
83
+ cursor: pointer;
84
+ z-index: 1000;
85
+ font-size: 14px;
86
+ }
87
+
88
+ #iosInstallPrompt {
89
+ background-color: #28a745;
90
+ }
91
+ </style>
92
+ </head>
93
+ <body>
94
+ <div class="card">
95
+ <h1>TeploStil</h1>
96
+ <p>Ваш надежный партнер в мире тепла и стиля.</p>
97
+ <p>Мы предлагаем широкий ассортимент продукции для отопления и дизайна интерьера.</p>
98
+ </div>
99
+
100
+ <iframe
101
+ src="https://teplostil.kg/"
102
+ frameborder="0"
103
+ allowfullscreen></iframe>
104
+
105
+ <button id="installButton">Установить приложение</button>
106
+ <button id="iosInstallPrompt">Установить приложение (инструкция для iOS)</button>
107
+
108
+ <script>
109
+ let deferredPrompt;
110
+ const installButton = document.getElementById('installButton');
111
+ const iosInstallPrompt = document.getElementById('iosInstallPrompt');
112
+
113
+ function isIos() {
114
+ return /iphone|ipad|ipod/i.test(navigator.userAgent);
115
+ }
116
+
117
+ function isInStandaloneMode() {
118
+ return window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone;
119
+ }
120
+
121
+ if (isIos() && !isInStandaloneMode()) {
122
+ iosInstallPrompt.style.display = 'block';
123
+ iosInstallPrompt.addEventListener('click', () => {
124
+ alert("1. Нажмите кнопку 'Поделиться' (иконка внизу Safari).\n2. Выберите 'Добавить на экран Домой'.\n3. Подтвердите установку.");
125
+ });
126
+ }
127
+
128
+ window.addEventListener('beforeinstallprompt', (event) => {
129
+ event.preventDefault();
130
+ deferredPrompt = event;
131
+ installButton.style.display = 'block';
132
+
133
+ installButton.addEventListener('click', async () => {
134
+ deferredPrompt.prompt();
135
+ const { outcome } = await deferredPrompt.userChoice;
136
+ if (outcome === 'accepted') {
137
+ console.log('User accepted the install prompt');
138
+ } else {
139
+ console.log('User dismissed the install prompt');
140
+ }
141
+ deferredPrompt = null;
142
+ installButton.style.display = 'none';
143
+ });
144
+ });
145
+
146
+ if ('serviceWorker' in navigator) {
147
+ window.addEventListener('load', () => {
148
+ navigator.serviceWorker.register('/service-worker.js')
149
+ .then((registration) => {
150
+ console.log('Service Worker registered:', registration);
151
+ })
152
+ .catch((error) => {
153
+ console.log('Service Worker registration failed:', error);
154
+ });
155
+ });
156
+ }
157
+ </script>
158
+ </body>
159
+ </html>