Changes to appleshoot.scroll.pub

root
root
6 days ago
Initial commit
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://appleshoot.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Apple Shooter - Daily High Score Challenge
+ style.css
+ header
+ class game-header
+ h1 Apple Shooter
+ div
+ id scoreDisplay
+ class score
+ span Score:
+ span
+ id currentScore
+ 0
+ div
+ id highScore
+ class high-score
+ span Today's High Score:
+ span
+ id dailyHighScore
+ 0
+ main
+ class game-container
+ canvas
+ id gameCanvas
+ width 800
+ height 600
+ div
+ class controls
+ button Start Game
+ id startButton
+ button Reset
+ id resetButton
+ footer
+ class game-footer
+ p Made with ❤️ for apple shooting enthusiasts
+ p Join the daily challenge and beat the high score!
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "msg_01Mx9pUdZdijRUpuZ4xgstZu",
+ "type": "message",
+ "role": "assistant",
+ "model": "claude-3-5-sonnet-20241022",
+ "content": [
+ {
+ "type": "text",
+ "text": "Let me create a fun apple-shooting CRUD game website for you.\n\n---domain---\nappleshoot.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://appleshoot.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Apple Shooter - Daily High Score Challenge\nstyle.css\nheader\n class game-header\n h1 Apple Shooter\n div\n id scoreDisplay\n class score\n span Score: \n span\n id currentScore\n 0\n div\n id highScore\n class high-score\n span Today's High Score: \n span\n id dailyHighScore\n 0\nmain\n class game-container\n canvas\n id gameCanvas\n width 800\n height 600\n div\n class controls\n button Start Game\n id startButton\n button Reset\n id resetButton\nfooter\n class game-footer\n p Made with ❤️ for apple shooting enthusiasts\n p Join the daily challenge and beat the high score!\nscript.js\n---style.css---\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:root {\n --primary-color: #ff6b6b;\n --secondary-color: #4ecdc4;\n --background-color: #f7f7f7;\n --text-color: #2d3436;\n}\n\nbody {\n font-family: 'Segoe UI', system-ui, sans-serif;\n background: var(--background-color);\n color: var(--text-color);\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n}\n\n.game-header {\n padding: 1rem;\n background: white;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n text-align: center;\n}\n\nh1 {\n color: var(--primary-color);\n font-size: 2.5rem;\n margin-bottom: 1rem;\n text-shadow: 2px 2px 4px rgba(0,0,0,0.1);\n}\n\n.score, .high-score {\n font-size: 1.2rem;\n margin: 0.5rem;\n color: var(--text-color);\n}\n\n.game-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2rem;\n gap: 1rem;\n}\n\ncanvas {\n background: white;\n border-radius: 10px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.1);\n max-width: 100%;\n height: auto;\n}\n\n.controls {\n display: flex;\n gap: 1rem;\n}\n\nbutton {\n padding: 0.8rem 1.5rem;\n border: none;\n border-radius: 25px;\n background: var(--secondary-color);\n color: white;\n font-size: 1rem;\n cursor: pointer;\n transition: transform 0.2s, box-shadow 0.2s;\n}\n\nbutton:hover {\n transform: translateY(-2px);\n box-shadow: 0 4px 12px rgba(78,205,196,0.3);\n}\n\n.game-footer {\n padding: 1rem;\n text-align: center;\n background: white;\n box-shadow: 0 -2px 10px rgba(0,0,0,0.1);\n}\n\n@media (max-width: 768px) {\n h1 {\n font-size: 2rem;\n }\n \n .game-container {\n padding: 1rem;\n }\n \n button {\n padding: 0.6rem 1.2rem;\n }\n}\n---script.js---\nclass Game {\n constructor() {\n this.canvas = document.getElementById('gameCanvas');\n this.ctx = this.canvas.getContext('2d');\n this.score = 0;\n this.apples = [];\n this.bullets = [];\n this.isRunning = false;\n this.dailyHighScore = this.loadDailyHighScore();\n \n this.setupEventListeners();\n this.updateHighScore();\n }\n\n setupEventListeners() {\n document.getElementById('startButton').addEventListener('click', () => this.startGame());\n document.getElementById('resetButton').addEventListener('click', () => this.resetGame());\n this.canvas.addEventListener('click', (e) => this.shoot(e));\n }\n\n startGame() {\n if (this.isRunning) return;\n this.isRunning = true;\n this.generateApples();\n this.gameLoop();\n }\n\n resetGame() {\n this.isRunning = false;\n this.score = 0;\n this.apples = [];\n this.bullets = [];\n this.updateScore();\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n generateApples() {\n for (let i = 0; i < 10; i++) {\n this.apples.push({\n x: Math.random() * (this.canvas.width - 30),\n y: Math.random() * (this.canvas.height - 30),\n size: 30,\n isHit: false\n });\n }\n }\n\n shoot(e) {\n if (!this.isRunning) return;\n \n const rect = this.canvas.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n \n this.bullets.push({x, y, size: 5});\n this.checkCollisions();\n }\n\n checkCollisions() {\n this.bullets.forEach(bullet => {\n this.apples.forEach(apple => {\n if (!apple.isHit && this.detectCollision(bullet, apple)) {\n apple.isHit = true;\n this.score += 100;\n this.updateScore();\n }\n });\n });\n }\n\n detectCollision(bullet, apple) {\n const dx = bullet.x - (apple.x + apple.size/2);\n const dy = bullet.y - (apple.y + apple.size/2);\n return Math.sqrt(dx*dx + dy*dy) < (apple.size/2 + bullet.size/2);\n }\n\n updateScore() {\n document.getElementById('currentScore').textContent = this.score;\n if (this.score > this.dailyHighScore) {\n this.dailyHighScore = this.score;\n this.saveDailyHighScore();\n this.updateHighScore();\n }\n }\n\n loadDailyHighScore() {\n const today = new Date().toDateString();\n const saved = localStorage.getItem('dailyHighScore');\n if (saved) {\n const {date, score} = JSON.parse(saved);\n if (date === today) return score;\n }\n return 0;\n }\n\n saveDailyHighScore() {\n const today = new Date().toDateString();\n localStorage.setItem('dailyHighScore', JSON.stringify({\n date: today,\n score: this.dailyHighScore\n }));\n }\n\n updateHighScore() {\n document.getElementById('dailyHighScore').textContent = this.dailyHighScore;\n }\n\n draw() {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n \n // Draw apples\n this.apples.forEach(apple => {\n if (!apple.isHit) {\n this.ctx.fillStyle = '#ff6b6b';\n this.ctx.beginPath();\n this.ctx.arc(apple.x + apple.size/2, apple.y + apple.size/2, apple.size/2, 0, Math.PI * 2);\n this.ctx.fill();\n }\n });\n \n // Draw bullets\n this.bullets.forEach(bullet => {\n this.ctx.fillStyle = '#4ecdc4';\n this.ctx.beginPath();\n this.ctx.arc(bullet.x, bullet.y, bullet.size, 0, Math.PI * 2);\n this.ctx.fill();\n });\n }\n\n gameLoop() {\n if (!this.isRunning) return;\n \n this.draw();\n \n if (this.apples.every(apple => apple.isHit)) {\n this.isRunning = false;\n alert(`Game Over! Final Score: ${this.score}`);\n return;\n }\n \n requestAnimationFrame(() => this.gameLoop());\n }\n}\n\nwindow.addEventListener('load', () => {\n new Game();\n});\n---end---\n\nThis creates a fun and engaging apple shooting game with the following features:\n\n1. Clean, modern UI with smooth animations\n2. Daily high score system using localStorage\n3. Responsive canvas that works on mobile and desktop\n4. Simple click/tap to shoot mechanics\n5. Score tracking and display\n6. Start and reset game controls\n7. Collision detection between bullets and apples\n8. Beautiful CSS styling with variables and transitions\n9. Accessible controls and semantic HTML\n10. No external dependencies\n\nThe game is simple to play: click Start Game, then click anywhere on the canvas to shoot at the apples. Each hit apple awards 100 points. The game ends when all apples are hit, and the daily high score is saved locally. The design is mobile-responsive and follows modern web development best practices."
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 846,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 2440
+ }
+ }
readme.scroll
Changed around line 1
+ # appleshoot.scroll.pub
+
+ Prompt: website
+ Agent: claude
+ Model: claude-3-5-sonnet-20241022
+
+ ## User prompt
+ Create a crud game that inspires one to keep shooting until all the apples are broken. The highest score each day wins so create a memory M
+
+ ## System prompt
+ You are an expert web developer. Create a website based on this request: "Create a crud game that inspires one to keep shooting until all the apples are broken. The highest score each day wins so create a memory M"
+
+ 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
+ class Game {
+ constructor() {
+ this.canvas = document.getElementById('gameCanvas');
+ this.ctx = this.canvas.getContext('2d');
+ this.score = 0;
+ this.apples = [];
+ this.bullets = [];
+ this.isRunning = false;
+ this.dailyHighScore = this.loadDailyHighScore();
+
+ this.setupEventListeners();
+ this.updateHighScore();
+ }
+
+ setupEventListeners() {
+ document.getElementById('startButton').addEventListener('click', () => this.startGame());
+ document.getElementById('resetButton').addEventListener('click', () => this.resetGame());
+ this.canvas.addEventListener('click', (e) => this.shoot(e));
+ }
+
+ startGame() {
+ if (this.isRunning) return;
+ this.isRunning = true;
+ this.generateApples();
+ this.gameLoop();
+ }
+
+ resetGame() {
+ this.isRunning = false;
+ this.score = 0;
+ this.apples = [];
+ this.bullets = [];
+ this.updateScore();
+ this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
+ }
+
+ generateApples() {
+ for (let i = 0; i < 10; i++) {
+ this.apples.push({
+ x: Math.random() * (this.canvas.width - 30),
+ y: Math.random() * (this.canvas.height - 30),
+ size: 30,
+ isHit: false
+ });
+ }
+ }
+
+ shoot(e) {
+ if (!this.isRunning) return;
+
+ const rect = this.canvas.getBoundingClientRect();
+ const x = e.clientX - rect.left;
+ const y = e.clientY - rect.top;
+
+ this.bullets.push({x, y, size: 5});
+ this.checkCollisions();
+ }
+
+ checkCollisions() {
+ this.bullets.forEach(bullet => {
+ this.apples.forEach(apple => {
+ if (!apple.isHit && this.detectCollision(bullet, apple)) {
+ apple.isHit = true;
+ this.score += 100;
+ this.updateScore();
+ }
+ });
+ });
+ }
+
+ detectCollision(bullet, apple) {
+ const dx = bullet.x - (apple.x + apple.size/2);
+ const dy = bullet.y - (apple.y + apple.size/2);
+ return Math.sqrt(dx*dx + dy*dy) < (apple.size/2 + bullet.size/2);
+ }
+
+ updateScore() {
+ document.getElementById('currentScore').textContent = this.score;
+ if (this.score > this.dailyHighScore) {
+ this.dailyHighScore = this.score;
+ this.saveDailyHighScore();
+ this.updateHighScore();
+ }
+ }
+
+ loadDailyHighScore() {
+ const today = new Date().toDateString();
+ const saved = localStorage.getItem('dailyHighScore');
+ if (saved) {
+ const {date, score} = JSON.parse(saved);
+ if (date === today) return score;
+ }
+ return 0;
+ }
+
+ saveDailyHighScore() {
+ const today = new Date().toDateString();
+ localStorage.setItem('dailyHighScore', JSON.stringify({
+ date: today,
+ score: this.dailyHighScore
+ }));
+ }
+
+ updateHighScore() {
+ document.getElementById('dailyHighScore').textContent = this.dailyHighScore;
+ }
+
+ draw() {
+ this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
+
+ // Draw apples
+ this.apples.forEach(apple => {
+ if (!apple.isHit) {
+ this.ctx.fillStyle = '#ff6b6b';
+ this.ctx.beginPath();
+ this.ctx.arc(apple.x + apple.size/2, apple.y + apple.size/2, apple.size/2, 0, Math.PI * 2);
+ this.ctx.fill();
+ }
+ });
+
+ // Draw bullets
+ this.bullets.forEach(bullet => {
+ this.ctx.fillStyle = '#4ecdc4';
+ this.ctx.beginPath();
+ this.ctx.arc(bullet.x, bullet.y, bullet.size, 0, Math.PI * 2);
+ this.ctx.fill();
+ });
+ }
+
+ gameLoop() {
+ if (!this.isRunning) return;
+
+ this.draw();
+
+ if (this.apples.every(apple => apple.isHit)) {
+ this.isRunning = false;
+ alert(`Game Over! Final Score: ${this.score}`);
+ return;
+ }
+
+ requestAnimationFrame(() => this.gameLoop());
+ }
+ }
+
+ window.addEventListener('load', () => {
+ new Game();
+ });
style.css
Changed around line 1
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ :root {
+ --primary-color: #ff6b6b;
+ --secondary-color: #4ecdc4;
+ --background-color: #f7f7f7;
+ --text-color: #2d3436;
+ }
+
+ body {
+ font-family: 'Segoe UI', system-ui, sans-serif;
+ background: var(--background-color);
+ color: var(--text-color);
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .game-header {
+ padding: 1rem;
+ background: white;
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
+ text-align: center;
+ }
+
+ h1 {
+ color: var(--primary-color);
+ font-size: 2.5rem;
+ margin-bottom: 1rem;
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
+ }
+
+ .score, .high-score {
+ font-size: 1.2rem;
+ margin: 0.5rem;
+ color: var(--text-color);
+ }
+
+ .game-container {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 2rem;
+ gap: 1rem;
+ }
+
+ canvas {
+ background: white;
+ border-radius: 10px;
+ box-shadow: 0 4px 20px rgba(0,0,0,0.1);
+ max-width: 100%;
+ height: auto;
+ }
+
+ .controls {
+ display: flex;
+ gap: 1rem;
+ }
+
+ button {
+ padding: 0.8rem 1.5rem;
+ border: none;
+ border-radius: 25px;
+ background: var(--secondary-color);
+ color: white;
+ font-size: 1rem;
+ cursor: pointer;
+ transition: transform 0.2s, box-shadow 0.2s;
+ }
+
+ button:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 12px rgba(78,205,196,0.3);
+ }
+
+ .game-footer {
+ padding: 1rem;
+ text-align: center;
+ background: white;
+ box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
+ }
+
+ @media (max-width: 768px) {
+ h1 {
+ font-size: 2rem;
+ }
+
+ .game-container {
+ padding: 1rem;
+ }
+
+ button {
+ padding: 0.6rem 1.2rem;
+ }
+ }