Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +85 -71
index.html
CHANGED
|
@@ -1,85 +1,99 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
</head>
|
| 10 |
<body>
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
</div>
|
| 55 |
-
<p class="loading-text" id="loading-text">Loading model...</p>
|
| 56 |
-
</div>
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
</div>
|
| 67 |
-
<pre><code class="language-javascript" id="generated-code"></code></pre>
|
| 68 |
-
</div>
|
| 69 |
-
</main>
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
<
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
</body>
|
| 85 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<meta name="description" content="AI-powered code generator that runs entirely in your browser using Transformers.js">
|
| 7 |
+
<title>AnyCoder - Browser AI Code Generator</title>
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css">
|
| 10 |
+
<!-- Preconnect to CDNs for performance -->
|
| 11 |
+
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
| 12 |
+
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
|
| 13 |
</head>
|
| 14 |
<body>
|
| 15 |
+
<div class="container">
|
| 16 |
+
<header>
|
| 17 |
+
<h1>🤖 AnyCoder</h1>
|
| 18 |
+
<p class="subtitle">AI-powered code generation in your browser</p>
|
| 19 |
+
<div class="attribution">
|
| 20 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" rel="noopener">
|
| 21 |
+
Built with anycoder
|
| 22 |
+
</a>
|
| 23 |
+
</div>
|
| 24 |
+
</header>
|
| 25 |
|
| 26 |
+
<main>
|
| 27 |
+
<div class="input-section">
|
| 28 |
+
<label for="prompt">Describe what you want to code:</label>
|
| 29 |
+
<textarea
|
| 30 |
+
id="prompt"
|
| 31 |
+
placeholder="e.g., Create a function that sorts an array of objects by a property, Write a React component for a todo list, Generate a Python script to fetch API data..."
|
| 32 |
+
rows="4"
|
| 33 |
+
autofocus
|
| 34 |
+
></textarea>
|
| 35 |
|
| 36 |
+
<div class="controls">
|
| 37 |
+
<div class="language-selector">
|
| 38 |
+
<label for="language">Language:</label>
|
| 39 |
+
<select id="language">
|
| 40 |
+
<option value="javascript">JavaScript</option>
|
| 41 |
+
<option value="python">Python</option>
|
| 42 |
+
<option value="html">HTML/CSS</option>
|
| 43 |
+
<option value="react">React</option>
|
| 44 |
+
<option value="sql">SQL</option>
|
| 45 |
+
<option value="bash">Bash/Shell</option>
|
| 46 |
+
<option value="other">Other</option>
|
| 47 |
+
</select>
|
| 48 |
+
</div>
|
| 49 |
+
<button id="generate-btn" class="generate-btn" disabled>
|
| 50 |
+
<span class="btn-text">Loading Model...</span>
|
| 51 |
+
<span class="btn-spinner" style="display: none;"></span>
|
| 52 |
+
</button>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
| 55 |
|
| 56 |
+
<div class="model-info" id="model-info" style="display: none;">
|
| 57 |
+
<p>⚠️ First load: ~3-4GB model download. Subsequent loads will be cached.</p>
|
| 58 |
+
</div>
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
<div class="loading-section" id="loading-section" style="display: none;">
|
| 61 |
+
<div class="progress-container">
|
| 62 |
+
<div class="progress-bar" id="progress-bar"></div>
|
| 63 |
+
</div>
|
| 64 |
+
<p class="loading-text" id="loading-text">Loading model...</p>
|
| 65 |
+
<p class="loading-subtext">This may take several minutes on first load</p>
|
| 66 |
+
</div>
|
| 67 |
|
| 68 |
+
<div class="error-section" id="error-section" style="display: none;">
|
| 69 |
+
<p class="error-text" id="error-text"></p>
|
| 70 |
+
<button id="dismiss-error" class="dismiss-btn">Dismiss</button>
|
| 71 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
+
<div class="output-section" id="output-section" style="display: none;">
|
| 74 |
+
<div class="output-header">
|
| 75 |
+
<span>Generated Code</span>
|
| 76 |
+
<button id="copy-btn" class="copy-btn">Copy</button>
|
| 77 |
+
</div>
|
| 78 |
+
<pre><code class="language-javascript" id="generated-code"></code></pre>
|
| 79 |
+
</div>
|
| 80 |
+
</main>
|
| 81 |
|
| 82 |
+
<footer>
|
| 83 |
+
<p>Powered by <a href="https://huggingface.co/docs/transformers.js" target="_blank">Transformers.js</a> •
|
| 84 |
+
Runs locally in your browser •
|
| 85 |
+
<a href="https://github.com/yourusername/anycoder" target="_blank">View Source</a></p>
|
| 86 |
+
</footer>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<!-- Scripts -->
|
| 90 |
+
<script src="https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.0.0-alpha.13"></script>
|
| 91 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
|
| 92 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js"></script>
|
| 93 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>
|
| 94 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-sql.min.js"></script>
|
| 95 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script>
|
| 96 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-jsx.min.js"></script>
|
| 97 |
+
<script src="index.js"></script>
|
| 98 |
</body>
|
| 99 |
</html>
|