Changes to labassist.scroll.pub

root
root
24 days ago
Initial commit
body.html
Changed around line 1
+
+

实验助手

+

在线调用本地摄像头,加载实验指导书,通过语音交互指导实验

+
+
+
+
+

摄像头

+
+
+
+
+
+
+
+

实验指导书

+
+
+
+
+
+
+
+
+

语音指导

+
+
+
+
+
+
+
+
+

实验助手 - 让实验更简单

+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://labassist.scroll.pub
+ metaTags
+ editButton /edit.html
+ title 实验助手 - 在线实验指导
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "275c56e6-6e6c-45d9-b945-8aa758618fef",
+ "object": "chat.completion",
+ "created": 1735430243,
+ "model": "deepseek-chat",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "---domain---\nlabassist.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://labassist.scroll.pub\nmetaTags\neditButton /edit.html\ntitle 实验助手 - 在线实验指导\nstyle.css\nbody.html\nscript.js\n---body.html---\n
\n

实验助手

\n

在线调用本地摄像头,加载实验指导书,通过语音交互指导实验

\n
\n\n
\n
\n

摄像头

\n
\n \n \n
\n
\n\n
\n

实验指导书

\n
\n \n \n
\n \n
\n\n
\n

语音指导

\n
\n \n \n
\n
\n
\n\n
\n

实验助手 - 让实验更简单

