Files
bitvid/src copy/index.html
2025-01-05 23:51:52 -05:00

104 lines
4.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NosTube MVP</title>
<!-- TailwindCSS CDN -->
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body class="bg-gray-100">
<div id="app" class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="mb-8">
<h1 class="text-3xl font-bold text-gray-800">NosTube</h1>
<p class="text-gray-600">Decentralized video sharing</p>
<!-- Demo Link -->
<div class="mt-4">
<a href="./demo/demo.html" class="text-blue-500 hover:underline">
View Demo Page
</a>
</div>
</header>
<!-- Login Section -->
<div id="loginSection" class="mb-8 flex items-center justify-between">
<div>
<button id="loginButton" class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Login with Nostr
</button>
<p id="userStatus" class="mt-4 text-gray-500 hidden">Logged in as: <span id="userPubKey"></span></p>
</div>
<div>
<button id="logoutButton" class="bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 hidden">
Logout
</button>
</div>
</div>
<!-- Error Container -->
<div id="errorContainer" class="hidden bg-red-100 text-red-800 p-4 rounded-md mb-4">
<!-- Error messages will appear here -->
</div>
<!-- Success Container -->
<div id="successContainer" class="hidden bg-green-100 text-green-800 p-4 rounded-md mb-4">
<!-- Success messages will appear here -->
</div>
<!-- Video Submission Form -->
<div class="bg-white p-6 rounded-lg shadow-md mb-8 hidden" id="videoFormContainer">
<h2 class="text-xl font-semibold mb-4">Share a Video</h2>
<form id="submitForm" class="space-y-4">
<div>
<label for="title" class="block text-sm font-medium text-gray-700">Title</label>
<input type="text" id="title" required
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
</div>
<div>
<label for="magnet" class="block text-sm font-medium text-gray-700">Magnet Link</label>
<input type="text" id="magnet" required
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
</div>
<div>
<label for="thumbnail" class="block text-sm font-medium text-gray-700">Thumbnail URL (optional)</label>
<input type="url" id="thumbnail"
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500">
</div>
<button type="submit"
class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Share Video
</button>
</form>
</div>
<!-- Video List -->
<div id="videoList" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Videos will be inserted here -->
</div>
<!-- Video Player Modal -->
<div id="playerModal" class="hidden fixed inset-0 bg-black bg-opacity-50">
<div class="bg-white p-4 rounded-lg max-w-4xl w-full mx-4 relative">
<div id="player"></div>
<button id="closePlayer" class="mt-4 px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 absolute top-2 right-2">
Close
</button>
</div>
</div>
</div>
<!-- Scripts -->
<!-- Load WebTorrent via CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/webtorrent/1.9.7/webtorrent.min.js"></script>
<!-- Load Nostr library -->
<script src="js/libs/nostr.bundle.js"></script>
<!-- Load JavaScript Modules -->
<script type="module" src="js/config.js"></script>
<script type="module" src="js/webtorrent.js"></script>
<script type="module" src="js/nostr.js"></script>
<script type="module" src="js/app.js"></script>
</body>
</html>