page title
- Дом
- >
- page title
народная карта
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Вход в MyTapis</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.iframe-wrapper {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
}
.iframe-header {
padding: 10px 20px;
background: #f5f5f5;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
}
.iframe-header a {
color: #0066cc;
text-decoration: none;
}
.iframe-header a:hover {
text-decoration: underline;
}
.iframe-container {
flex: 1;
width: 100%;
}
iframe {
width: 100%;
height: 100%;
border: none;
display: block;
}
.fallback {
display: none;
padding: 40px 20px;
text-align: center;
background: #fff;
}
.fallback.show {
display: block;
}
.fallback-btn {
display: inline-block;
margin-top: 20px;
padding: 12px 24px;
background: #0066cc;
color: white;
text-decoration: none;
border-radius: 6px;
font-weight: 500;
}
.fallback-btn:hover {
background: #0052a3;
}
</style>
</head>
<body>
<div class="iframe-wrapper">
<div class="iframe-header">
<span>Встроенная страница: mytapis.online</span>
<a href="https://mytapis.online/backend/login" target="_blank" rel="noopener noreferrer">
Открыть в новой вкладке ↗
</a>
</div>
<div class="iframe-container">
<iframe
src="https://mytapis.online/backend/login"
title="Вход в MyTapis"
loading="lazy"
referrerpolicy="no-referrer"
sandbox="allow-scripts allow-same-origin allow-forms allow-popups">
</iframe>
</div>
<!-- Запасной вариант, если iframe заблокирован -->
<div class="fallback" id="fallback">
<h3>⚠️ Не удалось загрузить страницу</h3>
<p style="margin: 15px 0; color: #555;">
Сайт mytapis.online запрещает встраивание в iframe из соображений безопасности.
</p>
<a href="https://mytapis.online/backend/login" target="_blank" rel="noopener noreferrer" class="fallback-btn">
Перейти на сайт входа
</a>
</div>
</div>
<script>
// Простая проверка: если iframe не загрузился за 10 секунд, показываем запасной вариант
const iframe = document.querySelector('iframe');
const fallback = document.getElementById('fallback');
let loaded = false;
iframe.onload = () => { loaded = true; };
setTimeout(() => {
if (!loaded) {
// Пытаемся определить, заблокирован ли iframe (работает не во всех браузерах)
try {
const test = iframe.contentWindow;
} catch (e) {
// Cross-origin error — вероятно, iframe загружен, но доступ запрещён (это нормально)
return;
}
// Если iframe пустой или не отрисовал контент
if (iframe.getBoundingClientRect().height === 0) {
fallback.classList.add('show');
}
}
}, 10000);
</script>
</body>
</html>
|
|