Changes to dot.scroll.pub

Breck Yunits
Breck Yunits
7 days ago
updated index.scroll
index.scroll
Changed around line 64: main
- span
+ span 0
- 0
- span
+ span 90°
- 90°
root
root
7 days ago
Initial commit
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://dot.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Interactive Dot Product Explorer
+ style.css
+ header
+ class hero
+ h1 Dot Product Explorer
+ p Visualize and calculate dot products interactively
+ main
+ section
+ class calculator
+ div
+ class vector-inputs
+ div
+ class vector-a
+ h2 Vector A
+ div
+ class input-group
+ label X component
+ for vecAx
+ input
+ type number
+ id vecAx
+ value 1
+ div
+ class input-group
+ label Y component
+ for vecAy
+ input
+ type number
+ id vecAy
+ value 0
+ div
+ class vector-b
+ h2 Vector B
+ div
+ class input-group
+ label X component
+ for vecBx
+ input
+ type number
+ id vecBx
+ value 0
+ div
+ class input-group
+ label Y component
+ for vecBy
+ input
+ type number
+ id vecBy
+ value 1
+ section
+ class visualization
+ canvas
+ id dotProductCanvas
+ width 600
+ height 400
+ section
+ class result
+ div
+ class result-display
+ h2 Result
+ p
+ span Dot Product:
+ span
+ id dotProductResult
+ 0
+ p
+ span Angle:
+ span
+ id angleResult
+ 90°
+ footer
+ p Made with ❤️ for mathematics enthusiasts
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "msg_01GZXSv6qVRDAVBuxLdZtpMi",
+ "type": "message",
+ "role": "assistant",
+ "model": "claude-3-5-sonnet-20241022",
+ "content": [
+ {
+ "type": "text",
+ "text": "I'll create an interactive dot product calculator and visualizer. For the domain, I suggest:\n\n---domain---\ndot.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://dot.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Interactive Dot Product Explorer\nstyle.css\nheader\n class hero\n h1 Dot Product Explorer\n p Visualize and calculate dot products interactively\nmain\n section\n class calculator\n div\n class vector-inputs\n div\n class vector-a\n h2 Vector A\n div\n class input-group\n label X component\n for vecAx\n input\n type number\n id vecAx\n value 1\n div\n class input-group\n label Y component\n for vecAy\n input\n type number\n id vecAy\n value 0\n div\n class vector-b\n h2 Vector B\n div\n class input-group\n label X component\n for vecBx\n input\n type number\n id vecBx\n value 0\n div\n class input-group\n label Y component\n for vecBy\n input\n type number\n id vecBy\n value 1\n section\n class visualization\n canvas\n id dotProductCanvas\n width 600\n height 400\n section\n class result\n div\n class result-display\n h2 Result\n p\n span Dot Product:\n span\n id dotProductResult\n 0\n p\n span Angle:\n span\n id angleResult\n 90°\nfooter\n p Made with ❤️ for mathematics enthusiasts\nscript.js\n---style.css---\n:root {\n --primary-color: #2c3e50;\n --secondary-color: #3498db;\n --accent-color: #e74c3c;\n --background-color: #ecf0f1;\n --text-color: #2c3e50;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: 'Segoe UI', system-ui, sans-serif;\n line-height: 1.6;\n background-color: var(--background-color);\n color: var(--text-color);\n}\n\n.hero {\n background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));\n color: white;\n padding: 2rem;\n text-align: center;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n}\n\n.hero h1 {\n font-size: 2.5rem;\n margin-bottom: 1rem;\n}\n\n.calculator {\n max-width: 1200px;\n margin: 2rem auto;\n padding: 2rem;\n background: white;\n border-radius: 10px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\n.vector-inputs {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 2rem;\n}\n\n.input-group {\n margin: 1rem 0;\n}\n\nlabel {\n display: block;\n margin-bottom: 0.5rem;\n color: var(--primary-color);\n font-weight: 500;\n}\n\ninput {\n width: 100%;\n padding: 0.5rem;\n border: 2px solid var(--secondary-color);\n border-radius: 4px;\n font-size: 1rem;\n transition: border-color 0.3s ease;\n}\n\ninput:focus {\n outline: none;\n border-color: var(--accent-color);\n}\n\n.visualization {\n margin: 2rem auto;\n text-align: center;\n}\n\ncanvas {\n max-width: 100%;\n background: white;\n border-radius: 10px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\n.result {\n text-align: center;\n padding: 2rem;\n}\n\n.result-display {\n display: inline-block;\n background: white;\n padding: 1rem 2rem;\n border-radius: 10px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\n.result-display h2 {\n color: var(--primary-color);\n margin-bottom: 1rem;\n}\n\n.result-display p {\n margin: 0.5rem 0;\n font-size: 1.2rem;\n}\n\nfooter {\n text-align: center;\n padding: 2rem;\n background: var(--primary-color);\n color: white;\n}\n\n@media (max-width: 768px) {\n .hero h1 {\n font-size: 2rem;\n }\n \n .calculator {\n padding: 1rem;\n }\n \n canvas {\n width: 100%;\n height: auto;\n }\n}\n---script.js---\ndocument.addEventListener('DOMContentLoaded', function() {\n const canvas = document.getElementById('dotProductCanvas');\n const ctx = canvas.getContext('2d');\n const inputs = ['vecAx', 'vecAy', 'vecBx', 'vecBy'].map(id => document.getElementById(id));\n \n function updateCalculations() {\n const [ax, ay, bx, by] = inputs.map(input => parseFloat(input.value) || 0);\n const dotProduct = ax * bx + ay * by;\n const magnitudeA = Math.sqrt(ax * ax + ay * ay);\n const magnitudeB = Math.sqrt(bx * bx + by * by);\n const angle = Math.acos(dotProduct / (magnitudeA * magnitudeB)) * (180 / Math.PI);\n \n document.getElementById('dotProductResult').textContent = dotProduct.toFixed(2);\n document.getElementById('angleResult').textContent = `${angle.toFixed(1)}°`;\n \n drawVectors(ax, ay, bx, by);\n }\n \n function drawVectors(ax, ay, bx, by) {\n const scale = 50;\n const centerX = canvas.width / 2;\n const centerY = canvas.height / 2;\n \n ctx.clearRect(0, 0, canvas.width, canvas.height);\n \n // Draw grid\n ctx.strokeStyle = '#eee';\n ctx.lineWidth = 1;\n for(let i = 0; i < canvas.width; i += scale) {\n ctx.beginPath();\n ctx.moveTo(i, 0);\n ctx.lineTo(i, canvas.height);\n ctx.stroke();\n }\n for(let i = 0; i < canvas.height; i += scale) {\n ctx.beginPath();\n ctx.moveTo(0, i);\n ctx.lineTo(canvas.width, i);\n ctx.stroke();\n }\n \n // Draw axes\n ctx.strokeStyle = '#666';\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.moveTo(0, centerY);\n ctx.lineTo(canvas.width, centerY);\n ctx.moveTo(centerX, 0);\n ctx.lineTo(centerX, canvas.height);\n ctx.stroke();\n \n // Draw vectors\n ctx.lineWidth = 3;\n \n // Vector A\n ctx.strokeStyle = '#3498db';\n ctx.beginPath();\n ctx.moveTo(centerX, centerY);\n ctx.lineTo(centerX + ax * scale, centerY - ay * scale);\n ctx.stroke();\n \n // Vector B\n ctx.strokeStyle = '#e74c3c';\n ctx.beginPath();\n ctx.moveTo(centerX, centerY);\n ctx.lineTo(centerX + bx * scale, centerY - by * scale);\n ctx.stroke();\n \n // Draw arrowheads\n drawArrowhead(centerX, centerY, ax, ay, scale, '#3498db');\n drawArrowhead(centerX, centerY, bx, by, scale, '#e74c3c');\n }\n \n function drawArrowhead(x, y, dx, dy, scale, color) {\n const angle = Math.atan2(-dy, dx);\n const length = 10;\n \n ctx.strokeStyle = color;\n ctx.fillStyle = color;\n \n ctx.beginPath();\n ctx.moveTo(x + dx * scale, y - dy * scale);\n ctx.lineTo(x + dx * scale - length * Math.cos(angle - Math.PI/6),\n y - dy * scale + length * Math.sin(angle - Math.PI/6));\n ctx.lineTo(x + dx * scale - length * Math.cos(angle + Math.PI/6),\n y - dy * scale + length * Math.sin(angle + Math.PI/6));\n ctx.closePath();\n ctx.fill();\n }\n \n inputs.forEach(input => input.addEventListener('input', updateCalculations));\n updateCalculations();\n});\n---end---\n\nThis creates a beautiful, interactive dot product calculator that:\n1. Allows users to input two 2D vectors\n2. Visualizes the vectors on a canvas with a grid\n3. Calculates and displays the dot product and angle between vectors\n4. Updates in real-time as users modify the inputs\n5. Features a responsive design that works on all devices\n6. Uses smooth animations and professional styling\n7. Includes clear visual feedback and intuitive controls\n\nThe interface is clean and modern, with a beautiful gradient header, floating cards for inputs, and a professional visualization area. The color scheme is carefully chosen for both aesthetics and accessibility."
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 827,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 2517
+ }
+ }
readme.scroll
Changed around line 1
+ # dot.scroll.pub
+
+ Prompt: website
+ Agent: claude
+ Model: claude-3-5-sonnet-20241022
+
+ ## User prompt
+ Build a cool interact tool for experimenting with dot products
+
+ ## System prompt
+ You are an expert web developer. Create a website based on this request: "Build a cool interact tool for experimenting with dot products"
+
+ Requirements:
+ - Use only Scroll, CSS, and JavaScript (NO frameworks, NO external dependencies)
+ - Create clean, semantic HTML5
+ - Make it mobile-responsive
+ - Follow modern best practices and accessibility guidelines
+ - Keep it simple but professional
+ - Use only relative links and no external resources
+ - Do not put a copyright symbol or all rights reserved in the footer.
+ - Make it beautiful. Dazzling. Advanced used of CSS.
+
+ As a refresher, for doing the html body, Scroll is a whitespace based language that uses a single indented space to mark a line (aka particle) as a subparticle of a parent line.
+
+ For example:
+
+ header
+ class hero
+ nav
+ div Scroll
+ class logo
+ div
+ class nav-links
+ a Features
+ href #features
+ a Examples
+ href #examples
+ a Edit
+ href edit.html
+ a GitHub
+ class cta-button
+ href https://github.com/breck7/scroll
+ div
+ class hero-content
+ h1 Write Better with Scroll
+ p The extendible markup language that makes source beautiful and compiles to anything
+ a Get Started
+ class primary-button
+ href https://hub.scroll.pub/
+ main
+ section
+ id features
+ class features
+ h2 Why Scroll?
+ div
+ class feature-grid
+ div
+ class feature-card
+ div ⚡
+ class feature-icon
+ h3 Simple Syntax
+ p Like Markdown, but more powerful. No parentheses needed.
+ div
+ class feature-card
+ div 🧩
+ class feature-icon
+ h3 Extendible
+ p Build your own custom parsers.
+ div
+ class feature-card
+ div 🎨
+ class feature-icon
+ h3 Beautiful Output
+ p Create stunning documents with minimal effort.
+ div
+ class feature-card
+ div 🚀
+ class feature-icon
+ h3 Fast & Light
+ p Built on the efficient PPS Stack.
+ section
+ id examples
+ class code-demo
+ h2 See It In Action
+ div
+ class code-container
+ pre
+ class code-example
+ div
+ class code-output
+ footer
+ div
+ class footer-content
+ div
+ class footer-links
+ a Documentation
+ href https://scroll.pub/tutorial.html
+ a Community
+ href https://www.reddit.com/r/WorldWideScroll/
+ a Blog
+ href https://scroll.pub/blog
+ p Started by Breck Yunits. Evolved by a community.
+ https://twitter.com/breckyunits Breck Yunits
+ https://github.com/breck7/scroll/graphs/contributors community
+
+
+ First suggest a short, memorable domain name ending in scroll.pub that represents this website. Then provide the website files. Use this exact format:
+
+ ---domain---
+ (domainscroll.pub here)
+ ---index.scroll---
+ buildHtml
+ baseUrl https://(domainscroll.pub here)
+ metaTags
+ editButton /edit.html
+ title (Title here)
+ style.css
+
+ (body content here. no blank lines please.)
+
+ script.js
+ ---style.css---
+ (CSS content here)
+ ---script.js---
+ (JavaScript content here)
+ ---end---
script.js
Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const canvas = document.getElementById('dotProductCanvas');
+ const ctx = canvas.getContext('2d');
+ const inputs = ['vecAx', 'vecAy', 'vecBx', 'vecBy'].map(id => document.getElementById(id));
+
+ function updateCalculations() {
+ const [ax, ay, bx, by] = inputs.map(input => parseFloat(input.value) || 0);
+ const dotProduct = ax * bx + ay * by;
+ const magnitudeA = Math.sqrt(ax * ax + ay * ay);
+ const magnitudeB = Math.sqrt(bx * bx + by * by);
+ const angle = Math.acos(dotProduct / (magnitudeA * magnitudeB)) * (180 / Math.PI);
+
+ document.getElementById('dotProductResult').textContent = dotProduct.toFixed(2);
+ document.getElementById('angleResult').textContent = `${angle.toFixed(1)}°`;
+
+ drawVectors(ax, ay, bx, by);
+ }
+
+ function drawVectors(ax, ay, bx, by) {
+ const scale = 50;
+ const centerX = canvas.width / 2;
+ const centerY = canvas.height / 2;
+
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+ // Draw grid
+ ctx.strokeStyle = '#eee';
+ ctx.lineWidth = 1;
+ for(let i = 0; i < canvas.width; i += scale) {
+ ctx.beginPath();
+ ctx.moveTo(i, 0);
+ ctx.lineTo(i, canvas.height);
+ ctx.stroke();
+ }
+ for(let i = 0; i < canvas.height; i += scale) {
+ ctx.beginPath();
+ ctx.moveTo(0, i);
+ ctx.lineTo(canvas.width, i);
+ ctx.stroke();
+ }
+
+ // Draw axes
+ ctx.strokeStyle = '#666';
+ ctx.lineWidth = 2;
+ ctx.beginPath();
+ ctx.moveTo(0, centerY);
+ ctx.lineTo(canvas.width, centerY);
+ ctx.moveTo(centerX, 0);
+ ctx.lineTo(centerX, canvas.height);
+ ctx.stroke();
+
+ // Draw vectors
+ ctx.lineWidth = 3;
+
+ // Vector A
+ ctx.strokeStyle = '#3498db';
+ ctx.beginPath();
+ ctx.moveTo(centerX, centerY);
+ ctx.lineTo(centerX + ax * scale, centerY - ay * scale);
+ ctx.stroke();
+
+ // Vector B
+ ctx.strokeStyle = '#e74c3c';
+ ctx.beginPath();
+ ctx.moveTo(centerX, centerY);
+ ctx.lineTo(centerX + bx * scale, centerY - by * scale);
+ ctx.stroke();
+
+ // Draw arrowheads
+ drawArrowhead(centerX, centerY, ax, ay, scale, '#3498db');
+ drawArrowhead(centerX, centerY, bx, by, scale, '#e74c3c');
+ }
+
+ function drawArrowhead(x, y, dx, dy, scale, color) {
+ const angle = Math.atan2(-dy, dx);
+ const length = 10;
+
+ ctx.strokeStyle = color;
+ ctx.fillStyle = color;
+
+ ctx.beginPath();
+ ctx.moveTo(x + dx * scale, y - dy * scale);
+ ctx.lineTo(x + dx * scale - length * Math.cos(angle - Math.PI/6),
+ y - dy * scale + length * Math.sin(angle - Math.PI/6));
+ ctx.lineTo(x + dx * scale - length * Math.cos(angle + Math.PI/6),
+ y - dy * scale + length * Math.sin(angle + Math.PI/6));
+ ctx.closePath();
+ ctx.fill();
+ }
+
+ inputs.forEach(input => input.addEventListener('input', updateCalculations));
+ updateCalculations();
+ });
style.css
Changed around line 1
+ :root {
+ --primary-color: #2c3e50;
+ --secondary-color: #3498db;
+ --accent-color: #e74c3c;
+ --background-color: #ecf0f1;
+ --text-color: #2c3e50;
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ font-family: 'Segoe UI', system-ui, sans-serif;
+ line-height: 1.6;
+ background-color: var(--background-color);
+ color: var(--text-color);
+ }
+
+ .hero {
+ background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
+ color: white;
+ padding: 2rem;
+ text-align: center;
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
+ }
+
+ .hero h1 {
+ font-size: 2.5rem;
+ margin-bottom: 1rem;
+ }
+
+ .calculator {
+ max-width: 1200px;
+ margin: 2rem auto;
+ padding: 2rem;
+ background: white;
+ border-radius: 10px;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ }
+
+ .vector-inputs {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
+ gap: 2rem;
+ }
+
+ .input-group {
+ margin: 1rem 0;
+ }
+
+ label {
+ display: block;
+ margin-bottom: 0.5rem;
+ color: var(--primary-color);
+ font-weight: 500;
+ }
+
+ input {
+ width: 100%;
+ padding: 0.5rem;
+ border: 2px solid var(--secondary-color);
+ border-radius: 4px;
+ font-size: 1rem;
+ transition: border-color 0.3s ease;
+ }
+
+ input:focus {
+ outline: none;
+ border-color: var(--accent-color);
+ }
+
+ .visualization {
+ margin: 2rem auto;
+ text-align: center;
+ }
+
+ canvas {
+ max-width: 100%;
+ background: white;
+ border-radius: 10px;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ }
+
+ .result {
+ text-align: center;
+ padding: 2rem;
+ }
+
+ .result-display {
+ display: inline-block;
+ background: white;
+ padding: 1rem 2rem;
+ border-radius: 10px;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ }
+
+ .result-display h2 {
+ color: var(--primary-color);
+ margin-bottom: 1rem;
+ }
+
+ .result-display p {
+ margin: 0.5rem 0;
+ font-size: 1.2rem;
+ }
+
+ footer {
+ text-align: center;
+ padding: 2rem;
+ background: var(--primary-color);
+ color: white;
+ }
+
+ @media (max-width: 768px) {
+ .hero h1 {
+ font-size: 2rem;
+ }
+
+ .calculator {
+ padding: 1rem;
+ }
+
+ canvas {
+ width: 100%;
+ height: auto;
+ }
+ }