Spaces:
Running

bxttest / index.html
yangxinyue's picture
Add 2 files
3c56e0f verified
Raw History Blame Contribute Delete
11.9 kB
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>BXT Data 访问页面</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom scrollbar for iframe */
iframe {
scrollbar-width: thin;
scrollbar-color: #3b82f6 #f1f1f1;
}
iframe::-webkit-scrollbar {
width: 6px;
}
iframe::-webkit-scrollbar-track {
background: #f1f1f1;
}
iframe::-webkit-scrollbar-thumb {
background-color: #3b82f6;
border-radius: 3px;
}
/* Loading animation */
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-spinner {
animation: spin 1s linear infinite;
}
/* Pulse animation for logo */
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.pulse-animation {
animation: pulse 2s infinite;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex flex-col h-screen">
<!-- Header with navigation controls and logo -->
<header class="bg-blue-600 text-white p-4 shadow-md">
<div class="flex items-center justify-between">
<button onclick="goBack()" class="p-2 rounded-full hover:bg-blue-700 transition">
<i class="fas fa-arrow-left"></i>
</button>
<div class="flex items-center space-x-2">
<div class="w-8 h-8 bg-white rounded-full flex items-center justify-center pulse-animation">
<i class="fas fa-database text-blue-600"></i>
</div>
<h1 class="text-lg font-semibold">BXT Data</h1>
</div>
<div class="flex space-x-2">
<button onclick="refreshIframe()" class="p-2 rounded-full hover:bg-blue-700 transition">
<i class="fas fa-sync-alt"></i>
</button>
<button onclick="openInNewTab()" class="p-2 rounded-full hover:bg-blue-700 transition">
<i class="fas fa-external-link-alt"></i>
</button>
</div>
</div>
<div class="mt-2 relative">
<input
type="text"
id="urlInput"
value="https://www.bxtdata.com"
class="w-full p-2 pl-10 rounded-lg bg-blue-500 text-white placeholder-blue-300 focus:outline-none focus:ring-2 focus:ring-blue-400"
placeholder="输入网址..."
>
<i class="fas fa-link absolute left-3 top-3 text-blue-300"></i>
</div>
</header>
<!-- Loading indicator with custom logo -->
<div id="loading" class="flex-1 flex items-center justify-center bg-white">
<div class="text-center">
<div class="w-20 h-20 bg-blue-100 rounded-2xl flex items-center justify-center mb-4 mx-auto">
<i class="fas fa-database text-blue-600 text-4xl"></i>
</div>
<div class="loading-spinner inline-block w-10 h-10 border-4 border-blue-500 border-t-transparent rounded-full mb-4"></div>
<p class="text-gray-600">正在加载 BXT Data...</p>
<p class="text-sm text-gray-500 mt-2">数据驱动未来</p>
</div>
</div>
<!-- Main iframe content -->
<main class="flex-1 relative hidden" id="content">
<iframe
id="bxtFrame"
src="https://www.bxtdata.com"
class="w-full h-full border-0"
frameborder="0"
allow="geolocation; microphone; camera"
allowfullscreen
onload="iframeLoaded()"
></iframe>
<!-- Floating action button -->
<button
onclick="scrollToTop()"
id="scrollTopBtn"
class="fixed bottom-6 right-6 w-12 h-12 bg-blue-600 text-white rounded-full shadow-lg flex items-center justify-center hover:bg-blue-700 transition opacity-0 invisible"
>
<i class="fas fa-arrow-up"></i>
</button>
</main>
<!-- Footer navigation with more options -->
<footer class="bg-white border-t border-gray-200 p-2 flex justify-around">
<button onclick="goBack()" class="p-2 text-gray-600 hover:text-blue-600 transition flex flex-col items-center">
<i class="fas fa-arrow-left text-lg"></i>
<span class="text-xs mt-1">返回</span>
</button>
<button onclick="goForward()" class="p-2 text-gray-600 hover:text-blue-600 transition flex flex-col items-center">
<i class="fas fa-arrow-right text-lg"></i>
<span class="text-xs mt-1">前进</span>
</button>
<button onclick="refreshIframe()" class="p-2 text-gray-600 hover:text-blue-600 transition flex flex-col items-center">
<i class="fas fa-sync-alt text-lg"></i>
<span class="text-xs mt-1">刷新</span>
</button>
<button onclick="sharePage()" class="p-2 text-gray-600 hover:text-blue-600 transition flex flex-col items-center">
<i class="fas fa-share-alt text-lg"></i>
<span class="text-xs mt-1">分享</span>
</button>
<button onclick="openInNewTab()" class="p-2 text-gray-600 hover:text-blue-600 transition flex flex-col items-center">
<i class="fas fa-external-link-alt text-lg"></i>
<span class="text-xs mt-1">新窗口</span>
</button>
</footer>
</div>
<script>
// Wait for DOM to load
document.addEventListener('DOMContentLoaded', function() {
const iframe = document.getElementById('bxtFrame');
const urlInput = document.getElementById('urlInput');
// Listen for iframe scroll to show/hide scroll to top button
iframe.addEventListener('load', function() {
this.contentWindow.addEventListener('scroll', function() {
toggleScrollTopButton();
});
});
// Handle URL input submission
urlInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
navigateToUrl();
}
});
// Add click event to logo to refresh
document.querySelector('.flex.items-center.space-x-2').addEventListener('click', function() {
refreshIframe();
});
});
function iframeLoaded() {
document.getElementById('loading').classList.add('hidden');
document.getElementById('content').classList.remove('hidden');
}
function navigateToUrl() {
const urlInput = document.getElementById('urlInput');
let url = urlInput.value.trim();
// Add https:// if not present
if (!url.startsWith('http://') && !url.startsWith('https://')) {
url = 'https://' + url;
}
// Show loading indicator
document.getElementById('loading').classList.remove('hidden');
document.getElementById('content').classList.add('hidden');
// Update iframe source
document.getElementById('bxtFrame').src = url;
urlInput.value = url;
}
function goBack() {
const iframe = document.getElementById('bxtFrame');
try {
iframe.contentWindow.history.back();
} catch (e) {
console.log("Navigation error:", e);
}
}
function goForward() {
const iframe = document.getElementById('bxtFrame');
try {
iframe.contentWindow.history.forward();
} catch (e) {
console.log("Navigation error:", e);
}
}
function refreshIframe() {
const iframe = document.getElementById('bxtFrame');
iframe.src = iframe.src;
// Show loading indicator
document.getElementById('loading').classList.remove('hidden');
document.getElementById('content').classList.add('hidden');
}
function openInNewTab() {
const url = document.getElementById('urlInput').value;
window.open(url, '_blank');
}
function sharePage() {
const url = document.getElementById('urlInput').value;
if (navigator.share) {
navigator.share({
title: 'BXT Data',
text: '查看这个数据平台',
url: url
}).catch(err => {
console.log('分享失败:', err);
fallbackShare(url);
});
} else {
fallbackShare(url);
}
}
function fallbackShare(url) {
// Fallback for browsers that don't support Web Share API
const shareUrl = `https://www.bxtdata.com?share=${encodeURIComponent(url)}`;
window.prompt("复制链接分享给朋友", url);
}
function scrollToTop() {
const iframe = document.getElementById('bxtFrame');
try {
iframe.contentWindow.scrollTo({
top: 0,
behavior: 'smooth'
});
} catch (e) {
console.log("Scroll error:", e);
}
}
function toggleScrollTopButton() {
const iframe = document.getElementById('bxtFrame');
const button = document.getElementById('scrollTopBtn');
try {
if (iframe.contentWindow.scrollY > 200) {
button.classList.remove('opacity-0', 'invisible');
button.classList.add('opacity-100', 'visible');
} else {
button.classList.remove('opacity-100', 'visible');
button.classList.add('opacity-0', 'invisible');
}
} catch (e) {
console.log("Scroll detection error:", e);
}
}
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=yangxinyue/bxttest" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
</html>