Changes to eloanything.scroll.pub

Breck Yunits
Breck Yunits
1 month ago
updated script.js
script.js
Changed around line 1
+ const ELO_K = 32;
+ let items = [];
+ let currentPair = [];
+ let history = new Set();
+
+ function calculateElo(winner, loser) {
+ const expectedScore = (loser) =>
+ 1 / (1 + 10 ** ((winner.rating - loser.rating) / 400));
+ const winnerExpected = expectedScore(loser);
+ const loserExpected = expectedScore(winner);
+
+ winner.rating += ELO_K * (1 - winnerExpected);
+ loser.rating += ELO_K * (0 - loserExpected);
+ }
+
+ function getRandomPair() {
+ const pool = items.filter((item) => !currentPair.includes(item));
+ if (pool.length < 2) {
+ const allPairs = items
+ .flatMap((a) => items.filter((b) => a !== b).map((b) => [a, b]))
+ .filter((pair) => !history.has(pair.join()));
+ return allPairs[Math.floor(Math.random() * allPairs.length)] || [];
+ }
+ return [currentPair[0], pool[Math.floor(Math.random() * pool.length)]];
+ }
+
+ function updateDisplay() {
+ const [a, b] = currentPair;
+ document.getElementById("frameA").src = a.url;
+ document.getElementById("frameB").src = b.url;
+ document.getElementById("scoreA").textContent = Math.round(a.rating);
+ document.getElementById("scoreB").textContent = Math.round(b.rating);
+ }
+
+ function handleVote(side) {
+ const winner = side === "a" ? currentPair[0] : currentPair[1];
+ const loser = side === "a" ? currentPair[1] : currentPair[0];
+ calculateElo(winner, loser);
+ history.add(currentPair.map((i) => i.url).join());
+ showNextPair();
+ }
+
+ function showNextPair() {
+ currentPair = getRandomPair();
+ if (!currentPair.length) return showResults();
+ updateDisplay();
+ }
+
+ function showResults() {
+ document.getElementById("versusContainer").classList.add("hidden");
+ document.getElementById("resultsContainer").classList.remove("hidden");
+ const sorted = [...items].sort((a, b) => b.rating - a.rating);
+ const table = document.getElementById("rankingsTable");
+ table.innerHTML =
+ `RankURLScore` +
+ sorted
+ .map(
+ (item, i) => `
+
+ ${i + 1}
+ ${item.url}
+ ${Math.round(item.rating)}
+
+ `,
+ )
+ .join("");
+ }
+
+ document.getElementById("startBtn").addEventListener("click", () => {
+ const urls = document
+ .getElementById("urlInput")
+ .value.split(
+ "\
+ ",
+ )
+ .filter((url) => url.trim());
+ if (urls.length < 2) return alert("Need at least 2 URLs!");
+
+ items = urls.map((url) => ({ url, rating: 1000 }));
+ document.getElementById("versusContainer").classList.remove("hidden");
+ document.querySelector(".hero").classList.add("fade-down");
+ showNextPair();
+ });
+
+ document.querySelectorAll(".vote-button").forEach((btn) => {
+ btn.addEventListener("click", (e) => handleVote(e.target.dataset.side));
+ });
+
+ document.getElementById("exportBtn").addEventListener("click", () => {
+ const csv =
+ "URL,Score\
+ " +
+ items
+ .map((i) => `${i.url},${i.rating}`)
+ .join(
+ "\
+ ",
+ );
+ const blob = new Blob([csv], { type: "text/csv" });
+ const link = document.createElement("a");
+ link.href = URL.createObjectURL(blob);
+ link.download = "elo_rankings.csv";
+ link.click();
+ });
+
+ // Preserve state on reload
+ window.addEventListener("beforeunload", () => {
+ localStorage.setItem(
+ "eloState",
+ JSON.stringify({ items, history: [...history] }),
+ );
+ });
+
+ window.addEventListener("load", () => {
+ const saved = localStorage.getItem("eloState");
+ if (saved) {
+ const state = JSON.parse(saved);
+ items = state.items;
+ history = new Set(state.history);
+ document.getElementById("versusContainer").classList.remove("hidden");
+ showNextPair();
+ }
+ });
Breck Yunits
Breck Yunits
1 month ago
created script.js
script.js
Breck Yunits
Breck Yunits
1 month ago
updated style.css
style.css
Changed around line 1
+ :root {
+ --primary: #6c5ce7;
+ --secondary: #a8a5e6;
+ --background: linear-gradient(45deg, #1a1a2e, #16213e);
+ --glow: radial-gradient(circle, #72f2ff 0%, #6c5ce7 100%);
+ }
+
+ body {
+ margin: 0;
+ font-family: "Segoe UI", system-ui;
+ background: var(--background);
+ color: white;
+ min-height: 100vh;
+ line-height: 1.6;
+ }
+
+ .hero {
+ padding: 4rem 2rem;
+ text-align: center;
+ }
+
+ .title-glow {
+ text-shadow: 0 0 20px var(--primary);
+ animation: glowPulse 2s infinite alternate;
+ }
+
+ #urlInput {
+ width: 80%;
+ max-width: 600px;
+ padding: 1rem;
+ border: 2px solid var(--primary);
+ border-radius: 1rem;
+ background: rgba(255, 255, 255, 0.1);
+ color: white;
+ margin: 1rem 0;
+ }
+
+ .versus-grid {
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ gap: 2rem;
+ align-items: center;
+ padding: 2rem;
+ }
+
+ .battle-frame {
+ width: 100%;
+ height: 400px;
+ border: none;
+ border-radius: 1rem;
+ box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
+ background: white;
+ }
+
+ .vs-circle {
+ background: var(--primary);
+ width: 60px;
+ height: 60px;
+ border-radius: 50%;
+ display: grid;
+ place-items: center;
+ font-weight: bold;
+ font-size: 1.5rem;
+ box-shadow: 0 0 20px var(--primary);
+ }
+
+ .vote-button {
+ margin-top: 1rem;
+ padding: 1rem 2rem;
+ border: none;
+ border-radius: 50px;
+ background: var(--primary);
+ color: white;
+ cursor: pointer;
+ transition:
+ transform 0.3s,
+ box-shadow 0.3s;
+ }
+
+ .vote-button:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 5px 15px var(--primary);
+ }
+
+ .rankings-table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 2rem 0;
+ }
+
+ .rankings-table td,
+ .rankings-table th {
+ padding: 1rem;
+ background: rgba(255, 255, 255, 0.05);
+ border-bottom: 2px solid var(--secondary);
+ }
+
+ .score-badge {
+ position: absolute;
+ top: -10px;
+ right: -10px;
+ background: var(--primary);
+ padding: 0.5rem 1rem;
+ border-radius: 20px;
+ font-weight: bold;
+ }
+
+ @keyframes glowPulse {
+ from {
+ text-shadow: 0 0 10px var(--primary);
+ }
+ to {
+ text-shadow: 0 0 30px var(--primary);
+ }
+ }
+
+ @media (max-width: 768px) {
+ .versus-grid {
+ grid-template-columns: 1fr;
+ }
+ .vs-circle {
+ margin: 2rem auto;
+ }
+ }
Breck Yunits
Breck Yunits
1 month ago
created style.css
style.css
Breck Yunits
Breck Yunits
1 month ago
updated index.scroll
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://eloarena.scroll.pub
+ title EloAnything - Rank Anything!
+ metaTags
+ editButton /edit.html
+ style.css
+
+ header
+ class hero
+ div
+ class hero-content
+ h1 EloAnything
+ class title-glow
+ p Paste URLs to begin your ranking battle!
+ class subtitle
+ textarea
+ id urlInput
+ placeholder Paste URLs here (one per line)
+ rows 6
+ button
+ id startBtn
+ class primary-button pulse
+ Start Ranking!
+ main
+ class container
+ div
+ id versusContainer
+ class versus-grid hidden
+ div
+ class frame-card
+ h2 Contender A
+ class contender-label
+ iframe
+ id frameA
+ class battle-frame
+ div
+ class score-badge
+ id scoreA
+ button
+ class vote-button slide-in
+ data-side=\"a\"
+ 🏆 Choose A
+ div
+ class vs-circle
+ VS
+ div
+ class frame-card
+ h2 Contender B
+ class contender-label
+ iframe
+ id frameB
+ class battle-frame
+ div
+ class score-badge
+ id scoreB
+ button
+ class vote-button slide-in
+ data-side=\"b\"
+ 🏆 Choose B
+ div
+ id resultsContainer
+ class hidden
+ h2 Current Rankings
+ class rankings-title
+ table
+ id rankingsTable
+ class rankings-table
+ button
+ id exportBtn
+ class secondary-button
+ 📥 Export as CSV
+ footer
+ class footer
+ p Made with ❤️ for competitive ranking
+ p Reload page to start new tournament
+
+ script.js
Breck Yunits
Breck Yunits
1 month ago
created index.scroll
index.scroll
ScrollHub
ScrollHub
1 month ago
Initial commit
prompt.json
Changed around line 1
+ {
+ "id": "633af769-32db-4042-857b-4ca87eb0126a",
+ "object": "chat.completion",
+ "created": 1746300243,
+ "model": "deepseek-reasoner",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "---domain--- \neloarena.scroll.pub \n\n---index.scroll--- \nbuildHtml \nbaseUrl https://eloarena.scroll.pub \nmetaTags \neditButton /edit.html \ntitle EloAnything - Rank Anything! \nstyle.css \n\nheader \n class hero \n div \n class hero-content \n h1 EloAnything \n class title-glow \n p Paste URLs to begin your ranking battle! \n class subtitle \n textarea \n id urlInput \n placeholder Paste URLs here (one per line) \n rows 6 \n button \n id startBtn \n class primary-button pulse \n Start Ranking! \nmain \n class container \n div \n id versusContainer \n class versus-grid hidden \n div \n class frame-card \n h2 Contender A \n class contender-label \n iframe \n id frameA \n class battle-frame \n div \n class score-badge \n id scoreA \n button \n class vote-button slide-in \n data-side=\"a\" \n 🏆 Choose A \n div \n class vs-circle \n VS \n div \n class frame-card \n h2 Contender B \n class contender-label \n iframe \n id frameB \n class battle-frame \n div \n class score-badge \n id scoreB \n button \n class vote-button slide-in \n data-side=\"b\" \n 🏆 Choose B \n div \n id resultsContainer \n class hidden \n h2 Current Rankings \n class rankings-title \n table \n id rankingsTable \n class rankings-table \n button \n id exportBtn \n class secondary-button \n 📥 Export as CSV \nfooter \n class footer \n p Made with ❤️ for competitive ranking \n p Reload page to start new tournament \n\nscript.js \n\n---style.css--- \n:root { \n --primary: #6c5ce7; \n --secondary: #a8a5e6; \n --background: linear-gradient(45deg, #1a1a2e, #16213e); \n --glow: radial-gradient(circle, #72f2ff 0%, #6c5ce7 100%); \n} \n\nbody { \n margin: 0; \n font-family: 'Segoe UI', system-ui; \n background: var(--background); \n color: white; \n min-height: 100vh; \n line-height: 1.6; \n} \n\n.hero { \n padding: 4rem 2rem; \n text-align: center; \n} \n\n.title-glow { \n text-shadow: 0 0 20px var(--primary); \n animation: glowPulse 2s infinite alternate; \n} \n\n#urlInput { \n width: 80%; \n max-width: 600px; \n padding: 1rem; \n border: 2px solid var(--primary); \n border-radius: 1rem; \n background: rgba(255,255,255,0.1); \n color: white; \n margin: 1rem 0; \n} \n\n.versus-grid { \n display: grid; \n grid-template-columns: 1fr auto 1fr; \n gap: 2rem; \n align-items: center; \n padding: 2rem; \n} \n\n.battle-frame { \n width: 100%; \n height: 400px; \n border: none; \n border-radius: 1rem; \n box-shadow: 0 10px 30px rgba(108,92,231,0.3); \n background: white; \n} \n\n.vs-circle { \n background: var(--primary); \n width: 60px; \n height: 60px; \n border-radius: 50%; \n display: grid; \n place-items: center; \n font-weight: bold; \n font-size: 1.5rem; \n box-shadow: 0 0 20px var(--primary); \n} \n\n.vote-button { \n margin-top: 1rem; \n padding: 1rem 2rem; \n border: none; \n border-radius: 50px; \n background: var(--primary); \n color: white; \n cursor: pointer; \n transition: transform 0.3s, box-shadow 0.3s; \n} \n\n.vote-button:hover { \n transform: translateY(-2px); \n box-shadow: 0 5px 15px var(--primary); \n} \n\n.rankings-table { \n width: 100%; \n border-collapse: collapse; \n margin: 2rem 0; \n} \n\n.rankings-table td, .rankings-table th { \n padding: 1rem; \n background: rgba(255,255,255,0.05); \n border-bottom: 2px solid var(--secondary); \n} \n\n.score-badge { \n position: absolute; \n top: -10px; \n right: -10px; \n background: var(--primary); \n padding: 0.5rem 1rem; \n border-radius: 20px; \n font-weight: bold; \n} \n\n@keyframes glowPulse { \n from { text-shadow: 0 0 10px var(--primary); } \n to { text-shadow: 0 0 30px var(--primary); } \n} \n\n@media (max-width: 768px) { \n .versus-grid { grid-template-columns: 1fr; } \n .vs-circle { margin: 2rem auto; } \n} \n\n---script.js--- \nconst ELO_K = 32; \nlet items = []; \nlet currentPair = []; \nlet history = new Set(); \n\nfunction calculateElo(winner, loser) { \n const expectedScore = (loser) => 1 / (1 + 10 ** ((winner.rating - loser.rating) / 400)); \n const winnerExpected = expectedScore(loser); \n const loserExpected = expectedScore(winner); \n\n winner.rating += ELO_K * (1 - winnerExpected); \n loser.rating += ELO_K * (0 - loserExpected); \n} \n\nfunction getRandomPair() { \n const pool = items.filter(item => !currentPair.includes(item)); \n if (pool.length < 2) { \n const allPairs = items.flatMap(a => \n items.filter(b => a !== b).map(b => [a, b]) \n ).filter(pair => !history.has(pair.join())); \n return allPairs[Math.floor(Math.random() * allPairs.length)] || []; \n } \n return [currentPair[0], pool[Math.floor(Math.random() * pool.length)]]; \n} \n\nfunction updateDisplay() { \n const [a, b] = currentPair; \n document.getElementById('frameA').src = a.url; \n document.getElementById('frameB').src = b.url; \n document.getElementById('scoreA').textContent = Math.round(a.rating); \n document.getElementById('scoreB').textContent = Math.round(b.rating); \n} \n\nfunction handleVote(side) { \n const winner = side === 'a' ? currentPair[0] : currentPair[1]; \n const loser = side === 'a' ? currentPair[1] : currentPair[0]; \n calculateElo(winner, loser); \n history.add(currentPair.map(i => i.url).join()); \n showNextPair(); \n} \n\nfunction showNextPair() { \n currentPair = getRandomPair(); \n if (!currentPair.length) return showResults(); \n updateDisplay(); \n} \n\nfunction showResults() { \n document.getElementById('versusContainer').classList.add('hidden'); \n document.getElementById('resultsContainer').classList.remove('hidden'); \n const sorted = [...items].sort((a, b) => b.rating - a.rating); \n const table = document.getElementById('rankingsTable'); \n table.innerHTML = `RankURLScore` + \n sorted.map((item, i) => ` \n \n ${i + 1} \n ${item.url} \n ${Math.round(item.rating)} \n \n `).join(''); \n} \n\ndocument.getElementById('startBtn').addEventListener('click', () => { \n const urls = document.getElementById('urlInput').value \n .split('\\n').filter(url => url.trim()); \n if (urls.length < 2) return alert('Need at least 2 URLs!'); \n\n items = urls.map(url => ({ url, rating: 1000 })); \n document.getElementById('versusContainer').classList.remove('hidden'); \n document.querySelector('.hero').classList.add('fade-down'); \n showNextPair(); \n}); \n\ndocument.querySelectorAll('.vote-button').forEach(btn => { \n btn.addEventListener('click', (e) => \n handleVote(e.target.dataset.side) \n ); \n}); \n\ndocument.getElementById('exportBtn').addEventListener('click', () => { \n const csv = 'URL,Score\\n' + items.map(i => `${i.url},${i.rating}`).join('\\n'); \n const blob = new Blob([csv], { type: 'text/csv' }); \n const link = document.createElement('a'); \n link.href = URL.createObjectURL(blob); \n link.download = 'elo_rankings.csv'; \n link.click(); \n}); \n\n// Preserve state on reload \nwindow.addEventListener('beforeunload', () => { \n localStorage.setItem('eloState', JSON.stringify({ items, history: [...history] })); \n}); \n\nwindow.addEventListener('load', () => { \n const saved = localStorage.getItem('eloState'); \n if (saved) { \n const state = JSON.parse(saved); \n items = state.items; \n history = new Set(state.history); \n document.getElementById('versusContainer').classList.remove('hidden'); \n showNextPair(); \n } \n}); \n\n---end---",
+ "reasoning_content": "Alright, let's tackle this problem. The user wants a client-side only web app called EloAnything. The main features are a textarea for URLs, side-by-side iframes for voting, and a ranking display with CSV export. It needs to be beautiful, responsive, and use only vanilla technologies.\n\nFirst, I'll start by thinking about the structure. The HTML needs a textarea input, a section for the voting iframes, and a results section. Since we're using Scroll, I'll structure the particles accordingly, making sure the hierarchy is correct with indentation.\n\nNext, the domain name. It should end with scroll.pub and be memorable. \"elo\" is part of the app's name, so maybe \"eloarena.scroll.pub\" to evoke a competitive feel.\n\nFor the HTML body, the main sections are the hero section with instructions and textarea, the versus container for iframes, and the results. I'll use semantic tags like header, main, section, and ensure accessibility with ARIA labels.\n\nCSS is crucial for making it beautiful. A gradient background can add flair. Using CSS Grid for responsive layouts, especially for the versus section on mobile. Animations like fadeIn and pulse will make the interface lively. Styling buttons and cards with shadows and transitions for interactivity.\n\nJavaScript will handle the Elo algorithm. Each URL starts with a rating of 1000. When a user chooses a winner, the Elo ratings update. I need to track all possible pairs and ensure each pair is shown without repetition. LocalStorage saves the state so users can resume. The CSV export function converts the rankings into a downloadable file.\n\nTesting edge cases: handling odd numbers of items, ensuring iframes load correctly, and preventing duplicate pairs. Also, making sure the UI is responsive, especially on mobile where the versus section stacks vertically.\n\nFinally, ensuring no external dependencies and that everything works client-side. The code should be clean, with comments for clarity. The design should be engaging with a modern look, using CSS variables for easy theming."
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 922,
+ "completion_tokens": 2686,
+ "total_tokens": 3608,
+ "prompt_tokens_details": {
+ "cached_tokens": 0
+ },
+ "completion_tokens_details": {
+ "reasoning_tokens": 419
+ },
+ "prompt_cache_hit_tokens": 0,
+ "prompt_cache_miss_tokens": 922
+ },
+ "system_fingerprint": "fp_5417b77867_prod0425fp8"
+ }
readme.scroll
Changed around line 1
+ # error.scroll.pub
+
+ Prompt: website
+ Agent: deepseekreasoner
+ Model: deepseek-reasoner
+
+ ## User prompt
+ Create a simple clientside only web app called EloAnything. It gives you a textarea to paste in a plain text list of urls, one per line. Then it shows you side by side iframes and you click on which one you prefer. Then it shows you the rankings and score of each url (which you can easily save as csv). So you should use a standard elo algo for determinining which pairings to show. Make it beautiful and fun to use.
+
+ ## System prompt
+ You are an expert web developer. Create a website based on this request: "Create a simple clientside only web app called EloAnything. It gives you a textarea to paste in a plain text list of urls, one per line. Then it shows you side by side iframes and you click on which one you prefer. Then it shows you the rankings and score of each url (which you can easily save as csv). So you should use a standard elo algo for determinining which pairings to show. Make it beautiful and fun to use."
+
+ 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---