commit 94549a99ce708eb5492ad180a992450cb0471608
Author: root <root@hub.scroll.pub> Date: 2025-01-04 11:33:40 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..50171af --- /dev/null +++ b/body.html @@ -0,0 +1,23 @@ +<header> + <h1>DeepSeek AI</h1> + <p>智能语音交互,畅聊未来科技</p> +</header> + +<main> + <section id="chat-section"> + <div id="chat-box"></div> + <div id="input-container"> + <textarea id="user-input" placeholder="输入您的问题或点击下方麦克风说话..."></textarea> + <button id="voice-btn" aria-label="语音输入"> + <svg viewBox="0 0 24 24" width="24" height="24"> + <path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5-3c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"/> + </svg> + </button> + <button id="send-btn">发送</button> + </div> + </section> +</main> + +<footer> + <p>探索AI的无限可能</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..4148591 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://deepseekai.scroll.pub +metaTags +editButton /edit.html +title DeepSeek AI - 智能语音交互 +style.css +body.html +script.js \ No newline at end of file diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..36207df --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "e84fa124-1aa1-4c8d-b38a-482f50b8ca9b", + "object": "chat.completion", + "created": 1735990396, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\ndeepseekai.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://deepseekai.scroll.pub\nmetaTags\neditButton /edit.html\ntitle DeepSeek AI - 智能语音交互\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>DeepSeek AI</h1>\n <p>智能语音交互,畅聊未来科技</p>\n</header>\n\n<main>\n <section id=\"chat-section\">\n <div id=\"chat-box\"></div>\n <div id=\"input-container\">\n <textarea id=\"user-input\" placeholder=\"输入您的问题或点击下方麦克风说话...\"></textarea>\n <button id=\"voice-btn\" aria-label=\"语音输入\">\n <svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\">\n <path d=\"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5-3c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z\"/>\n </svg>\n </button>\n <button id=\"send-btn\">发送</button>\n </div>\n </section>\n</main>\n\n<footer>\n <p>探索AI的无限可能</p>\n</footer>\n---style.css---\n:root {\n --primary-color: #1a73e8;\n --secondary-color: #34a853;\n --background-color: #f5f5f5;\n --text-color: #202124;\n --border-radius: 8px;\n --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: 'Segoe UI', sans-serif;\n background-color: var(--background-color);\n color: var(--text-color);\n line-height: 1.6;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n}\n\nheader {\n background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));\n color: white;\n padding: 2rem;\n text-align: center;\n box-shadow: var(--box-shadow);\n}\n\nheader h1 {\n font-size: 2.5rem;\n margin-bottom: 0.5rem;\n}\n\nheader p {\n font-size: 1.2rem;\n}\n\nmain {\n flex: 1;\n padding: 2rem;\n max-width: 800px;\n margin: 0 auto;\n width: 100%;\n}\n\n#chat-section {\n background: white;\n border-radius: var(--border-radius);\n box-shadow: var(--box-shadow);\n padding: 1.5rem;\n}\n\n#chat-box {\n height: 400px;\n overflow-y: auto;\n border: 1px solid #ddd;\n border-radius: var(--border-radius);\n padding: 1rem;\n margin-bottom: 1rem;\n background-color: #fafafa;\n}\n\n#input-container {\n display: flex;\n gap: 0.5rem;\n align-items: center;\n}\n\n#user-input {\n flex: 1;\n padding: 0.75rem;\n border: 1px solid #ddd;\n border-radius: var(--border-radius);\n resize: none;\n min-height: 50px;\n}\n\n#voice-btn {\n background: var(--primary-color);\n color: white;\n border: none;\n padding: 0.75rem;\n border-radius: 50%;\n cursor: pointer;\n transition: background 0.3s ease;\n}\n\n#voice-btn:hover {\n background: #1557b7;\n}\n\n#send-btn {\n background: var(--secondary-color);\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n transition: background 0.3s ease;\n}\n\n#send-btn:hover {\n background: #2a8a4a;\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background: white;\n box-shadow: var(--box-shadow);\n margin-top: auto;\n}\n\n@media (max-width: 768px) {\n header h1 {\n font-size: 2rem;\n }\n\n header p {\n font-size: 1rem;\n }\n\n #chat-box {\n height: 300px;\n }\n\n #input-container {\n flex-direction: column;\n }\n\n #send-btn {\n width: 100%;\n }\n}\n---script.js---\nconst chatBox = document.getElementById('chat-box');\nconst userInput = document.getElementById('user-input');\nconst voiceBtn = document.getElementById('voice-btn');\nconst sendBtn = document.getElementById('send-btn');\n\nlet recognition;\n\nfunction addMessage(content, isUser = false) {\n const messageDiv = document.createElement('div');\n messageDiv.classList.add('message', isUser ? 'user-message' : 'ai-message');\n messageDiv.textContent = content;\n chatBox.appendChild(messageDiv);\n chatBox.scrollTop = chatBox.scrollHeight;\n}\n\nfunction sendMessage() {\n const message = userInput.value.trim();\n if (message) {\n addMessage(message, true);\n userInput.value = '';\n // Here you would typically send the message to the DeepSeek API\n // and handle the response\n setTimeout(() => {\n addMessage('这是一个示例回复。实际应用中,这里会显示DeepSeek的回复。');\n }, 1000);\n }\n}\n\nfunction startVoiceRecognition() {\n if (!('webkitSpeechRecognition' in window)) {\n alert('您的浏览器不支持语音识别功能');\n return;\n }\n\n recognition = new webkitSpeechRecognition();\n recognition.lang = 'zh-CN';\n recognition.continuous = false;\n recognition.interimResults = false;\n\n recognition.onresult = function(event) {\n const transcript = event.results[0][0].transcript;\n userInput.value = transcript;\n sendMessage();\n };\n\n recognition.onerror = function(event) {\n console.error('语音识别错误:', event.error);\n };\n\n recognition.start();\n}\n\nsendBtn.addEventListener('click', sendMessage);\nvoiceBtn.addEventListener('click', startVoiceRecognition);\n\nuserInput.addEventListener('keydown', function(event) {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n sendMessage();\n }\n});\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 256, + "completion_tokens": 1532, + "total_tokens": 1788, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 256 + }, + "system_fingerprint": "fp_3a5770e1b4" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..9dc38fd --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# deepseekai.scroll.pub +Website generated by DeepSeek from prompt: 帮我建一个中文的网站,网站可以链接deepseek大模型进行人机交互,可以进行语音互动 \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..a9368eb --- /dev/null +++ b/script.js @@ -0,0 +1,61 @@ +const chatBox = document.getElementById('chat-box'); +const userInput = document.getElementById('user-input'); +const voiceBtn = document.getElementById('voice-btn'); +const sendBtn = document.getElementById('send-btn'); + +let recognition; + +function addMessage(content, isUser = false) { + const messageDiv = document.createElement('div'); + messageDiv.classList.add('message', isUser ? 'user-message' : 'ai-message'); + messageDiv.textContent = content; + chatBox.appendChild(messageDiv); + chatBox.scrollTop = chatBox.scrollHeight; +} + +function sendMessage() { + const message = userInput.value.trim(); + if (message) { + addMessage(message, true); + userInput.value = ''; + // Here you would typically send the message to the DeepSeek API + // and handle the response + setTimeout(() => { + addMessage('这是一个示例回复。实际应用中,这里会显示DeepSeek的回复。'); + }, 1000); + } +} + +function startVoiceRecognition() { + if (!('webkitSpeechRecognition' in window)) { + alert('您的浏览器不支持语音识别功能'); + return; + } + + recognition = new webkitSpeechRecognition(); + recognition.lang = 'zh-CN'; + recognition.continuous = false; + recognition.interimResults = false; + + recognition.onresult = function(event) { + const transcript = event.results[0][0].transcript; + userInput.value = transcript; + sendMessage(); + }; + + recognition.onerror = function(event) { + console.error('语音识别错误:', event.error); + }; + + recognition.start(); +} + +sendBtn.addEventListener('click', sendMessage); +voiceBtn.addEventListener('click', startVoiceRecognition); + +userInput.addEventListener('keydown', function(event) { + if (event.key === 'Enter' && !event.shiftKey) { + event.preventDefault(); + sendMessage(); + } +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..0d0a511 --- /dev/null +++ b/style.css @@ -0,0 +1,139 @@ +:root { + --primary-color: #1a73e8; + --secondary-color: #34a853; + --background-color: #f5f5f5; + --text-color: #202124; + --border-radius: 8px; + --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Segoe UI', sans-serif; + background-color: var(--background-color); + color: var(--text-color); + line-height: 1.6; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +header { + background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); + color: white; + padding: 2rem; + text-align: center; + box-shadow: var(--box-shadow); +} + +header h1 { + font-size: 2.5rem; + margin-bottom: 0.5rem; +} + +header p { + font-size: 1.2rem; +} + +main { + flex: 1; + padding: 2rem; + max-width: 800px; + margin: 0 auto; + width: 100%; +} + +#chat-section { + background: white; + border-radius: var(--border-radius); + box-shadow: var(--box-shadow); + padding: 1.5rem; +} + +#chat-box { + height: 400px; + overflow-y: auto; + border: 1px solid #ddd; + border-radius: var(--border-radius); + padding: 1rem; + margin-bottom: 1rem; + background-color: #fafafa; +} + +#input-container { + display: flex; + gap: 0.5rem; + align-items: center; +} + +#user-input { + flex: 1; + padding: 0.75rem; + border: 1px solid #ddd; + border-radius: var(--border-radius); + resize: none; + min-height: 50px; +} + +#voice-btn { + background: var(--primary-color); + color: white; + border: none; + padding: 0.75rem; + border-radius: 50%; + cursor: pointer; + transition: background 0.3s ease; +} + +#voice-btn:hover { + background: #1557b7; +} + +#send-btn { + background: var(--secondary-color); + color: white; + border: none; + padding: 0.75rem 1.5rem; + border-radius: var(--border-radius); + cursor: pointer; + transition: background 0.3s ease; +} + +#send-btn:hover { + background: #2a8a4a; +} + +footer { + text-align: center; + padding: 1rem; + background: white; + box-shadow: var(--box-shadow); + margin-top: auto; +} + +@media (max-width: 768px) { + header h1 { + font-size: 2rem; + } + + header p { + font-size: 1rem; + } + + #chat-box { + height: 300px; + } + + #input-container { + flex-direction: column; + } + + #send-btn { + width: 100%; + } +} \ No newline at end of file