Changes to subtrans.scroll.pub

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

Video Subtitle Translator

+

Professional English to Chinese subtitle translation

+
+
+
+
+
+
+
+
+
+ Translate
+
+
+
+
+
+
+
+
+
+
+
+

Features

+
+
+
+

Fast Translation

+

Quick and efficient subtitle translation

+
+
+ 📝
+

Accurate Results

+

Context-aware translations

+
+
+ 🔄
+

Easy to Use

+

Simple paste and translate workflow

+
+
+
+
+
+
+

SubTrans - Professional Video Subtitle Translation

+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://subtrans.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Video Subtitle Translator | English to Chinese
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "msg_01BsANN2M6BvtBmD8YrVWA3r",
+ "type": "message",
+ "role": "assistant",
+ "model": "claude-3-5-sonnet-20241022",
+ "content": [
+ {
+ "type": "text",
+ "text": "I'll create a video subtitle translation website (English to Chinese). Here's a complete implementation:\n\n---domain---\nsubtrans.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://subtrans.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Video Subtitle Translator | English to Chinese\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n
\n \n
\n\n
\n
\n

Video Subtitle Translator

\n

Professional English to Chinese subtitle translation

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

Features

\n
\n
\n \n

Fast Translation

\n

Quick and efficient subtitle translation

\n
\n
\n 📝\n

Accurate Results

\n

Context-aware translations

\n
\n
\n 🔄\n

Easy to Use

\n

Simple paste and translate workflow

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

SubTrans - Professional Video Subtitle Translation

\n
\n\n---style.css---\n:root {\n --primary-color: #4a90e2;\n --secondary-color: #2c3e50;\n --accent-color: #e74c3c;\n --background-color: #f5f6fa;\n --text-color: #2c3e50;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n line-height: 1.6;\n color: var(--text-color);\n background-color: var(--background-color);\n}\n\nheader {\n background: white;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n position: fixed;\n width: 100%;\n top: 0;\n z-index: 1000;\n}\n\nnav {\n max-width: 1200px;\n margin: 0 auto;\n padding: 1rem 2rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.logo {\n font-size: 1.5rem;\n font-weight: bold;\n color: var(--primary-color);\n}\n\n.nav-links a {\n margin-left: 2rem;\n text-decoration: none;\n color: var(--text-color);\n transition: color 0.3s;\n}\n\n.nav-links a:hover {\n color: var(--primary-color);\n}\n\nmain {\n margin-top: 4rem;\n padding: 2rem;\n}\n\n.hero {\n text-align: center;\n padding: 4rem 0;\n background: linear-gradient(135deg, var(--primary-color), #74b9ff);\n color: white;\n border-radius: 1rem;\n margin-bottom: 3rem;\n}\n\n.hero h1 {\n font-size: 2.5rem;\n margin-bottom: 1rem;\n}\n\n.translator {\n max-width: 1000px;\n margin: 0 auto;\n display: grid;\n gap: 2rem;\n padding: 2rem;\n background: white;\n border-radius: 1rem;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n}\n\ntextarea {\n width: 100%;\n padding: 1rem;\n border: 2px solid #e1e1e1;\n border-radius: 0.5rem;\n font-size: 1rem;\n transition: border-color 0.3s;\n}\n\ntextarea:focus {\n outline: none;\n border-color: var(--primary-color);\n}\n\nlabel {\n display: block;\n margin-bottom: 0.5rem;\n font-weight: bold;\n}\n\n.translate-button {\n padding: 1rem 2rem;\n background: var(--primary-color);\n color: white;\n border: none;\n border-radius: 0.5rem;\n cursor: pointer;\n font-size: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n transition: transform 0.3s, background-color 0.3s;\n}\n\n.translate-button:hover {\n transform: translateY(-2px);\n background-color: #357abd;\n}\n\n.copy-button {\n margin-top: 1rem;\n padding: 0.5rem 1rem;\n background: var(--secondary-color);\n color: white;\n border: none;\n border-radius: 0.5rem;\n cursor: pointer;\n transition: background-color 0.3s;\n}\n\n.copy-button:hover {\n background-color: #1a252f;\n}\n\n.features {\n padding: 4rem 0;\n}\n\n.features h2 {\n text-align: center;\n margin-bottom: 3rem;\n}\n\n.features-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 2rem;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.feature-card {\n background: white;\n padding: 2rem;\n border-radius: 1rem;\n text-align: center;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n transition: transform 0.3s;\n}\n\n.feature-card:hover {\n transform: translateY(-5px);\n}\n\n.icon {\n font-size: 2rem;\n margin-bottom: 1rem;\n}\n\nfooter {\n text-align: center;\n padding: 2rem;\n background: var(--secondary-color);\n color: white;\n margin-top: 4rem;\n}\n\n@media (max-width: 768px) {\n nav {\n flex-direction: column;\n gap: 1rem;\n }\n \n .nav-links a {\n margin: 0 1rem;\n }\n \n .hero {\n padding: 2rem 1rem;\n }\n \n .hero h1 {\n font-size: 2rem;\n }\n \n .translator {\n padding: 1rem;\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', () => {\n const sourceText = document.getElementById('source-text');\n const translatedText = document.getElementById('translated-text');\n const translateBtn = document.getElementById('translate-btn');\n const copyBtn = document.getElementById('copy-btn');\n\n // Smooth scroll for navigation links\n document.querySelectorAll('a[href^=\"#\"]').forEach(anchor => {\n anchor.addEventListener('click', function (e) {\n e.preventDefault();\n document.querySelector(this.getAttribute('href')).scrollIntoView({\n behavior: 'smooth'\n });\n });\n });\n\n // Translation button animation\n translateBtn.addEventListener('click', async () => {\n if (!sourceText.value.trim()) {\n alert('Please enter some text to translate');\n return;\n }\n\n translateBtn.disabled = true;\n translateBtn.innerHTML = 'Translating...';\n\n try {\n // Simulate translation API call with timeout\n await new Promise(resolve => setTimeout(resolve, 1000));\n \n // This is where you would normally make an API call to a translation service\n // For demo purposes, we'll just append \"翻译\" to each line\n const translation = sourceText.value.split('\\n')\n .map(line => line.trim() ? `${line} 翻译` : '')\n .join('\\n');\n \n translatedText.value = translation;\n } catch (error) {\n alert('Translation failed. Please try again.');\n } finally {\n translateBtn.disabled = false;\n translateBtn.innerHTML = 'Translate';\n }\n });\n\n // Copy button functionality\n copyBtn.addEventListener('click', () => {\n if (!translatedText.value) {\n alert('No translation to copy');\n return;\n }\n\n translatedText.select();\n document.execCommand('copy');\n \n const originalText = copyBtn.textContent;\n copyBtn.textContent = 'Copied!';\n setTimeout(() => {\n copyBtn.textContent = originalText;\n }, 2000);\n });\n\n // Auto-resize textareas\n const autoResize = (element) => {\n element.style.height = 'auto';\n element.style.height = element.scrollHeight + 'px';\n };\n\n sourceText.addEventListener('input', () => autoResize(sourceText));\n translatedText.addEventListener('input', () => autoResize(translatedText));\n});\n\n---end---\n\nThis implementation creates a beautiful, responsive subtitle translation website with smooth animations and a professional design. Key features include:\n\n1. Clean, semantic HTML5 structure\n2. Modern, responsive design with CSS Grid and Flexbox\n3. Smooth scrolling navigation\n4. Interactive translation interface\n5. Copy-to-clipboard functionality\n6. Beautiful animations and transitions\n7. Mobile-responsive layout\n8. Accessible form controls\n9. Clear visual hierarchy\n10. Professional color scheme\n\nThe website simulates translation functionality (you would need to integrate with a real translation API for actual use). It includes features like auto-resizing textareas, loading states, and success/error handling."
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 294,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 2884
+ }
+ }
readme.scroll
Changed around line 1
+ # subtrans.scroll.pub
+ Website generated by Claude from prompt: 帮我创建视频字幕翻译网站,英文翻译为中文
script.js
Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const sourceText = document.getElementById('source-text');
+ const translatedText = document.getElementById('translated-text');
+ const translateBtn = document.getElementById('translate-btn');
+ const copyBtn = document.getElementById('copy-btn');
+
+ // Smooth scroll for navigation links
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
+ behavior: 'smooth'
+ });
+ });
+ });
+
+ // Translation button animation
+ translateBtn.addEventListener('click', async () => {
+ if (!sourceText.value.trim()) {
+ alert('Please enter some text to translate');
+ return;
+ }
+
+ translateBtn.disabled = true;
+ translateBtn.innerHTML = 'Translating...';
+
+ try {
+ // Simulate translation API call with timeout
+ await new Promise(resolve => setTimeout(resolve, 1000));
+
+ // This is where you would normally make an API call to a translation service
+ // For demo purposes, we'll just append "翻译" to each line
+ const translation = sourceText.value.split('\n')
+ .map(line => line.trim() ? `${line} 翻译` : '')
+ .join('\n');
+
+ translatedText.value = translation;
+ } catch (error) {
+ alert('Translation failed. Please try again.');
+ } finally {
+ translateBtn.disabled = false;
+ translateBtn.innerHTML = 'Translate';
+ }
+ });
+
+ // Copy button functionality
+ copyBtn.addEventListener('click', () => {
+ if (!translatedText.value) {
+ alert('No translation to copy');
+ return;
+ }
+
+ translatedText.select();
+ document.execCommand('copy');
+
+ const originalText = copyBtn.textContent;
+ copyBtn.textContent = 'Copied!';
+ setTimeout(() => {
+ copyBtn.textContent = originalText;
+ }, 2000);
+ });
+
+ // Auto-resize textareas
+ const autoResize = (element) => {
+ element.style.height = 'auto';
+ element.style.height = element.scrollHeight + 'px';
+ };
+
+ sourceText.addEventListener('input', () => autoResize(sourceText));
+ translatedText.addEventListener('input', () => autoResize(translatedText));
+ });
style.css
Changed around line 1
+ :root {
+ --primary-color: #4a90e2;
+ --secondary-color: #2c3e50;
+ --accent-color: #e74c3c;
+ --background-color: #f5f6fa;
+ --text-color: #2c3e50;
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
+ line-height: 1.6;
+ color: var(--text-color);
+ background-color: var(--background-color);
+ }
+
+ header {
+ background: white;
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
+ position: fixed;
+ width: 100%;
+ top: 0;
+ z-index: 1000;
+ }
+
+ nav {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: 1rem 2rem;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .logo {
+ font-size: 1.5rem;
+ font-weight: bold;
+ color: var(--primary-color);
+ }
+
+ .nav-links a {
+ margin-left: 2rem;
+ text-decoration: none;
+ color: var(--text-color);
+ transition: color 0.3s;
+ }
+
+ .nav-links a:hover {
+ color: var(--primary-color);
+ }
+
+ main {
+ margin-top: 4rem;
+ padding: 2rem;
+ }
+
+ .hero {
+ text-align: center;
+ padding: 4rem 0;
+ background: linear-gradient(135deg, var(--primary-color), #74b9ff);
+ color: white;
+ border-radius: 1rem;
+ margin-bottom: 3rem;
+ }
+
+ .hero h1 {
+ font-size: 2.5rem;
+ margin-bottom: 1rem;
+ }
+
+ .translator {
+ max-width: 1000px;
+ margin: 0 auto;
+ display: grid;
+ gap: 2rem;
+ padding: 2rem;
+ background: white;
+ border-radius: 1rem;
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
+ }
+
+ textarea {
+ width: 100%;
+ padding: 1rem;
+ border: 2px solid #e1e1e1;
+ border-radius: 0.5rem;
+ font-size: 1rem;
+ transition: border-color 0.3s;
+ }
+
+ textarea:focus {
+ outline: none;
+ border-color: var(--primary-color);
+ }
+
+ label {
+ display: block;
+ margin-bottom: 0.5rem;
+ font-weight: bold;
+ }
+
+ .translate-button {
+ padding: 1rem 2rem;
+ background: var(--primary-color);
+ color: white;
+ border: none;
+ border-radius: 0.5rem;
+ cursor: pointer;
+ font-size: 1rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+ transition: transform 0.3s, background-color 0.3s;
+ }
+
+ .translate-button:hover {
+ transform: translateY(-2px);
+ background-color: #357abd;
+ }
+
+ .copy-button {
+ margin-top: 1rem;
+ padding: 0.5rem 1rem;
+ background: var(--secondary-color);
+ color: white;
+ border: none;
+ border-radius: 0.5rem;
+ cursor: pointer;
+ transition: background-color 0.3s;
+ }
+
+ .copy-button:hover {
+ background-color: #1a252f;
+ }
+
+ .features {
+ padding: 4rem 0;
+ }
+
+ .features h2 {
+ text-align: center;
+ margin-bottom: 3rem;
+ }
+
+ .features-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
+ gap: 2rem;
+ max-width: 1200px;
+ margin: 0 auto;
+ }
+
+ .feature-card {
+ background: white;
+ padding: 2rem;
+ border-radius: 1rem;
+ text-align: center;
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
+ transition: transform 0.3s;
+ }
+
+ .feature-card:hover {
+ transform: translateY(-5px);
+ }
+
+ .icon {
+ font-size: 2rem;
+ margin-bottom: 1rem;
+ }
+
+ footer {
+ text-align: center;
+ padding: 2rem;
+ background: var(--secondary-color);
+ color: white;
+ margin-top: 4rem;
+ }
+
+ @media (max-width: 768px) {
+ nav {
+ flex-direction: column;
+ gap: 1rem;
+ }
+
+ .nav-links a {
+ margin: 0 1rem;
+ }
+
+ .hero {
+ padding: 2rem 1rem;
+ }
+
+ .hero h1 {
+ font-size: 2rem;
+ }
+
+ .translator {
+ padding: 1rem;
+ }
+ }