| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>AI Assistant Activated | Hourly 150MB</title> |
| <script src="https://cdn.tailwindcss.com"></script> |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
| <style> |
| .animate-float { |
| animation: float 6s ease-in-out infinite; |
| } |
| @keyframes float { |
| 0% { transform: translateY(0px) rotate(0deg); } |
| 50% { transform: translateY(-20px) rotate(3deg); } |
| 100% { transform: translateY(0px) rotate(0deg); } |
| } |
| .gradient-text { |
| background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899); |
| -webkit-background-clip: text; |
| background-clip: text; |
| color: transparent; |
| background-size: 300% 300%; |
| animation: gradient 8s ease infinite; |
| } |
| @keyframes gradient { |
| 0% { background-position: 0% 50%; } |
| 50% { background-position: 100% 50%; } |
| 100% { background-position: 0% 50%; } |
| } |
| .card-hover { |
| transition: all 0.3s ease; |
| } |
| .card-hover:hover { |
| transform: translateY(-5px) translateZ(0); |
| } |
| .pulse { |
| animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; |
| } |
| @keyframes pulse { |
| 0%, 100% { opacity: 1; } |
| 50% { opacity: 0.7; } |
| } |
| .smooth-shadow { |
| box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.15); |
| } |
| .input-shadow:focus { |
| box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3); |
| } |
| .progress-bar { |
| animation: progress 90s linear 1 forwards; |
| } |
| @keyframes progress { |
| 0% { width: 100%; } |
| 100% { width: 0%; } |
| } |
| </style> |
| </head> |
| <body class="font-['Inter'] bg-gradient-to-br from-gray-50 to-indigo-50 min-h-screen flex items-center justify-center p-4 sm:p-6"> |
| <div class="max-w-4xl w-full mx-auto"> |
| |
| <div class="bg-indigo-600/10 border border-indigo-600/20 text-indigo-800 px-4 py-3 rounded-lg mb-8 flex items-start"> |
| <div class="flex-shrink-0 pt-1 mr-3"> |
| <i class="fas fa-check-circle text-indigo-600"></i> |
| </div> |
| <div class="flex-1"> |
| <p class="font-medium">Hourly 150MB successfully activated!</p> |
| <p class="text-sm text-indigo-700/90 mt-1">Your AI assistant is now ready with maximum resources.</p> |
| </div> |
| <button class="text-indigo-600 hover:text-indigo-800 ml-2"> |
| <i class="fas fa-times"></i> |
| </button> |
| </div> |
|
|
| |
| <div class="bg-white rounded-2xl smooth-shadow overflow-hidden"> |
| |
| <div class="bg-gradient-to-r from-indigo-500 to-purple-500 text-white px-6 py-4 flex flex-col sm:flex-row sm:items-center sm:justify-between"> |
| <div class="flex items-center mb-3 sm:mb-0"> |
| <div class="bg-white/20 rounded-full p-2 mr-3"> |
| <i class="fas fa-bolt text-yellow-200 text-sm"></i> |
| </div> |
| <div> |
| <h2 class="font-bold text-lg sm:text-xl">AI Assistant Pro</h2> |
| <p class="text-xs text-indigo-100 flex items-center"> |
| <span class="inline-block w-2 h-2 bg-green-300 rounded-full mr-1"></span> |
| Active connection |
| </p> |
| </div> |
| </div> |
| |
| <div class="flex items-center space-x-4"> |
| <div class="text-center"> |
| <p class="text-xs text-indigo-100 mb-1">Session Time</p> |
| <p class="text-sm font-medium">60:00</p> |
| </div> |
| <div class="hidden sm:block h-6 w-px bg-indigo-400"></div> |
| <div class="text-center"> |
| <p class="text-xs text-indigo-100 mb-1">Resources</p> |
| <div class="flex items-center"> |
| <i class="fas fa-memory text-xs mr-1 text-indigo-100"></i> |
| <p class="text-sm font-medium">150MB</p> |
| </div> |
| </div> |
| </div> |
| </div> |
|
|
| |
| <div class="h-1.5 bg-indigo-100 relative overflow-hidden"> |
| <div class="progress-bar h-full bg-indigo-500 absolute top-0 left-0"></div> |
| </div> |
|
|
| |
| <div class="flex items-center justify-center py-8 px-6"> |
| <div class="relative"> |
| <div class="absolute -inset-4 bg-indigo-500/10 rounded-full blur-lg animate-pulse"></div> |
| <div class="relative bg-white p-5 rounded-full shadow-lg animate-float"> |
| <div class="w-24 h-24 bg-gradient-to-br from-indigo-100 to-purple-100 rounded-full flex items-center justify-center"> |
| <i class="fas fa-robot text-4xl gradient-text"></i> |
| </div> |
| </div> |
| </div> |
| </div> |
|
|
| <div class="px-6 pb-1"> |
| <h1 class="text-3xl sm:text-4xl font-bold text-center text-gray-800 mb-3"> |
| <span class="gradient-text">Ready to Assist</span> |
| <span class="text-gray-500">You!</span> |
| </h1> |
| <p class="text-gray-500 text-center max-w-2xl mx-auto mb-8"> |
| I'm powered up with 150MB of resources to provide you with the best assistance possible. |
| Ask me anything and I'll respond with thoughtful, detailed answers. |
| </p> |
| </div> |
|
|
| |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-5 px-6 py-4 bg-gradient-to-b from-indigo-50 to-white"> |
| <div class="bg-white rounded-xl p-5 card-hover shadow-sm border border-gray-100"> |
| <div class="bg-indigo-50 w-12 h-12 rounded-lg flex items-center justify-center mb-4"> |
| <i class="fas fa-bolt text-xl text-indigo-500"></i> |
| </div> |
| <h3 class="font-semibold text-lg mb-2 text-gray-800">High-Performance</h3> |
| <p class="text-gray-500 text-sm">Optimized responses with maximum allocated resources</p> |
| </div> |
| <div class="bg-white rounded-xl p-5 card-hover shadow-sm border border-gray-100"> |
| <div class="bg-purple-50 w-12 h-12 rounded-lg flex items-center justify-center mb-4"> |
| <i class="fas fa-brain text-xl text-purple-500"></i> |
| </div> |
| <h3 class="font-semibold text-lg mb-2 text-gray-800">Enhanced AI</h3> |
| <p class="text-gray-500 text-sm">More memory means better comprehension and recall</p> |
| </div> |
| <div class="bg-white rounded-xl p-5 card-hover shadow-sm border border-gray-100"> |
| <div class="bg-pink-50 w-12 h-12 rounded-lg flex items-center justify-center mb-4"> |
| <i class="fas fa-code text-xl text-pink-500"></i> |
| </div> |
| <h3 class="font-semibold text-lg mb-2 text-gray-800">Code Support</h3> |
| <p class="text-gray-500 text-sm">Full programming assistance with syntax highlighting</p> |
| </div> |
| </div> |
|
|
| |
| <div class="px-6 py-6"> |
| <div class="relative"> |
| <textarea |
| class="w-full px-5 py-4 bg-gray-50 rounded-2xl border-none input-shadow focus:ring-2 focus:ring-indigo-200 focus:border-transparent resize-none" |
| rows="3" |
| placeholder="Ask your question here... (150MB resources allocated)" |
| autofocus |
| ></textarea> |
| <button class="absolute right-4 bottom-4 bg-indigo-500 hover:bg-indigo-600 text-white rounded-xl px-5 py-2 transition-all flex items-center shadow-md hover:shadow-lg"> |
| <i class="fas fa-paper-plane mr-2"></i> |
| <span>Send</span> |
| </button> |
| </div> |
| <p class="text-xs text-gray-400 mt-3 flex items-center"> |
| <i class="fas fa-info-circle mr-1.5"></i> |
| Your data and conversations are processed securely with your allocated 150MB resources |
| </p> |
| </div> |
| </div> |
|
|
| |
| <div class="flex flex-col sm:flex-row items-center justify-between mt-6 text-sm text-gray-500"> |
| <div class="flex items-center mb-3 sm:mb-0"> |
| <div class="h-3 w-3 rounded-full bg-green-400 mr-2 pulse"></div> |
| <span>System status: Operational</span> |
| </div> |
| <div class="flex items-center space-x-4"> |
| <a href="#" class="hover:text-indigo-600 transition-colors"><i class="fas fa-shield-alt mr-1"></i> Security</a> |
| <a href="#" class="hover:text-indigo-600 transition-colors"><i class="fas fa-cog mr-1"></i> Settings</a> |
| <a href="#" class="hover:text-indigo-600 transition-colors"><i class="fas fa-question-circle mr-1"></i> Help</a> |
| </div> |
| </div> |
| </div> |
|
|
| <script> |
| document.addEventListener('DOMContentLoaded', function() { |
| |
| function updateTimer() { |
| let minutes = 59; |
| let seconds = 59; |
| |
| const timerElement = document.querySelector('.status-timer'); |
| const timerInterval = setInterval(() => { |
| seconds--; |
| if (seconds < 0) { |
| seconds = 59; |
| minutes--; |
| } |
| |
| if (minutes < 0) { |
| clearInterval(timerInterval); |
| } else { |
| timerElement.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; |
| } |
| }, 1000); |
| } |
| |
| updateTimer(); |
| |
| |
| const textarea = document.querySelector('textarea'); |
| textarea.addEventListener('input', function() { |
| this.style.height = 'auto'; |
| this.style.height = (this.scrollHeight) + 'px'; |
| }); |
| |
| |
| const sendButton = document.querySelector('button'); |
| sendButton.addEventListener('mouseenter', function() { |
| this.innerHTML = '<i class="fas fa-paper-plane mr-2 animate-bounce"></i><span>Send</span>'; |
| }); |
| sendButton.addEventListener('mouseleave', function() { |
| this.innerHTML = '<i class="fas fa-paper-plane mr-2"></i><span>Send</span>'; |
| }); |
| }); |
| </script> |
| </body> |
| </html><!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://unpkg.com/es-module-shims@1.7.0/dist/es-module-shims.js"></script> |
| <script type="importmap"> |
| { |
| "imports": { |
| "@huggingface/hub": "https://cdn.jsdelivr.net/npm/@huggingface/hub@0.21.0/+esm" |
| } |
| } |
| </script> |
| </head> |
| <body> |
| <div class="card" style="margin-bottom: 2rem;"> |
| <h1>OAuth in a static Space</h1> |
| <p>Checkout the <a href="https://huggingface.co/spaces/huggingfacejs/client-side-oauth/blob/main/index.html" target="_blank">index.html</a> file to see the few lines of code |
| enabling this space</p> |
| <p>After clicking "Signin with HF", you will be redirected to this space and the access token + user info will be displayed.</p> |
| </div> |
| <img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/sign-in-with-huggingface-xl-dark.svg" alt="Sign in with Hugging Face" style="cursor: pointer; display: none;" id="signin"> |
| <button id="signout" style="display: none">Sign out</button> |
| <pre> |
| |
| </pre> |
| <script type="module"> |
| import { oauthLoginUrl, oauthHandleRedirectIfPresent } from "@huggingface/hub"; |
| |
| console.log("huggingface env", window.huggingface); |
| |
| let oauthResult = localStorage.getItem("oauth"); |
| |
| if (oauthResult) { |
| try { |
| oauthResult = JSON.parse(oauthResult); |
| } catch { |
| oauthResult = null; |
| } |
| } |
| |
| oauthResult ||= await oauthHandleRedirectIfPresent(); |
| |
| if (oauthResult) { |
| document.querySelector("pre").textContent = JSON.stringify(oauthResult, null, 2); |
| localStorage.setItem("oauth", JSON.stringify(oauthResult)); |
| document.getElementById("signout").style.removeProperty("display"); |
| document.getElementById("signout").onclick = async function() { |
| localStorage.removeItem("oauth"); |
| window.location.href = window.location.href.replace(/\?.*$/, ''); |
| window.location.reload(); |
| } |
| } else { |
| document.getElementById("signin").style.removeProperty("display"); |
| document.getElementById("signin").onclick = async function() { |
| |
| window.location.href = (await oauthLoginUrl({scopes: window.huggingface.variables.OAUTH_SCOPES})) + "&prompt=consent"; |
| } |
| } |
| </script> |
| </body> |
| </html> |
|
|