deepsite-project / index.html
Lordoflingus's picture
Options button, settings button, everything working correctly
176a3a7 verified
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My static Space</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-100 min-h-screen">
<header class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center py-4">
<h1 class="text-xl font-bold text-gray-900">My static Space</h1>
<div class="flex space-x-2">
<button id="options-btn" class="p-2 rounded-full hover:bg-gray-100 transition-colors">
<i data-feather="sliders"></i>
</button>
<button id="settings-btn" class="p-2 rounded-full hover:bg-gray-100 transition-colors">
<i data-feather="settings"></i>
</button>
</div>
</div>
</div>
</header>
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="bg-white rounded-lg shadow-sm p-6">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Welcome to your static Space!</h2>
<p class="text-gray-600 mb-4">You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
<p class="text-gray-600 mb-6">
Also don't forget to check the
<a href="https://huggingface.co/docs/hub/spaces" target="_blank" class="text-blue-600 hover:text-blue-800">Spaces documentation</a>.
</p>
<button onclick="runCode()" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors">
Run Code
</button>
</div>
</main>
<!-- Options Modal -->
<div id="options-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
<div class="bg-white rounded-lg p-6 max-w-md w-full mx-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold">Options</h3>
<button id="close-options" class="p-1 rounded-full hover:bg-gray-100">
<i data-feather="x"></i>
</button>
</div>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Theme</label>
<select class="w-full border border-gray-300 rounded-lg px-3 py-2">
<option>Light</option>
<option>Dark</option>
<option>Auto</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Language</label>
<select class="w-full border border-gray-300 rounded-lg px-3 py-2">
<option>English</option>
<option>Spanish</option>
<option>French</option>
</select>
</div>
<button class="w-full bg-blue-600 text-white py-2 rounded-lg hover:bg-blue-700 transition-colors">
Save Options
</button>
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settings-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
<div class="bg-white rounded-lg p-6 max-w-md w-full mx-4">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold">Settings</h3>
<button id="close-settings" class="p-1 rounded-full hover:bg-gray-100">
<i data-feather="x"></i>
</button>
</div>
<div class="space-y-4">
<div>
<label class="flex items-center">
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500">
<span class="ml-2 text-sm text-gray-700">Enable notifications</span>
</label>
</div>
<div>
<label class="flex items-center">
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" checked>
<span class="ml-2 text-sm text-gray-700">Auto-save changes</span>
</label>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Refresh interval</label>
<input type="range" min="1" max="60" value="5" class="w-full">
</div>
<button class="w-full bg-blue-600 text-white py-2 rounded-lg hover:bg-blue-700 transition-colors">
Save Settings
</button>
</div>
</div>
</div>
<script>
function runCode() {
alert("Code is running!");
}
// Initialize feather icons
document.addEventListener('DOMContentLoaded', function() {
feather.replace();
// Options modal functionality
const optionsBtn = document.getElementById('options-btn');
const optionsModal = document.getElementById('options-modal');
const closeOptions = document.getElementById('close-options');
optionsBtn.addEventListener('click', function() {
optionsModal.classList.remove('hidden');
optionsModal.classList.add('flex');
});
closeOptions.addEventListener('click', function() {
optionsModal.classList.remove('flex');
optionsModal.classList.add('hidden');
});
// Settings modal functionality
const settingsBtn = document.getElementById('settings-btn');
const settingsModal = document.getElementById('settings-modal');
const closeSettings = document.getElementById('close-settings');
settingsBtn.addEventListener('click', function() {
settingsModal.classList.remove('hidden');
settingsModal.classList.add('flex');
});
closeSettings.addEventListener('click', function() {
settingsModal.classList.remove('flex');
settingsModal.classList.add('hidden');
});
// Close modals when clicking outside
[optionsModal, settingsModal].forEach(modal => {
modal.addEventListener('click', function(e) {
if (e.target === modal) {
modal.classList.remove('flex');
modal.classList.add('hidden');
}
});
});
});
</script>
</body>
</html>