\n
\n---style.css---\n:root {\n --primary-color: #4CAF50;\n --secondary-color: #45a049;\n --background-color: #f5f5f5;\n --text-color: #333;\n --white: #fff;\n}\n\nbody {\n font-family: 'Segoe UI', sans-serif;\n margin: 0;\n padding: 0;\n background-color: var(--background-color);\n color: var(--text-color);\n line-height: 1.6;\n}\n\nheader {\n background-color: var(--primary-color);\n color: var(--white);\n padding: 2rem;\n text-align: center;\n}\n\nh1 {\n margin: 0;\n font-size: 2.5rem;\n}\n\nmain {\n max-width: 1200px;\n margin: 2rem auto;\n padding: 0 1rem;\n}\n\nsection {\n margin-bottom: 2rem;\n background-color: var(--white);\n padding: 1.5rem;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\n.camera-container {\n position: relative;\n width: 100%;\n max-width: 640px;\n margin: 0 auto;\n}\n\n#camera-feed {\n width: 100%;\n height: auto;\n border-radius: 8px;\n display: none;\n}\n\nbutton {\n background-color: var(--primary-color);\n color: var(--white);\n border: none;\n padding: 0.8rem 1.5rem;\n border-radius: 4px;\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s ease;\n}\n\nbutton:hover {\n background-color: var(--secondary-color);\n}\n\n.document-upload {\n text-align: center;\n margin: 1rem 0;\n}\n\n.upload-button {\n display: inline-block;\n padding: 0.8rem 1.5rem;\n cursor: pointer;\n}\n\n#document-viewer {\n width: 100%;\n height: 500px;\n border: 1px solid #ddd;\n border-radius: 8px;\n margin-top: 1rem;\n}\n\n.voice-controls {\n text-align: center;\n}\n\n.hidden {\n display: none;\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background-color: var(--primary-color);\n color: var(--white);\n margin-top: 2rem;\n}\n\n@media (max-width: 768px) {\n h1 {\n font-size: 2rem;\n }\n \n #document-viewer {\n height: 300px;\n }\n}\n---script.js---\n// Camera functionality\nconst video = document.getElementById('camera-feed');\nconst startCameraBtn = document.getElementById('start-camera');\n\nstartCameraBtn.addEventListener('click', async () => {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n video.srcObject = stream;\n video.style.display = 'block';\n startCameraBtn.style.display = 'none';\n } catch (error) {\n alert('无法访问摄像头,请确保已授予权限');\n }\n});\n\n// Document upload functionality\nconst documentUpload = document.getElementById('document-upload');\nconst documentViewer = document.getElementById('document-viewer');\n\ndocumentUpload.addEventListener('change', (event) => {\n const file = event.target.files[0];\n if (file) {\n const fileURL = URL.createObjectURL(file);\n documentViewer.src = fileURL;\n documentViewer.classList.remove('hidden');\n }\n});\n\n// Voice functionality\nconst startVoiceBtn = document.getElementById('start-voice');\nconst stopVoiceBtn = document.getElementById('stop-voice');\nlet recognition;\n\nif ('webkitSpeechRecognition' in window) {\n recognition = new webkitSpeechRecognition();\n recognition.continuous = true;\n recognition.interimResults = true;\n recognition.lang = 'zh-CN';\n\n recognition.onstart = () => {\n startVoiceBtn.classList.add('hidden');\n stopVoiceBtn.classList.remove('hidden');\n };\n\n recognition.onend = () => {\n startVoiceBtn.classList.remove('hidden');\n stopVoiceBtn.classList.add('hidden');\n };\n\n recognition.onresult = (event) => {\n // Handle voice commands here\n console.log(event.results);\n };\n\n startVoiceBtn.addEventListener('click', () => {\n recognition.start();\n });\n\n stopVoiceBtn.addEventListener('click', () => {\n recognition.stop();\n });\n} else {\n startVoiceBtn.disabled = true;\n startVoiceBtn.textContent = '语音识别不可用';\n}\n---end---"
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 264,
+ "completion_tokens": 1376,
+ "total_tokens": 1640,
+ "prompt_cache_hit_tokens": 0,
+ "prompt_cache_miss_tokens": 264
+ },
+ "system_fingerprint": "fp_f1afce2943"
+ }
readme.scroll
Changed around line 1
+ # labassist.scroll.pub
+ Website generated by DeepSeek from prompt: 中文网站,在线调用本地摄像头,加载PDF或WORD版本的实验指导书,通过语音交互,指导摄像头里的人按实验指导书进行试验
script.js
Changed around line 1
+ // Camera functionality
+ const video = document.getElementById('camera-feed');
+ const startCameraBtn = document.getElementById('start-camera');
+
+ startCameraBtn.addEventListener('click', async () => {
+ try {
+ const stream = await navigator.mediaDevices.getUserMedia({ video: true });
+ video.srcObject = stream;
+ video.style.display = 'block';
+ startCameraBtn.style.display = 'none';
+ } catch (error) {
+ alert('无法访问摄像头,请确保已授予权限');
+ }
+ });
+
+ // Document upload functionality
+ const documentUpload = document.getElementById('document-upload');
+ const documentViewer = document.getElementById('document-viewer');
+
+ documentUpload.addEventListener('change', (event) => {
+ const file = event.target.files[0];
+ if (file) {
+ const fileURL = URL.createObjectURL(file);
+ documentViewer.src = fileURL;
+ documentViewer.classList.remove('hidden');
+ }
+ });
+
+ // Voice functionality
+ const startVoiceBtn = document.getElementById('start-voice');
+ const stopVoiceBtn = document.getElementById('stop-voice');
+ let recognition;
+
+ if ('webkitSpeechRecognition' in window) {
+ recognition = new webkitSpeechRecognition();
+ recognition.continuous = true;
+ recognition.interimResults = true;
+ recognition.lang = 'zh-CN';
+
+ recognition.onstart = () => {
+ startVoiceBtn.classList.add('hidden');
+ stopVoiceBtn.classList.remove('hidden');
+ };
+
+ recognition.onend = () => {
+ startVoiceBtn.classList.remove('hidden');
+ stopVoiceBtn.classList.add('hidden');
+ };
+
+ recognition.onresult = (event) => {
+ // Handle voice commands here
+ console.log(event.results);
+ };
+
+ startVoiceBtn.addEventListener('click', () => {
+ recognition.start();
+ });
+
+ stopVoiceBtn.addEventListener('click', () => {
+ recognition.stop();
+ });
+ } else {
+ startVoiceBtn.disabled = true;
+ startVoiceBtn.textContent = '语音识别不可用';
+ }
style.css
Changed around line 1
+ :root {
+ --primary-color: #4CAF50;
+ --secondary-color: #45a049;
+ --background-color: #f5f5f5;
+ --text-color: #333;
+ --white: #fff;
+ }
+
+ body {
+ font-family: 'Segoe UI', sans-serif;
+ margin: 0;
+ padding: 0;
+ background-color: var(--background-color);
+ color: var(--text-color);
+ line-height: 1.6;
+ }
+
+ header {
+ background-color: var(--primary-color);
+ color: var(--white);
+ padding: 2rem;
+ text-align: center;
+ }
+
+ h1 {
+ margin: 0;
+ font-size: 2.5rem;
+ }
+
+ main {
+ max-width: 1200px;
+ margin: 2rem auto;
+ padding: 0 1rem;
+ }
+
+ section {
+ margin-bottom: 2rem;
+ background-color: var(--white);
+ padding: 1.5rem;
+ border-radius: 8px;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ }
+
+ .camera-container {
+ position: relative;
+ width: 100%;
+ max-width: 640px;
+ margin: 0 auto;
+ }
+
+ #camera-feed {
+ width: 100%;
+ height: auto;
+ border-radius: 8px;
+ display: none;
+ }
+
+ button {
+ background-color: var(--primary-color);
+ color: var(--white);
+ border: none;
+ padding: 0.8rem 1.5rem;
+ border-radius: 4px;
+ cursor: pointer;
+ font-size: 1rem;
+ transition: background-color 0.3s ease;
+ }
+
+ button:hover {
+ background-color: var(--secondary-color);
+ }
+
+ .document-upload {
+ text-align: center;
+ margin: 1rem 0;
+ }
+
+ .upload-button {
+ display: inline-block;
+ padding: 0.8rem 1.5rem;
+ cursor: pointer;
+ }
+
+ #document-viewer {
+ width: 100%;
+ height: 500px;
+ border: 1px solid #ddd;
+ border-radius: 8px;
+ margin-top: 1rem;
+ }
+
+ .voice-controls {
+ text-align: center;
+ }
+
+ .hidden {
+ display: none;
+ }
+
+ footer {
+ text-align: center;
+ padding: 1rem;
+ background-color: var(--primary-color);
+ color: var(--white);
+ margin-top: 2rem;
+ }
+
+ @media (max-width: 768px) {
+ h1 {
+ font-size: 2rem;
+ }
+
+ #document-viewer {
+ height: 300px;
+ }
+ }