Changes to pongbattle.scroll.pub

root
root
24 days ago
Initial commit
body.html
Changed around line 1
+
+
+
Player 1: 0
+
Player 2: 0
+
+
+
+
+
+
+
+

Player 1: W (Up) & S (Down)

+

Player 2: O (Up) & L (Down)

+
+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://pongbattle.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Pong Battle - Classic Pong Game
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "3a78ae1b-0194-4176-82f2-5dd42d289a87",
+ "object": "chat.completion",
+ "created": 1735432158,
+ "model": "deepseek-chat",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "---domain---\npongbattle.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://pongbattle.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Pong Battle - Classic Pong Game\nstyle.css\nbody.html\nscript.js\n---body.html---\n
\n
\n
Player 1: 0
\n
Player 2: 0
\n
\n
\n
\n
\n
\n
\n
\n

Player 1: W (Up) & S (Down)

\n

Player 2: O (Up) & L (Down)

\n
\n
\n---style.css---\nbody {\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100vh;\n background: linear-gradient(135deg, #1a1a2e, #16213e);\n color: #fff;\n font-family: 'Arial', sans-serif;\n}\n\n.game-container {\n text-align: center;\n}\n\n.scoreboard {\n display: flex;\n justify-content: space-around;\n margin-bottom: 20px;\n font-size: 24px;\n}\n\n.game-area {\n position: relative;\n width: 800px;\n height: 400px;\n background: #0f3460;\n border: 2px solid #e94560;\n overflow: hidden;\n}\n\n.paddle {\n position: absolute;\n width: 10px;\n height: 80px;\n background: #e94560;\n}\n\n#paddle1 {\n left: 10px;\n top: 160px;\n}\n\n#paddle2 {\n right: 10px;\n top: 160px;\n}\n\n.ball {\n position: absolute;\n width: 15px;\n height: 15px;\n background: #fff;\n border-radius: 50%;\n top: 192.5px;\n left: 392.5px;\n}\n\n.controls {\n margin-top: 20px;\n font-size: 18px;\n}\n\n@media (max-width: 768px) {\n .game-area {\n width: 90vw;\n height: 45vh;\n }\n\n .scoreboard {\n font-size: 18px;\n }\n\n .controls {\n font-size: 14px;\n }\n}\n---script.js---\nconst paddle1 = document.getElementById('paddle1');\nconst paddle2 = document.getElementById('paddle2');\nconst ball = document.getElementById('ball');\nconst player1Score = document.getElementById('player1-score');\nconst player2Score = document.getElementById('player2-score');\n\nlet paddle1Y = 160;\nlet paddle2Y = 160;\nlet ballX = 392.5;\nlet ballY = 192.5;\nlet ballSpeedX = 4;\nlet ballSpeedY = 4;\nlet score1 = 0;\nlet score2 = 0;\n\ndocument.addEventListener('keydown', (e) => {\n if (e.key === 'w' && paddle1Y > 0) {\n paddle1Y -= 20;\n } else if (e.key === 's' && paddle1Y < 320) {\n paddle1Y += 20;\n } else if (e.key === 'o' && paddle2Y > 0) {\n paddle2Y -= 20;\n } else if (e.key === 'l' && paddle2Y < 320) {\n paddle2Y += 20;\n }\n paddle1.style.top = paddle1Y + 'px';\n paddle2.style.top = paddle2Y + 'px';\n});\n\nfunction updateBall() {\n ballX += ballSpeedX;\n ballY += ballSpeedY;\n\n if (ballY <= 0 || ballY >= 385) {\n ballSpeedY = -ballSpeedY;\n }\n\n if (ballX <= 20 && ballY >= paddle1Y && ballY <= paddle1Y + 80) {\n ballSpeedX = -ballSpeedX;\n }\n\n if (ballX >= 765 && ballY >= paddle2Y && ballY <= paddle2Y + 80) {\n ballSpeedX = -ballSpeedX;\n }\n\n if (ballX <= 0) {\n score2++;\n player2Score.textContent = score2;\n resetBall();\n }\n\n if (ballX >= 785) {\n score1++;\n player1Score.textContent = score1;\n resetBall();\n }\n\n ball.style.left = ballX + 'px';\n ball.style.top = ballY + 'px';\n}\n\nfunction resetBall() {\n ballX = 392.5;\n ballY = 192.5;\n ballSpeedX = -ballSpeedX;\n}\n\nsetInterval(updateBall, 16);\n---end---"
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 263,
+ "completion_tokens": 1149,
+ "total_tokens": 1412,
+ "prompt_cache_hit_tokens": 0,
+ "prompt_cache_miss_tokens": 263
+ },
+ "system_fingerprint": "fp_f1afce2943"
+ }
readme.scroll
Changed around line 1
+ # pongbattle.scroll.pub
+ Website generated by DeepSeek from prompt: pong game with points system that uses "w" and "s" to player one and "o" and "l" to player two
script.js
Changed around line 1
+ const paddle1 = document.getElementById('paddle1');
+ const paddle2 = document.getElementById('paddle2');
+ const ball = document.getElementById('ball');
+ const player1Score = document.getElementById('player1-score');
+ const player2Score = document.getElementById('player2-score');
+
+ let paddle1Y = 160;
+ let paddle2Y = 160;
+ let ballX = 392.5;
+ let ballY = 192.5;
+ let ballSpeedX = 4;
+ let ballSpeedY = 4;
+ let score1 = 0;
+ let score2 = 0;
+
+ document.addEventListener('keydown', (e) => {
+ if (e.key === 'w' && paddle1Y > 0) {
+ paddle1Y -= 20;
+ } else if (e.key === 's' && paddle1Y < 320) {
+ paddle1Y += 20;
+ } else if (e.key === 'o' && paddle2Y > 0) {
+ paddle2Y -= 20;
+ } else if (e.key === 'l' && paddle2Y < 320) {
+ paddle2Y += 20;
+ }
+ paddle1.style.top = paddle1Y + 'px';
+ paddle2.style.top = paddle2Y + 'px';
+ });
+
+ function updateBall() {
+ ballX += ballSpeedX;
+ ballY += ballSpeedY;
+
+ if (ballY <= 0 || ballY >= 385) {
+ ballSpeedY = -ballSpeedY;
+ }
+
+ if (ballX <= 20 && ballY >= paddle1Y && ballY <= paddle1Y + 80) {
+ ballSpeedX = -ballSpeedX;
+ }
+
+ if (ballX >= 765 && ballY >= paddle2Y && ballY <= paddle2Y + 80) {
+ ballSpeedX = -ballSpeedX;
+ }
+
+ if (ballX <= 0) {
+ score2++;
+ player2Score.textContent = score2;
+ resetBall();
+ }
+
+ if (ballX >= 785) {
+ score1++;
+ player1Score.textContent = score1;
+ resetBall();
+ }
+
+ ball.style.left = ballX + 'px';
+ ball.style.top = ballY + 'px';
+ }
+
+ function resetBall() {
+ ballX = 392.5;
+ ballY = 192.5;
+ ballSpeedX = -ballSpeedX;
+ }
+
+ setInterval(updateBall, 16);
style.css
Changed around line 1
+ body {
+ margin: 0;
+ padding: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ background: linear-gradient(135deg, #1a1a2e, #16213e);
+ color: #fff;
+ font-family: 'Arial', sans-serif;
+ }
+
+ .game-container {
+ text-align: center;
+ }
+
+ .scoreboard {
+ display: flex;
+ justify-content: space-around;
+ margin-bottom: 20px;
+ font-size: 24px;
+ }
+
+ .game-area {
+ position: relative;
+ width: 800px;
+ height: 400px;
+ background: #0f3460;
+ border: 2px solid #e94560;
+ overflow: hidden;
+ }
+
+ .paddle {
+ position: absolute;
+ width: 10px;
+ height: 80px;
+ background: #e94560;
+ }
+
+ #paddle1 {
+ left: 10px;
+ top: 160px;
+ }
+
+ #paddle2 {
+ right: 10px;
+ top: 160px;
+ }
+
+ .ball {
+ position: absolute;
+ width: 15px;
+ height: 15px;
+ background: #fff;
+ border-radius: 50%;
+ top: 192.5px;
+ left: 392.5px;
+ }
+
+ .controls {
+ margin-top: 20px;
+ font-size: 18px;
+ }
+
+ @media (max-width: 768px) {
+ .game-area {
+ width: 90vw;
+ height: 45vh;
+ }
+
+ .scoreboard {
+ font-size: 18px;
+ }
+
+ .controls {
+ font-size: 14px;
+ }
+ }