commit e9e0ca75b60f6d58a12205550835dcc88ad9bdab
Author: root <root@hub.scroll.pub> Date: 2024-12-24 00:32:22 +0000 Subject: Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..8989553 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# particles1.scroll.pub +Website generated from prompt: A website about the Particles syntax. Its like JSON, but no quotes parens or brackets etc. Plain text. Uses a single indent for scope. Sort of like S Expressions without parens. Very ismple. Very powerful. \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..2c5f360 --- /dev/null +++ b/index.html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="description" content="Particles Syntax - A minimalist data format without quotes, parentheses, or brackets"> + <meta name="keywords" content="particles syntax, data format, minimalist syntax, programming"> + <title>Particles Syntax</title> + <link rel="stylesheet" href="style.css"> +</head> +<body> + <header> + <nav> + <ul> + <li><a href="#intro">Introduction</a></li> + <li><a href="#examples">Examples</a></li> + <li><a href="#playground">Playground</a></li> + </ul> + </nav> + </header> + + <main> + <section id="hero"> + <h1>Particles Syntax</h1> + <p class="tagline">Elegant data representation without the noise</p> + <div class="particle-animation" aria-hidden="true"></div> + </section> + + <section id="intro"> + <h2>What is Particles?</h2> + <p>Particles is a human-friendly data format that eliminates unnecessary syntax. No quotes, no brackets, no parentheses—just pure, readable structure through indentation.</p> + </section> + + <section id="examples"> + <h2>Examples</h2> + <div class="code-comparison"> + <div class="code-block"> + <h3>JSON</h3> + <pre>{ + "user": { + "name": "Alice", + "age": 28, + "hobbies": ["coding", "reading"] + } +}</pre> + </div> + <div class="code-block"> + <h3>Particles</h3> + <pre>user + name Alice + age 28 + hobbies + coding + reading</pre> + </div> + </div> + </section> + + <section id="playground"> + <h2>Interactive Playground</h2> + <div class="editor-container"> + <textarea id="particlesEditor" placeholder="Try Particles syntax here..."></textarea> + <div id="preview"></div> + </div> + </section> + </main> + + <footer> + <p>Made with love for the data minimalist</p> + </footer> + + <script src="script.js"></script> +</body> +</html> diff --git a/script.js b/script.js new file mode 100644 index 0000000..bd3ac39 --- /dev/null +++ b/script.js @@ -0,0 +1,79 @@ +document.addEventListener('DOMContentLoaded', () => { + // Particle animation + const particleAnimation = document.querySelector('.particle-animation'); + for (let i = 0; i < 50; i++) { + const particle = document.createElement('div'); + particle.className = 'particle'; + particle.style.cssText = ` + position: absolute; + background: rgba(255, 255, 255, 0.1); + width: ${Math.random() * 10 + 5}px; + height: ${Math.random() * 10 + 5}px; + border-radius: 50%; + left: ${Math.random() * 100}%; + top: ${Math.random() * 100}%; + animation: float ${Math.random() * 10 + 5}s linear infinite; + `; + particleAnimation.appendChild(particle); + } + + // Interactive editor + const editor = document.getElementById('particlesEditor'); + const preview = document.getElementById('preview'); + + editor.addEventListener('input', () => { + try { + const particles = parseParticles(editor.value); + preview.innerHTML = `<pre>${JSON.stringify(particles, null, 2)}</pre>`; + } catch (e) { + preview.innerHTML = `<p class="error">${e.message}</p>`; + } + }); + + // Smooth scroll for navigation + document.querySelectorAll('nav a').forEach(anchor => { + anchor.addEventListener('click', (e) => { + e.preventDefault(); + const target = document.querySelector(anchor.getAttribute('href')); + target.scrollIntoView({ behavior: 'smooth' }); + }); + }); +}); + +function parseParticles(input) { + if (!input.trim()) return {}; + + const lines = input.split('\n'); + const result = {}; + let currentContext = [result]; + let currentIndent = 0; + + lines.forEach(line => { + if (line.trim() === '') return; + + const indent = line.search(/\S/); + const parts = line.trim().split(/\s+/); + const key = parts[0]; + const value = parts.slice(1).join(' '); + + if (indent > currentIndent) { + currentIndent = indent; + } else if (indent < currentIndent) { + const levels = (currentIndent - indent) / 2; + for (let i = 0; i < levels; i++) { + currentContext.pop(); + } + currentIndent = indent; + } + + if (value) { + currentContext[currentContext.length - 1][key] = isNaN(value) ? value : Number(value); + } else { + const newObject = {}; + currentContext[currentContext.length - 1][key] = newObject; + currentContext.push(newObject); + } + }); + + return result; +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..6b2c60f --- /dev/null +++ b/style.css @@ -0,0 +1,168 @@ +:root { + --primary-color: #2a2b4d; + --accent-color: #6d72c3; + --text-color: #333; + --background-light: #f5f6fa; + --transition-speed: 0.3s; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Segoe UI', system-ui, sans-serif; + line-height: 1.6; + color: var(--text-color); + background: var(--background-light); +} + +header { + background: var(--primary-color); + padding: 1rem; + position: fixed; + width: 100%; + z-index: 1000; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); +} + +nav ul { + display: flex; + justify-content: center; + gap: 2rem; + list-style: none; +} + +nav a { + color: white; + text-decoration: none; + font-weight: 500; + transition: var(--transition-speed); +} + +nav a:hover { + color: var(--accent-color); +} + +#hero { + height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); + color: white; + position: relative; + overflow: hidden; +} + +.tagline { + font-size: 1.5rem; + margin-top: 1rem; + opacity: 0.9; +} + +.particle-animation { + position: absolute; + width: 100%; + height: 100%; + z-index: 1; +} + +section { + padding: 4rem 2rem; + max-width: 1200px; + margin: 0 auto; +} + +h1 { + font-size: 4rem; + font-weight: 700; + text-align: center; + margin-bottom: 1rem; +} + +h2 { + font-size: 2.5rem; + color: var(--primary-color); + margin-bottom: 2rem; +} + +.code-comparison { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 2rem; + margin: 2rem 0; +} + +.code-block { + background: white; + padding: 2rem; + border-radius: 8px; + box-shadow: 0 4px 20px rgba(0,0,0,0.1); + transition: var(--transition-speed); +} + +.code-block:hover { + transform: translateY(-5px); +} + +pre { + background: #f8f9fa; + padding: 1rem; + border-radius: 4px; + overflow-x: auto; +} + +.editor-container { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 2rem; + margin-top: 2rem; +} + +#particlesEditor { + width: 100%; + height: 300px; + padding: 1rem; + border: 2px solid var(--accent-color); + border-radius: 8px; + font-family: monospace; + resize: none; +} + +#preview { + background: white; + padding: 1rem; + border-radius: 8px; + min-height: 300px; +} + +footer { + background: var(--primary-color); + color: white; + text-align: center; + padding: 2rem; + margin-top: 4rem; +} + +@media (max-width: 768px) { + .code-comparison, + .editor-container { + grid-template-columns: 1fr; + } + + h1 { + font-size: 2.5rem; + } + + h2 { + font-size: 2rem; + } + + section { + padding: 2rem 1rem; + } +}