Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Git Odyssey - Visualize Your Commit History</title> | |
| <!-- Remove CDN tailwind --> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://d3js.org/d3.v7.min.js"></script> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body class="bg-gray-50 dark:bg-gray-900 transition-colors duration-200"> | |
| <div class="min-h-screen flex flex-col"> | |
| <!-- Header --> | |
| <header class="bg-indigo-600 text-white p-4 shadow-md"> | |
| <div class="container mx-auto flex justify-between items-center"> | |
| <h1 class="text-2xl font-bold flex items-center"> | |
| <i data-feather="git-commit" class="mr-2"></i> Git Odyssey | |
| </h1> | |
| <div class="flex items-center space-x-4"> | |
| <button id="theme-toggle" class="p-2 rounded-full hover:bg-indigo-700 transition-colors"> | |
| <i data-feather="moon"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="flex-grow container mx-auto p-4"> | |
| <!-- File Input Section --> | |
| <section class="mb-8"> | |
| <div id="drop-zone" class="border-2 border-dashed border-indigo-400 rounded-lg p-8 text-center bg-indigo-50 dark:bg-gray-800 transition-colors"> | |
| <div class="flex flex-col items-center justify-center space-y-4"> | |
| <i data-feather="upload" class="w-12 h-12 text-indigo-600 dark:text-indigo-400"></i> | |
| <h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Drag & Drop your commit file here</h2> | |
| <p class="text-gray-600 dark:text-gray-400">or</p> | |
| <label class="cursor-pointer bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-md transition-colors"> | |
| <input type="file" id="file-input" class="hidden" accept=".json,.txt"> | |
| <span>Select File</span> | |
| </label> | |
| <p class="text-sm text-gray-500 dark:text-gray-400">Supports .json or .txt files with commit data</p> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Controls Section (hidden until file loaded) --> | |
| <section id="controls" class="hidden mb-8"> | |
| <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-4 transition-colors"> | |
| <div class="flex flex-wrap items-center justify-between gap-4"> | |
| <div class="flex items-center space-x-4"> | |
| <span class="text-gray-700 dark:text-gray-300">Cluster Window:</span> | |
| <input type="range" id="cluster-slider" min="30" max="720" value="240" class="w-40"> | |
| <span id="cluster-value" class="font-medium text-indigo-600 dark:text-indigo-400">240 min</span> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button id="scale-week" class="scale-btn active">Week</button> | |
| <button id="scale-month" class="scale-btn">Month</button> | |
| <button id="scale-overall" class="scale-btn">Overall</button> | |
| </div> | |
| <div class="relative flex-grow max-w-md"> | |
| <input type="text" id="search-input" placeholder="Search commits..." | |
| class="w-full pl-10 pr-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-800 dark:text-gray-200 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-colors"> | |
| <i data-feather="search" class="absolute left-3 top-2.5 text-gray-500 dark:text-gray-400"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Stats Section (hidden until file loaded) --> | |
| <section id="stats" class="hidden mb-6"> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | |
| <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 transition-colors"> | |
| <h3 class="text-gray-500 dark:text-gray-400 text-sm font-medium">Total Commits</h3> | |
| <p id="total-commits" class="text-2xl font-bold text-indigo-600 dark:text-indigo-400">0</p> | |
| </div> | |
| <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 transition-colors"> | |
| <h3 class="text-gray-500 dark:text-gray-400 text-sm font-medium">Total Episodes</h3> | |
| <p id="total-episodes" class="text-2xl font-bold text-indigo-600 dark:text-indigo-400">0</p> | |
| </div> | |
| <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-4 transition-colors"> | |
| <h3 class="text-gray-500 dark:text-gray-400 text-sm font-medium">Date Range</h3> | |
| <p id="date-range" class="text-lg text-indigo-600 dark:text-indigo-400">-</p> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Visualization Section --> | |
| <section id="visualization" class="hidden mb-8"> | |
| <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden transition-colors"> | |
| <div id="timeline" class="w-full h-64 p-4"></div> | |
| </div> | |
| </section> | |
| <!-- Episodes and Commit Details Section --> | |
| <section id="details" class="hidden"> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <!-- Episodes List --> | |
| <div class="lg:col-span-1 bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden transition-colors"> | |
| <div class="p-4 border-b border-gray-200 dark:border-gray-700"> | |
| <h2 class="text-lg font-semibold text-gray-800 dark:text-gray-200">Episodes</h2> | |
| </div> | |
| <div id="episodes-list" class="divide-y divide-gray-200 dark:divide-gray-700 max-h-[600px] overflow-y-auto"> | |
| <!-- Episodes will be populated here --> | |
| </div> | |
| </div> | |
| <!-- Commit Details --> | |
| <div class="lg:col-span-2 bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden transition-colors"> | |
| <div class="p-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center"> | |
| <h2 id="selected-episode-title" class="text-lg font-semibold text-gray-800 dark:text-gray-200">Select an episode to view commits</h2> | |
| <div class="flex space-x-2"> | |
| <button id="export-json" class="flex items-center text-sm bg-indigo-100 hover:bg-indigo-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-indigo-700 dark:text-indigo-300 px-3 py-1 rounded transition-colors"> | |
| <i data-feather="download" class="w-4 h-4 mr-1"></i> JSON | |
| </button> | |
| <button id="export-md" class="flex items-center text-sm bg-indigo-100 hover:bg-indigo-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-indigo-700 dark:text-indigo-300 px-3 py-1 rounded transition-colors"> | |
| <i data-feather="download" class="w-4 h-4 mr-1"></i> Markdown | |
| </button> | |
| </div> | |
| </div> | |
| <div id="commit-details" class="max-h-[600px] overflow-y-auto"> | |
| <div class="p-8 text-center text-gray-500 dark:text-gray-400"> | |
| <i data-feather="git-commit" class="w-12 h-12 mx-auto mb-4"></i> | |
| <p>Select an episode from the list to view its commits</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| <!-- Footer --> | |
| <footer class="bg-gray-100 dark:bg-gray-800 p-4 text-center text-gray-600 dark:text-gray-400 text-sm border-t border-gray-200 dark:border-gray-700 transition-colors"> | |
| <p>Git Odyssey - Visualize your Git commit history locally in your browser</p> | |
| </footer> | |
| </div> | |
| <script src="script.js"></script> | |
| <script> | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> |