Changes to curveviz.scroll.pub

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

CurveViz

+

Upload your .txt file and visualize it as a beautiful curve.

+
+
+
+
+
+
+
+
+
+
+
+

Transform your data into insights.

+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://curveviz.scroll.pub
+ metaTags
+ editButton /edit.html
+ title CurveViz - Visualize Your Data
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "4bfb94d3-5236-4e2f-ba6e-b3dec39e3968",
+ "object": "chat.completion",
+ "created": 1735980277,
+ "model": "deepseek-chat",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "---domain---\ncurveviz.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://curveviz.scroll.pub\nmetaTags\neditButton /edit.html\ntitle CurveViz - Visualize Your Data\nstyle.css\nbody.html\nscript.js\n---body.html---\n
\n

CurveViz

\n

Upload your .txt file and visualize it as a beautiful curve.

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

Transform your data into insights.

\n
\n---style.css---\n:root {\n --primary-color: #4a90e2;\n --secondary-color: #50e3c2;\n --background-color: #1a1a1a;\n --text-color: #ffffff;\n --font-family: 'Segoe UI', system-ui, sans-serif;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n background-color: var(--background-color);\n color: var(--text-color);\n font-family: var(--font-family);\n line-height: 1.6;\n padding: 20px;\n}\n\nheader {\n text-align: center;\n margin-bottom: 40px;\n}\n\nh1 {\n font-size: 2.5rem;\n color: var(--primary-color);\n margin-bottom: 10px;\n}\n\n#upload-section {\n text-align: center;\n margin-bottom: 40px;\n}\n\n.upload-button {\n display: inline-block;\n padding: 10px 20px;\n background-color: var(--primary-color);\n color: var(--text-color);\n border-radius: 5px;\n cursor: pointer;\n transition: background-color 0.3s ease;\n}\n\n.upload-button:hover {\n background-color: var(--secondary-color);\n}\n\n#file-input {\n display: none;\n}\n\n#chart-section {\n width: 100%;\n max-width: 800px;\n margin: 0 auto;\n}\n\ncanvas {\n width: 100%;\n height: 400px;\n background-color: #2a2a2a;\n border-radius: 10px;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n}\n\nfooter {\n text-align: center;\n margin-top: 40px;\n font-size: 0.9rem;\n color: #666;\n}\n\n@media (max-width: 768px) {\n h1 {\n font-size: 2rem;\n }\n\n canvas {\n height: 300px;\n }\n}\n---script.js---\ndocument.getElementById('file-input').addEventListener('change', function(event) {\n const file = event.target.files[0];\n if (file && file.type === 'text/plain') {\n const reader = new FileReader();\n reader.onload = function(e) {\n const text = e.target.result;\n const data = text.split('\\n').map(Number);\n drawChart(data);\n };\n reader.readAsText(file);\n } else {\n alert('Please upload a valid .txt file.');\n }\n});\n\nfunction drawChart(data) {\n const canvas = document.getElementById('data-chart');\n const ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n const padding = 20;\n const width = canvas.width - padding * 2;\n const height = canvas.height - padding * 2;\n const maxValue = Math.max(...data);\n const minValue = Math.min(...data);\n const xStep = width / (data.length - 1);\n const yScale = height / (maxValue - minValue);\n\n ctx.beginPath();\n ctx.moveTo(padding, height + padding - (data[0] - minValue) * yScale);\n ctx.strokeStyle = '#50e3c2';\n ctx.lineWidth = 2;\n\n data.forEach((value, index) => {\n const x = padding + index * xStep;\n const y = height + padding - (value - minValue) * yScale;\n ctx.lineTo(x, y);\n });\n\n ctx.stroke();\n}\n---end---"
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 252,
+ "completion_tokens": 990,
+ "total_tokens": 1242,
+ "prompt_cache_hit_tokens": 0,
+ "prompt_cache_miss_tokens": 252
+ },
+ "system_fingerprint": "fp_3a5770e1b4"
+ }
readme.scroll
Changed around line 1
+ # curveviz.scroll.pub
+ Website generated by DeepSeek from prompt: 建立一个可视化大屏展示网站,可以上传txt文本,并将其用曲线的形式展示出来
script.js
Changed around line 1
+ document.getElementById('file-input').addEventListener('change', function(event) {
+ const file = event.target.files[0];
+ if (file && file.type === 'text/plain') {
+ const reader = new FileReader();
+ reader.onload = function(e) {
+ const text = e.target.result;
+ const data = text.split('\n').map(Number);
+ drawChart(data);
+ };
+ reader.readAsText(file);
+ } else {
+ alert('Please upload a valid .txt file.');
+ }
+ });
+
+ function drawChart(data) {
+ const canvas = document.getElementById('data-chart');
+ const ctx = canvas.getContext('2d');
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+ const padding = 20;
+ const width = canvas.width - padding * 2;
+ const height = canvas.height - padding * 2;
+ const maxValue = Math.max(...data);
+ const minValue = Math.min(...data);
+ const xStep = width / (data.length - 1);
+ const yScale = height / (maxValue - minValue);
+
+ ctx.beginPath();
+ ctx.moveTo(padding, height + padding - (data[0] - minValue) * yScale);
+ ctx.strokeStyle = '#50e3c2';
+ ctx.lineWidth = 2;
+
+ data.forEach((value, index) => {
+ const x = padding + index * xStep;
+ const y = height + padding - (value - minValue) * yScale;
+ ctx.lineTo(x, y);
+ });
+
+ ctx.stroke();
+ }
style.css
Changed around line 1
+ :root {
+ --primary-color: #4a90e2;
+ --secondary-color: #50e3c2;
+ --background-color: #1a1a1a;
+ --text-color: #ffffff;
+ --font-family: 'Segoe UI', system-ui, sans-serif;
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ background-color: var(--background-color);
+ color: var(--text-color);
+ font-family: var(--font-family);
+ line-height: 1.6;
+ padding: 20px;
+ }
+
+ header {
+ text-align: center;
+ margin-bottom: 40px;
+ }
+
+ h1 {
+ font-size: 2.5rem;
+ color: var(--primary-color);
+ margin-bottom: 10px;
+ }
+
+ #upload-section {
+ text-align: center;
+ margin-bottom: 40px;
+ }
+
+ .upload-button {
+ display: inline-block;
+ padding: 10px 20px;
+ background-color: var(--primary-color);
+ color: var(--text-color);
+ border-radius: 5px;
+ cursor: pointer;
+ transition: background-color 0.3s ease;
+ }
+
+ .upload-button:hover {
+ background-color: var(--secondary-color);
+ }
+
+ #file-input {
+ display: none;
+ }
+
+ #chart-section {
+ width: 100%;
+ max-width: 800px;
+ margin: 0 auto;
+ }
+
+ canvas {
+ width: 100%;
+ height: 400px;
+ background-color: #2a2a2a;
+ border-radius: 10px;
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+ }
+
+ footer {
+ text-align: center;
+ margin-top: 40px;
+ font-size: 0.9rem;
+ color: #666;
+ }
+
+ @media (max-width: 768px) {
+ h1 {
+ font-size: 2rem;
+ }
+
+ canvas {
+ height: 300px;
+ }
+ }