Changes to ranks.scroll.pub

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

Global Rankings

+
+
+
+
+
+
+
+
+
+
+
+
+ Rank
+ Player
+ Score
+ Change
+
+
+
+
+
+
+
+
+
+

Built with passion by ranks.scroll.pub

+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://ranks.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Global Rankings - Live Leaderboard
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "msg_015wrnk84HAZnSnhQbdtFgxJ",
+ "type": "message",
+ "role": "assistant",
+ "model": "claude-3-5-sonnet-20241022",
+ "content": [
+ {
+ "type": "text",
+ "text": "I'll create a leaderboard web app with a clean, modern design.\n\nSuggested domain: ranks.scroll.pub (short, memorable, describes the leaderboard purpose)\n\n---domain---\nranks.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://ranks.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Global Rankings - Live Leaderboard\nstyle.css\nbody.html\nscript.js\n---body.html---\n
\n

Global Rankings

\n \n
\n\n
\n
\n \n \n
\n\n
\n
\n
\n Rank\n Player\n Score\n Change\n
\n
\n \n
\n
\n
\n
\n\n
\n

Built with passion by ranks.scroll.pub

\n
\n---style.css---\n:root {\n --primary: #2a6bed;\n --background: #ffffff;\n --text: #333333;\n --card: #f5f5f5;\n --border: #e0e0e0;\n --shadow: rgba(0,0,0,0.1);\n}\n\n[data-theme=\"dark\"] {\n --primary: #4d8eff;\n --background: #1a1a1a;\n --text: #ffffff;\n --card: #2d2d2d;\n --border: #404040;\n --shadow: rgba(0,0,0,0.3);\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-Sans, Ubuntu, Cantarell, sans-serif;\n background: var(--background);\n color: var(--text);\n line-height: 1.6;\n transition: background-color 0.3s, color 0.3s;\n}\n\n.site-header {\n padding: 2rem;\n text-align: center;\n position: relative;\n}\n\nh1 {\n font-size: 2.5rem;\n color: var(--primary);\n margin-bottom: 1rem;\n}\n\n#toggleTheme {\n position: absolute;\n right: 2rem;\n top: 2rem;\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n padding: 0.5rem;\n border-radius: 50%;\n transition: transform 0.3s;\n}\n\n#toggleTheme:hover {\n transform: scale(1.1);\n}\n\n.controls {\n max-width: 800px;\n margin: 0 auto 2rem;\n padding: 0 1rem;\n display: flex;\n gap: 1rem;\n}\n\ninput, select {\n padding: 0.75rem;\n border: 2px solid var(--border);\n border-radius: 8px;\n background: var(--card);\n color: var(--text);\n font-size: 1rem;\n}\n\ninput {\n flex: 1;\n}\n\n.leaderboard-wrapper {\n max-width: 800px;\n margin: 0 auto;\n padding: 0 1rem;\n}\n\n.leaderboard {\n background: var(--card);\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 4px 12px var(--shadow);\n}\n\n.leaderboard-header {\n display: grid;\n grid-template-columns: 80px 1fr 100px 100px;\n padding: 1rem;\n background: var(--primary);\n color: white;\n font-weight: bold;\n}\n\n.leaderboard-body {\n max-height: 600px;\n overflow-y: auto;\n}\n\n.player-row {\n display: grid;\n grid-template-columns: 80px 1fr 100px 100px;\n padding: 1rem;\n border-bottom: 1px solid var(--border);\n transition: background-color 0.2s;\n}\n\n.player-row:hover {\n background: var(--shadow);\n}\n\n.rank {\n font-weight: bold;\n}\n\n.change {\n font-weight: 500;\n}\n\n.change.positive {\n color: #2ecc71;\n}\n\n.change.negative {\n color: #e74c3c;\n}\n\nfooter {\n text-align: center;\n padding: 2rem;\n margin-top: 3rem;\n color: var(--text);\n}\n\n@media (max-width: 600px) {\n .controls {\n flex-direction: column;\n }\n \n .leaderboard-header,\n .player-row {\n grid-template-columns: 60px 1fr 70px 70px;\n font-size: 0.9rem;\n }\n}\n---script.js---\n// Sample data - in a real app, this would come from a backend\nlet players = [\n { id: 1, name: \"Alex Chen\", score: 2500, change: 12 },\n { id: 2, name: \"Maria Garcia\", score: 2450, change: -5 },\n { id: 3, name: \"James Wilson\", score: 2400, change: 8 },\n { id: 4, name: \"Sarah Kim\", score: 2350, change: 0 },\n { id: 5, name: \"David Lee\", score: 2300, change: 15 },\n // Add more players as needed\n];\n\n// DOM Elements\nconst leaderboardBody = document.getElementById('leaderboardBody');\nconst searchInput = document.getElementById('searchInput');\nconst sortSelect = document.getElementById('sortSelect');\nconst themeToggle = document.getElementById('toggleTheme');\n\n// Theme handling\nfunction toggleTheme() {\n document.body.dataset.theme = document.body.dataset.theme === 'dark' ? 'light' : 'dark';\n localStorage.setItem('theme', document.body.dataset.theme);\n}\n\n// Initialize theme\ndocument.body.dataset.theme = localStorage.getItem('theme') || 'light';\nthemeToggle.addEventListener('click', toggleTheme);\n\n// Render leaderboard\nfunction renderLeaderboard(players) {\n leaderboardBody.innerHTML = '';\n \n players.forEach((player, index) => {\n const row = document.createElement('div');\n row.className = 'player-row';\n \n const changeClass = player.change > 0 ? 'positive' : player.change < 0 ? 'negative' : '';\n const changeSymbol = player.change > 0 ? '↑' : player.change < 0 ? '↓' : '–';\n \n row.innerHTML = `\n #${index + 1}\n ${player.name}\n ${player.score}\n ${changeSymbol} ${Math.abs(player.change)}\n `;\n \n leaderboardBody.appendChild(row);\n });\n}\n\n// Search functionality\nsearchInput.addEventListener('input', (e) => {\n const searchTerm = e.target.value.toLowerCase();\n const filtered = players.filter(player => \n player.name.toLowerCase().includes(searchTerm)\n );\n renderLeaderboard(filtered);\n});\n\n// Sort functionality\nsortSelect.addEventListener('change', (e) => {\n const sortBy = e.target.value;\n const sorted = [...players].sort((a, b) => {\n if (sortBy === 'rank') return b.score - a.score;\n if (sortBy === 'score') return b.score - a.score;\n if (sortBy === 'name') return a.name.localeCompare(b.name);\n return 0;\n });\n renderLeaderboard(sorted);\n});\n\n// Initial render\nrenderLeaderboard(players);\n---end---\n\nThis implementation features:\n- Dark/light theme toggle with local storage persistence\n- Responsive design that works on all devices\n- Search functionality to filter players\n- Sorting options (by rank, score, or name)\n- Smooth animations and transitions\n- Accessible controls with ARIA labels\n- Clean, semantic HTML structure\n- Modern CSS with CSS variables\n- Professional visual design with subtle shadows and animations\n- Clear visual hierarchy\n- Performance optimized with minimal JavaScript\n- No external dependencies\n\nThe design is both functional and aesthetically pleasing, with careful attention to spacing, typography, and color contrast."
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 281,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 2405
+ }
+ }
readme.scroll
Changed around line 1
+ # ranks.scroll.pub
+ Website generated by Claude from prompt: create a single web page application with a leaderboard.
script.js
Changed around line 1
+ // Sample data - in a real app, this would come from a backend
+ let players = [
+ { id: 1, name: "Alex Chen", score: 2500, change: 12 },
+ { id: 2, name: "Maria Garcia", score: 2450, change: -5 },
+ { id: 3, name: "James Wilson", score: 2400, change: 8 },
+ { id: 4, name: "Sarah Kim", score: 2350, change: 0 },
+ { id: 5, name: "David Lee", score: 2300, change: 15 },
+ // Add more players as needed
+ ];
+
+ // DOM Elements
+ const leaderboardBody = document.getElementById('leaderboardBody');
+ const searchInput = document.getElementById('searchInput');
+ const sortSelect = document.getElementById('sortSelect');
+ const themeToggle = document.getElementById('toggleTheme');
+
+ // Theme handling
+ function toggleTheme() {
+ document.body.dataset.theme = document.body.dataset.theme === 'dark' ? 'light' : 'dark';
+ localStorage.setItem('theme', document.body.dataset.theme);
+ }
+
+ // Initialize theme
+ document.body.dataset.theme = localStorage.getItem('theme') || 'light';
+ themeToggle.addEventListener('click', toggleTheme);
+
+ // Render leaderboard
+ function renderLeaderboard(players) {
+ leaderboardBody.innerHTML = '';
+
+ players.forEach((player, index) => {
+ const row = document.createElement('div');
+ row.className = 'player-row';
+
+ const changeClass = player.change > 0 ? 'positive' : player.change < 0 ? 'negative' : '';
+ const changeSymbol = player.change > 0 ? '↑' : player.change < 0 ? '↓' : '–';
+
+ row.innerHTML = `
+ #${index + 1}
+ ${player.name}
+ ${player.score}
+ ${changeSymbol} ${Math.abs(player.change)}
+ `;
+
+ leaderboardBody.appendChild(row);
+ });
+ }
+
+ // Search functionality
+ searchInput.addEventListener('input', (e) => {
+ const searchTerm = e.target.value.toLowerCase();
+ const filtered = players.filter(player =>
+ player.name.toLowerCase().includes(searchTerm)
+ );
+ renderLeaderboard(filtered);
+ });
+
+ // Sort functionality
+ sortSelect.addEventListener('change', (e) => {
+ const sortBy = e.target.value;
+ const sorted = [...players].sort((a, b) => {
+ if (sortBy === 'rank') return b.score - a.score;
+ if (sortBy === 'score') return b.score - a.score;
+ if (sortBy === 'name') return a.name.localeCompare(b.name);
+ return 0;
+ });
+ renderLeaderboard(sorted);
+ });
+
+ // Initial render
+ renderLeaderboard(players);
style.css
Changed around line 1
+ :root {
+ --primary: #2a6bed;
+ --background: #ffffff;
+ --text: #333333;
+ --card: #f5f5f5;
+ --border: #e0e0e0;
+ --shadow: rgba(0,0,0,0.1);
+ }
+
+ [data-theme="dark"] {
+ --primary: #4d8eff;
+ --background: #1a1a1a;
+ --text: #ffffff;
+ --card: #2d2d2d;
+ --border: #404040;
+ --shadow: rgba(0,0,0,0.3);
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
+ background: var(--background);
+ color: var(--text);
+ line-height: 1.6;
+ transition: background-color 0.3s, color 0.3s;
+ }
+
+ .site-header {
+ padding: 2rem;
+ text-align: center;
+ position: relative;
+ }
+
+ h1 {
+ font-size: 2.5rem;
+ color: var(--primary);
+ margin-bottom: 1rem;
+ }
+
+ #toggleTheme {
+ position: absolute;
+ right: 2rem;
+ top: 2rem;
+ background: none;
+ border: none;
+ font-size: 1.5rem;
+ cursor: pointer;
+ padding: 0.5rem;
+ border-radius: 50%;
+ transition: transform 0.3s;
+ }
+
+ #toggleTheme:hover {
+ transform: scale(1.1);
+ }
+
+ .controls {
+ max-width: 800px;
+ margin: 0 auto 2rem;
+ padding: 0 1rem;
+ display: flex;
+ gap: 1rem;
+ }
+
+ input, select {
+ padding: 0.75rem;
+ border: 2px solid var(--border);
+ border-radius: 8px;
+ background: var(--card);
+ color: var(--text);
+ font-size: 1rem;
+ }
+
+ input {
+ flex: 1;
+ }
+
+ .leaderboard-wrapper {
+ max-width: 800px;
+ margin: 0 auto;
+ padding: 0 1rem;
+ }
+
+ .leaderboard {
+ background: var(--card);
+ border-radius: 12px;
+ overflow: hidden;
+ box-shadow: 0 4px 12px var(--shadow);
+ }
+
+ .leaderboard-header {
+ display: grid;
+ grid-template-columns: 80px 1fr 100px 100px;
+ padding: 1rem;
+ background: var(--primary);
+ color: white;
+ font-weight: bold;
+ }
+
+ .leaderboard-body {
+ max-height: 600px;
+ overflow-y: auto;
+ }
+
+ .player-row {
+ display: grid;
+ grid-template-columns: 80px 1fr 100px 100px;
+ padding: 1rem;
+ border-bottom: 1px solid var(--border);
+ transition: background-color 0.2s;
+ }
+
+ .player-row:hover {
+ background: var(--shadow);
+ }
+
+ .rank {
+ font-weight: bold;
+ }
+
+ .change {
+ font-weight: 500;
+ }
+
+ .change.positive {
+ color: #2ecc71;
+ }
+
+ .change.negative {
+ color: #e74c3c;
+ }
+
+ footer {
+ text-align: center;
+ padding: 2rem;
+ margin-top: 3rem;
+ color: var(--text);
+ }
+
+ @media (max-width: 600px) {
+ .controls {
+ flex-direction: column;
+ }
+
+ .leaderboard-header,
+ .player-row {
+ grid-template-columns: 60px 1fr 70px 70px;
+ font-size: 0.9rem;
+ }
+ }