commit 862a577f6ec877a6ae5b257cd3d6f65cbe32d90e
Author: root <root@hub.scroll.pub> Date: 2024-12-29 06:01:04 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..625514c --- /dev/null +++ b/body.html @@ -0,0 +1,72 @@ +<header> + <nav> + <div class="logo">统计</div> + <div class="nav-links"> + <a href="#home">首页</a> + <a href="#analysis">分析</a> + <a href="#charts">图表</a> + <a href="#tools">工具</a> + </div> + </nav> +</header> + +<main> + <section id="home" class="hero"> + <h1>数据统计分析</h1> + <p>专业的数据可视化与统计分析工具</p> + </section> + + <section id="analysis" class="data-section"> + <h2>数据分析</h2> + <div class="stats-container"> + <div class="stat-card"> + <div class="stat-value" id="stat1">0</div> + <div class="stat-label">样本数量</div> + </div> + <div class="stat-card"> + <div class="stat-value" id="stat2">0</div> + <div class="stat-label">平均值</div> + </div> + <div class="stat-card"> + <div class="stat-value" id="stat3">0</div> + <div class="stat-label">标准差</div> + </div> + </div> + </section> + + <section id="charts" class="chart-section"> + <h2>数据图表</h2> + <div class="chart-container"> + <canvas id="dataChart"></canvas> + </div> + </section> + + <section id="tools" class="tools-section"> + <h2>统计工具</h2> + <div class="tools-grid"> + <div class="tool-card"> + <h3>数据导入</h3> + <input type="file" id="dataInput" accept=".csv,.xlsx"> + </div> + <div class="tool-card"> + <h3>数据分析</h3> + <button id="analyzeBtn">开始分析</button> + </div> + </div> + </section> +</main> + +<footer> + <div class="footer-content"> + <div class="footer-section"> + <h4>联系我们</h4> + <p>邮箱: contact@tongji.scroll.pub</p> + </div> + <div class="footer-section"> + <h4>导航</h4> + <a href="#home">首页</a> + <a href="#analysis">分析</a> + <a href="#charts">图表</a> + </div> + </div> +</footer> diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..ad41943 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://tongji.scroll.pub +metaTags +editButton /edit.html +title 统计 | Data Analysis & Statistics +style.css +body.html +script.js diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..cb96fdc --- /dev/null +++ b/prompt.json @@ -0,0 +1,20 @@ +{ + "id": "msg_01E6GRuk4daorfxpN4cV7nWb", + "type": "message", + "role": "assistant", + "model": "claude-3-5-sonnet-20241022", + "content": [ + { + "type": "text", + "text": "I'll create a statistics-focused website with data visualization and analysis tools.\n\n---domain---\ntongji.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://tongji.scroll.pub\nmetaTags\neditButton /edit.html\ntitle 统计 | Data Analysis & Statistics\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n<header>\n <nav>\n <div class=\"logo\">统计</div>\n <div class=\"nav-links\">\n <a href=\"#home\">首页</a>\n <a href=\"#analysis\">分析</a>\n <a href=\"#charts\">图表</a>\n <a href=\"#tools\">工具</a>\n </div>\n </nav>\n</header>\n\n<main>\n <section id=\"home\" class=\"hero\">\n <h1>数据统计分析</h1>\n <p>专业的数据可视化与统计分析工具</p>\n </section>\n\n <section id=\"analysis\" class=\"data-section\">\n <h2>数据分析</h2>\n <div class=\"stats-container\">\n <div class=\"stat-card\">\n <div class=\"stat-value\" id=\"stat1\">0</div>\n <div class=\"stat-label\">样本数量</div>\n </div>\n <div class=\"stat-card\">\n <div class=\"stat-value\" id=\"stat2\">0</div>\n <div class=\"stat-label\">平均值</div>\n </div>\n <div class=\"stat-card\">\n <div class=\"stat-value\" id=\"stat3\">0</div>\n <div class=\"stat-label\">标准差</div>\n </div>\n </div>\n </section>\n\n <section id=\"charts\" class=\"chart-section\">\n <h2>数据图表</h2>\n <div class=\"chart-container\">\n <canvas id=\"dataChart\"></canvas>\n </div>\n </section>\n\n <section id=\"tools\" class=\"tools-section\">\n <h2>统计工具</h2>\n <div class=\"tools-grid\">\n <div class=\"tool-card\">\n <h3>数据导入</h3>\n <input type=\"file\" id=\"dataInput\" accept=\".csv,.xlsx\">\n </div>\n <div class=\"tool-card\">\n <h3>数据分析</h3>\n <button id=\"analyzeBtn\">开始分析</button>\n </div>\n </div>\n </section>\n</main>\n\n<footer>\n <div class=\"footer-content\">\n <div class=\"footer-section\">\n <h4>联系我们</h4>\n <p>邮箱: contact@tongji.scroll.pub</p>\n </div>\n <div class=\"footer-section\">\n <h4>导航</h4>\n <a href=\"#home\">首页</a>\n <a href=\"#analysis\">分析</a>\n <a href=\"#charts\">图表</a>\n </div>\n </div>\n</footer>\n\n---style.css---\n:root {\n --primary-color: #2c3e50;\n --accent-color: #3498db;\n --bg-color: #f8f9fa;\n --text-color: #2c3e50;\n --card-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: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n line-height: 1.6;\n color: var(--text-color);\n background: var(--bg-color);\n}\n\nheader {\n background: var(--primary-color);\n padding: 1rem;\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 display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.logo {\n color: white;\n font-size: 1.5rem;\n font-weight: bold;\n}\n\n.nav-links a {\n color: white;\n text-decoration: none;\n margin-left: 2rem;\n transition: color 0.3s ease;\n}\n\n.nav-links a:hover {\n color: var(--accent-color);\n}\n\nmain {\n margin-top: 4rem;\n}\n\n.hero {\n height: 80vh;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n background: linear-gradient(135deg, var(--primary-color), var(--accent-color));\n color: white;\n}\n\n.hero h1 {\n font-size: 3rem;\n margin-bottom: 1rem;\n}\n\nsection {\n padding: 4rem 2rem;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.stats-container {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 2rem;\n margin-top: 2rem;\n}\n\n.stat-card {\n background: white;\n padding: 2rem;\n border-radius: 10px;\n box-shadow: var(--card-shadow);\n text-align: center;\n transition: transform 0.3s ease;\n}\n\n.stat-card:hover {\n transform: translateY(-5px);\n}\n\n.stat-value {\n font-size: 2.5rem;\n font-weight: bold;\n color: var(--accent-color);\n}\n\n.chart-container {\n background: white;\n padding: 2rem;\n border-radius: 10px;\n box-shadow: var(--card-shadow);\n margin-top: 2rem;\n}\n\n.tools-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 2rem;\n margin-top: 2rem;\n}\n\n.tool-card {\n background: white;\n padding: 2rem;\n border-radius: 10px;\n box-shadow: var(--card-shadow);\n}\n\nbutton {\n background: var(--accent-color);\n color: white;\n border: none;\n padding: 0.8rem 1.5rem;\n border-radius: 5px;\n cursor: pointer;\n transition: background 0.3s ease;\n}\n\nbutton:hover {\n background: #2980b9;\n}\n\nfooter {\n background: var(--primary-color);\n color: white;\n padding: 2rem;\n margin-top: 4rem;\n}\n\n.footer-content {\n max-width: 1200px;\n margin: 0 auto;\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n gap: 2rem;\n}\n\n.footer-section a {\n color: white;\n text-decoration: none;\n display: block;\n margin-top: 0.5rem;\n}\n\n@media (max-width: 768px) {\n .nav-links {\n display: none;\n }\n \n .hero h1 {\n font-size: 2rem;\n }\n \n section {\n padding: 2rem 1rem;\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', () => {\n // Animate statistics\n const animateStats = () => {\n const stats = [\n { id: 'stat1', target: 1234 },\n { id: 'stat2', target: 85.7 },\n { id: 'stat3', target: 12.3 }\n ];\n\n stats.forEach(stat => {\n let current = 0;\n const element = document.getElementById(stat.id);\n const increment = stat.target / 100;\n \n const timer = setInterval(() => {\n current += increment;\n if (current >= stat.target) {\n current = stat.target;\n clearInterval(timer);\n }\n element.textContent = Math.round(current * 10) / 10;\n }, 20);\n });\n };\n\n // Initialize chart\n const initChart = () => {\n const ctx = document.getElementById('dataChart').getContext('2d');\n \n // Simple line drawing using canvas\n const drawLine = (ctx, startX, startY, endX, endY, color) => {\n ctx.beginPath();\n ctx.moveTo(startX, startY);\n ctx.lineTo(endX, endY);\n ctx.strokeStyle = color;\n ctx.stroke();\n };\n\n // Create sample data visualization\n const width = ctx.canvas.width;\n const height = ctx.canvas.height;\n \n ctx.clearRect(0, 0, width, height);\n \n // Draw axes\n drawLine(ctx, 50, height - 50, width - 50, height - 50, '#2c3e50'); // X-axis\n drawLine(ctx, 50, 50, 50, height - 50, '#2c3e50'); // Y-axis\n \n // Draw sample data curve\n ctx.beginPath();\n ctx.moveTo(50, height - 50);\n \n for (let x = 0; x < width - 100; x++) {\n const y = Math.sin(x * 0.02) * 50 + height/2;\n ctx.lineTo(x + 50, y);\n }\n \n ctx.strokeStyle = '#3498db';\n ctx.stroke();\n };\n\n // Handle file input\n document.getElementById('dataInput').addEventListener('change', (event) => {\n const file = event.target.files[0];\n if (file) {\n // Add file processing logic here\n console.log('File selected:', file.name);\n }\n });\n\n // Handle analyze button\n document.getElementById('analyzeBtn').addEventListener('click', () => {\n animateStats();\n });\n\n // Initialize\n initChart();\n \n // Smooth scroll for navigation\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\n---end---" + } + ], + "stop_reason": "end_turn", + "stop_sequence": null, + "usage": { + "input_tokens": 272, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "output_tokens": 2787 + } +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..1d328b4 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# tongji.scroll.pub +Website generated by Claude from prompt: 统计 \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..4dc54b0 --- /dev/null +++ b/script.js @@ -0,0 +1,88 @@ +document.addEventListener('DOMContentLoaded', () => { + // Animate statistics + const animateStats = () => { + const stats = [ + { id: 'stat1', target: 1234 }, + { id: 'stat2', target: 85.7 }, + { id: 'stat3', target: 12.3 } + ]; + + stats.forEach(stat => { + let current = 0; + const element = document.getElementById(stat.id); + const increment = stat.target / 100; + + const timer = setInterval(() => { + current += increment; + if (current >= stat.target) { + current = stat.target; + clearInterval(timer); + } + element.textContent = Math.round(current * 10) / 10; + }, 20); + }); + }; + + // Initialize chart + const initChart = () => { + const ctx = document.getElementById('dataChart').getContext('2d'); + + // Simple line drawing using canvas + const drawLine = (ctx, startX, startY, endX, endY, color) => { + ctx.beginPath(); + ctx.moveTo(startX, startY); + ctx.lineTo(endX, endY); + ctx.strokeStyle = color; + ctx.stroke(); + }; + + // Create sample data visualization + const width = ctx.canvas.width; + const height = ctx.canvas.height; + + ctx.clearRect(0, 0, width, height); + + // Draw axes + drawLine(ctx, 50, height - 50, width - 50, height - 50, '#2c3e50'); // X-axis + drawLine(ctx, 50, 50, 50, height - 50, '#2c3e50'); // Y-axis + + // Draw sample data curve + ctx.beginPath(); + ctx.moveTo(50, height - 50); + + for (let x = 0; x < width - 100; x++) { + const y = Math.sin(x * 0.02) * 50 + height/2; + ctx.lineTo(x + 50, y); + } + + ctx.strokeStyle = '#3498db'; + ctx.stroke(); + }; + + // Handle file input + document.getElementById('dataInput').addEventListener('change', (event) => { + const file = event.target.files[0]; + if (file) { + // Add file processing logic here + console.log('File selected:', file.name); + } + }); + + // Handle analyze button + document.getElementById('analyzeBtn').addEventListener('click', () => { + animateStats(); + }); + + // Initialize + initChart(); + + // Smooth scroll for navigation + document.querySelectorAll('a[href^="#"]').forEach(anchor => { + anchor.addEventListener('click', function (e) { + e.preventDefault(); + document.querySelector(this.getAttribute('href')).scrollIntoView({ + behavior: 'smooth' + }); + }); + }); +}); diff --git a/style.css b/style.css new file mode 100644 index 0000000..744e397 --- /dev/null +++ b/style.css @@ -0,0 +1,178 @@ +:root { + --primary-color: #2c3e50; + --accent-color: #3498db; + --bg-color: #f8f9fa; + --text-color: #2c3e50; + --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +* { + 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: var(--bg-color); +} + +header { + background: var(--primary-color); + padding: 1rem; + position: fixed; + width: 100%; + top: 0; + z-index: 1000; +} + +nav { + max-width: 1200px; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; +} + +.logo { + color: white; + font-size: 1.5rem; + font-weight: bold; +} + +.nav-links a { + color: white; + text-decoration: none; + margin-left: 2rem; + transition: color 0.3s ease; +} + +.nav-links a:hover { + color: var(--accent-color); +} + +main { + margin-top: 4rem; +} + +.hero { + height: 80vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); + color: white; +} + +.hero h1 { + font-size: 3rem; + margin-bottom: 1rem; +} + +section { + padding: 4rem 2rem; + max-width: 1200px; + margin: 0 auto; +} + +.stats-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 2rem; + margin-top: 2rem; +} + +.stat-card { + background: white; + padding: 2rem; + border-radius: 10px; + box-shadow: var(--card-shadow); + text-align: center; + transition: transform 0.3s ease; +} + +.stat-card:hover { + transform: translateY(-5px); +} + +.stat-value { + font-size: 2.5rem; + font-weight: bold; + color: var(--accent-color); +} + +.chart-container { + background: white; + padding: 2rem; + border-radius: 10px; + box-shadow: var(--card-shadow); + margin-top: 2rem; +} + +.tools-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 2rem; + margin-top: 2rem; +} + +.tool-card { + background: white; + padding: 2rem; + border-radius: 10px; + box-shadow: var(--card-shadow); +} + +button { + background: var(--accent-color); + color: white; + border: none; + padding: 0.8rem 1.5rem; + border-radius: 5px; + cursor: pointer; + transition: background 0.3s ease; +} + +button:hover { + background: #2980b9; +} + +footer { + background: var(--primary-color); + color: white; + padding: 2rem; + margin-top: 4rem; +} + +.footer-content { + max-width: 1200px; + margin: 0 auto; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 2rem; +} + +.footer-section a { + color: white; + text-decoration: none; + display: block; + margin-top: 0.5rem; +} + +@media (max-width: 768px) { + .nav-links { + display: none; + } + + .hero h1 { + font-size: 2rem; + } + + section { + padding: 2rem 1rem; + } +}