deep-prototyping / index.html
mawazawa's picture
Add 3 files
23d7e88 verified
Raw History Blame Contribute Delete
19.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChatOS™ - Voice-First AI Assistant</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes pulse-ring {
0% { transform: scale(0.33); opacity: 1; }
80%, 100% { transform: scale(1.5); opacity: 0; }
}
@keyframes pulse-dot {
0% { transform: scale(0.8); }
50% { transform: scale(1); }
100% { transform: scale(0.8); }
}
.voice-pulse {
position: relative;
}
.voice-pulse::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 50%;
background: rgba(59, 130, 246, 0.5);
animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
.voice-pulse .inner-dot {
animation: pulse-dot 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}
.typing-indicator span {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background: #9CA3AF;
margin: 0 2px;
}
.typing-indicator span:nth-child(1) {
animation: bounce 1s infinite;
}
.typing-indicator span:nth-child(2) {
animation: bounce 1s infinite 0.2s;
}
.typing-indicator span:nth-child(3) {
animation: bounce 1s infinite 0.4s;
}
@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-5px); }
}
.message-transition {
transition: all 0.3s ease;
}
.fade-in {
animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
</style>
</head>
<body class="bg-gray-50 text-gray-900 font-sans antialiased h-screen flex flex-col">
<!-- Header -->
<header class="bg-white border-b border-gray-200 py-3 px-4 flex items-center justify-between">
<div class="flex items-center space-x-2">
<div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white font-bold">C</div>
<h1 class="text-xl font-semibold">ChatOS™</h1>
</div>
<div class="flex items-center space-x-4">
<button class="text-gray-500 hover:text-gray-700 transition">
<i class="fas fa-cog"></i>
</button>
<button class="text-gray-500 hover:text-gray-700 transition">
<i class="fas fa-moon"></i>
</button>
<div class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center">
<i class="fas fa-user text-gray-500"></i>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-1 flex overflow-hidden">
<!-- Sidebar -->
<aside class="w-64 bg-white border-r border-gray-200 hidden md:block overflow-y-auto">
<div class="p-4">
<button class="w-full bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-lg flex items-center justify-center space-x-2 transition">
<i class="fas fa-plus"></i>
<span>New Chat</span>
</button>
</div>
<div class="px-2">
<div class="text-xs font-semibold text-gray-500 uppercase tracking-wider px-4 py-2">Recent Chats</div>
<div class="space-y-1">
<a href="#" class="block px-4 py-2 text-sm rounded-lg hover:bg-gray-100 text-gray-700 bg-gray-100">
<div class="flex items-center space-x-2">
<i class="fas fa-comment text-gray-400"></i>
<span class="truncate">Website redesign concepts</span>
</div>
</a>
<a href="#" class="block px-4 py-2 text-sm rounded-lg hover:bg-gray-100 text-gray-700">
<div class="flex items-center space-x-2">
<i class="fas fa-comment text-gray-400"></i>
<span class="truncate">Marketing strategy Q4</span>
</div>
</a>
<a href="#" class="block px-4 py-2 text-sm rounded-lg hover:bg-gray-100 text-gray-700">
<div class="flex items-center space-x-2">
<i class="fas fa-comment text-gray-400"></i>
<span class="truncate">Python code review</span>
</div>
</a>
<a href="#" class="block px-4 py-2 text-sm rounded-lg hover:bg-gray-100 text-gray-700">
<div class="flex items-center space-x-2">
<i class="fas fa-comment text-gray-400"></i>
<span class="truncate">Travel itinerary for Japan</span>
</div>
</a>
</div>
</div>
</aside>
<!-- Chat Area -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Messages Container -->
<div id="messages" class="flex-1 overflow-y-auto p-4 space-y-4 scrollbar-hide">
<!-- Welcome Message -->
<div class="message-transition fade-in">
<div class="flex space-x-3 max-w-3xl mx-auto">
<div class="flex-shrink-0">
<div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white">
<i class="fas fa-robot"></i>
</div>
</div>
<div class="flex-1 min-w-0">
<div class="bg-white p-4 rounded-lg shadow-sm border border-gray-200">
<div class="text-sm text-gray-700">
<p>Hello! I'm ChatOS™, your voice-first AI assistant. How can I help you today?</p>
<p class="mt-2">You can type or tap the microphone to speak naturally.</p>
</div>
<div class="mt-3 flex flex-wrap gap-2">
<button class="text-xs bg-gray-100 hover:bg-gray-200 px-3 py-1 rounded-full transition">
Suggest a marketing strategy
</button>
<button class="text-xs bg-gray-100 hover:bg-gray-200 px-3 py-1 rounded-full transition">
Help me debug this code
</button>
<button class="text-xs bg-gray-100 hover:bg-gray-200 px-3 py-1 rounded-full transition">
Plan a weekend trip
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Input Area -->
<div class="border-t border-gray-200 bg-white p-4">
<div class="max-w-3xl mx-auto">
<!-- Voice Input UI -->
<div id="voice-input-ui" class="hidden mb-4">
<div class="flex items-center justify-center space-x-4">
<div class="text-sm text-gray-500 flex items-center">
<div class="typing-indicator mr-2">
<span></span>
<span></span>
<span></span>
</div>
<span id="voice-status">Listening...</span>
</div>
<div id="voice-visualizer" class="flex-1 h-2 bg-gray-200 rounded-full overflow-hidden">
<div class="h-full bg-blue-500 transition-all duration-100" style="width: 0%"></div>
</div>
<button id="stop-voice" class="text-red-500 hover:text-red-700 transition">
<i class="fas fa-stop"></i>
</button>
</div>
</div>
<!-- Text Input -->
<div class="relative">
<textarea id="message-input" rows="1" placeholder="Type a message or tap the microphone..." class="w-full border border-gray-300 rounded-lg py-3 px-4 pr-12 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none" style="min-height: 50px;"></textarea>
<div class="absolute right-3 bottom-3 flex space-x-2">
<button id="voice-button" class="w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition">
<i class="fas fa-microphone"></i>
</button>
<button id="send-button" class="w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
<div class="mt-2 text-xs text-gray-500 text-center">
<span>ChatOS™ v2.1 · <span id="transcription-speed">Transcription speed: 0.2s</span> · <a href="#" class="text-blue-500 hover:underline">Privacy</a></span>
</div>
</div>
</div>
</div>
</main>
<!-- Mobile Bottom Navigation -->
<div class="md:hidden bg-white border-t border-gray-200 py-2 px-4 flex justify-around">
<button class="p-2 text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-home"></i>
</button>
<button class="p-2 text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-comment"></i>
</button>
<button id="mobile-voice-button" class="p-2 text-white bg-blue-500 rounded-full w-12 h-12 flex items-center justify-center -mt-4 shadow-lg hover:bg-blue-600 transition">
<i class="fas fa-microphone"></i>
</button>
<button class="p-2 text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-bookmark"></i>
</button>
<button class="p-2 text-gray-500 hover:text-blue-500 transition">
<i class="fas fa-cog"></i>
</button>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const messageInput = document.getElementById('message-input');
const sendButton = document.getElementById('send-button');
const voiceButton = document.getElementById('voice-button');
const mobileVoiceButton = document.getElementById('mobile-voice-button');
const voiceInputUI = document.getElementById('voice-input-ui');
const stopVoiceButton = document.getElementById('stop-voice');
const voiceStatus = document.getElementById('voice-status');
const voiceVisualizer = document.getElementById('voice-visualizer').querySelector('div');
const messagesContainer = document.getElementById('messages');
const transcriptionSpeed = document.getElementById('transcription-speed');
// Auto-resize textarea
messageInput.addEventListener('input', function() {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
// Send message function
function sendMessage() {
const message = messageInput.value.trim();
if (message === '') return;
// Add user message
addMessage(message, 'user');
messageInput.value = '';
messageInput.style.height = 'auto';
// Simulate AI response
setTimeout(() => {
addMessage("I'm analyzing your request. Here's what I found...", 'ai');
}, 1000);
}
// Add message to chat
function addMessage(text, sender) {
const messageDiv = document.createElement('div');
messageDiv.className = 'message-transition fade-in';
const messageContent = `
<div class="flex space-x-3 max-w-3xl mx-auto ${sender === 'user' ? 'flex-row-reverse' : ''}">
<div class="flex-shrink-0">
<div class="w-8 h-8 rounded-full ${sender === 'user' ? 'bg-gray-300' : 'bg-blue-500'} flex items-center justify-center text-white">
<i class="fas ${sender === 'user' ? 'fa-user' : 'fa-robot'}"></i>
</div>
</div>
<div class="flex-1 min-w-0 ${sender === 'user' ? 'text-right' : ''}">
<div class="${sender === 'user' ? 'bg-blue-500 text-white' : 'bg-white border border-gray-200'} p-4 rounded-lg shadow-sm">
<div class="text-sm">
${text}
</div>
</div>
</div>
</div>
`;
messageDiv.innerHTML = messageContent;
messagesContainer.appendChild(messageDiv);
messagesContainer.scrollTop = messagesContainer.scrollHeight;
}
// Send message on Enter (but allow Shift+Enter for new lines)
messageInput.addEventListener('keydown', function(e) {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
sendMessage();
}
});
// Send message on button click
sendButton.addEventListener('click', sendMessage);
// Voice input simulation
let voiceInterval;
let voiceLevel = 0;
function startVoiceInput() {
voiceInputUI.classList.remove('hidden');
voiceButton.classList.add('voice-pulse');
voiceButton.querySelector('i').classList.replace('fa-microphone', 'fa-microphone-alt');
voiceButton.querySelector('i').classList.add('inner-dot');
// Simulate voice level changes
voiceInterval = setInterval(() => {
voiceLevel = Math.min(Math.max(voiceLevel + (Math.random() * 20 - 10), 0), 100);
voiceVisualizer.style.width = voiceLevel + '%';
// Simulate transcription
if (Math.random() > 0.7) {
const words = ["Hello", "I", "need", "help", "with", "my", "project", "about", "AI", "technology", "Can", "you", "suggest", "some", "ideas", "for", "implementation"];
const newWord = words[Math.floor(Math.random() * words.length)];
messageInput.value = (messageInput.value + ' ' + newWord).trim();
messageInput.dispatchEvent(new Event('input'));
}
}, 200);
// Update status messages
const statusMessages = [
"Listening...",
"Processing...",
"Transcribing...",
"Analyzing tone...",
"Almost done..."
];
let statusIndex = 0;
const statusInterval = setInterval(() => {
statusIndex = (statusIndex + 1) % statusMessages.length;
voiceStatus.textContent = statusMessages[statusIndex];
}, 1500);
// Stop voice input after 10 seconds (simulation)
setTimeout(() => {
stopVoiceInput();
clearInterval(statusInterval);
}, 10000);
}
function stopVoiceInput() {
clearInterval(voiceInterval);
voiceInputUI.classList.add('hidden');
voiceButton.classList.remove('voice-pulse');
voiceButton.querySelector('i').classList.replace('fa-microphone-alt', 'fa-microphone');
voiceButton.querySelector('i').classList.remove('inner-dot');
voiceVisualizer.style.width = '0%';
}
voiceButton.addEventListener('click', function() {
if (voiceInputUI.classList.contains('hidden')) {
startVoiceInput();
} else {
stopVoiceInput();
}
});
mobileVoiceButton.addEventListener('click', startVoiceInput);
stopVoiceButton.addEventListener('click', stopVoiceInput);
// Simulate transcription speed changes
const speeds = ["0.15s", "0.18s", "0.20s", "0.22s", "0.25s"];
setInterval(() => {
transcriptionSpeed.textContent = `Transcription speed: ${speeds[Math.floor(Math.random() * speeds.length)]}`;
}, 3000);
// Add sample messages
setTimeout(() => {
addMessage("Hi there! I'm wondering if you can help me plan a weekend getaway?", 'user');
setTimeout(() => {
addMessage("Of course! I'd be happy to help you plan a weekend getaway. Could you tell me your preferred destination, budget, and any specific activities you're interested in?", 'ai');
}, 800);
}, 1500);
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=mawazawa/deep-prototyping" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>