bgman47 commited on
Commit
abbf244
·
verified ·
1 Parent(s): d68e72b

vtb store update

Browse files
Files changed (1) hide show
  1. store.json +23 -0
store.json CHANGED
@@ -744,5 +744,28 @@
744
  "shared_at": 1783705283,
745
  "owner": "bg",
746
  "listed": true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747
  }
748
  }
 
744
  "shared_at": 1783705283,
745
  "owner": "bg",
746
  "listed": true
747
+ },
748
+ "un jeu de pong___GLM 4.7": {
749
+ "block_id": "AkeCjs9PiG0Js01oQsYb",
750
+ "intention": "Un jeu de pong",
751
+ "html": "<!DOCTYPE html>\n<html lang=\"fr\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n <title>Pong</title>\n <style>\n :root {\n --bg-color: #1a1a1a;\n --fg-color: #f0f0f0;\n --accent-color: #4a90e2;\n --font-main: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n }\n\n * {\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n }\n\n body, html {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n background-color: var(--bg-color);\n color: var(--fg-color);\n font-family: var(--font-main);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n\n #game-container {\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n canvas {\n background-color: #000;\n box-shadow: 0 0 20px rgba(0,0,0,0.5);\n max-width: 100%;\n max-height: 100%;\n }\n\n .ui-layer {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n z-index: 10;\n }\n\n .score-board {\n position: absolute;\n top: 20px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n padding: 0 10%;\n font-size: 4rem;\n font-weight: bold;\n opacity: 0.3;\n pointer-events: none;\n }\n\n .message {\n background: rgba(0, 0, 0, 0.85);\n padding: 2rem;\n border-radius: 20px;\n pointer-events: auto;\n transition: opacity 0.3s ease;\n backdrop-filter: blur(5px);\n border: 2px solid var(--fg-color);\n }\n\n .hidden {\n opacity: 0;\n pointer-events: none;\n }\n\n h1 {\n font-size: 3rem;\n margin: 0 0 1rem 0;\n text-transform: uppercase;\n letter-spacing: 2px;\n }\n\n p {\n font-size: 1.2rem;\n margin-bottom: 2rem;\n color: #ccc;\n }\n\n button {\n background-color: var(--fg-color);\n color: var(--bg-color);\n border: none;\n padding: 1rem 3rem;\n font-size: 1.5rem;\n font-weight: bold;\n border-radius: 50px;\n cursor: pointer;\n transition: transform 0.1s, background-color 0.2s;\n font-family: var(--font-main);\n }\n\n button:hover {\n background-color: var(--accent-color);\n color: white;\n }\n\n button:active {\n transform: scale(0.95);\n }\n\n /* Indicateur de contrôle tactile */\n .touch-hint {\n position: absolute;\n bottom: 20px;\n width: 100%;\n text-align: center;\n opacity: 0.5;\n font-size: 0.9rem;\n pointer-events: none;\n }\n\n </style>\n</head>\n<body>\n\n <div id=\"game-container\">\n <canvas id=\"pongCanvas\"></canvas>\n \n <div class=\"score-board\">\n <span id=\"scorePlayer\">0</span>\n <span id=\"scoreAI\">0</span>\n </div>\n\n <div id=\"startScreen\" class=\"ui-layer\">\n <div class=\"message\">\n <h1>Pong</h1>\n <p>Touchez l'écran pour jouer</p>\n <button id=\"startBtn\">JOUER</button>\n </div>\n <div class=\"touch-hint\">Glissez verticalement pour bouger</div>\n </div>\n\n <div id=\"gameOverScreen\" class=\"ui-layer hidden\">\n <div class=\"message\">\n <h1 id=\"winnerText\">Gagné !</h1>\n <p id=\"finalScore\">5 - 3</p>\n <button id=\"restartBtn\">REJOUER</button>\n </div>\n </div>\n </div>\n\n <script>\n // Configuration\n const canvas = document.getElementById('pongCanvas');\n const ctx = canvas.getContext('2d');\n const scorePlayerEl = document.getElementById('scorePlayer');\n const scoreAIEl = document.getElementById('scoreAI');\n const startScreen = document.getElementById('startScreen');\n const gameOverScreen = document.getElementById('gameOverScreen');\n const winnerText = document.getElementById('winnerText');\n const finalScoreText = document.getElementById('finalScore');\n const startBtn = document.getElementById('startBtn');\n const restartBtn = document.getElementById('restartBtn');\n\n // État du jeu\n let gameState = 'MENU'; // MENU, PLAYING, GAMEOVER\n let animationId;\n \n // Dimensions logiques (pour garder un ratio cohérent)\n const GAME_WIDTH = 800;\n const GAME_HEIGHT = 600;\n let scaleRatio = 1;\n\n // Objets du jeu\n const paddleWidth = 15;\n const paddleHeight = 100;\n const ballSize = 12;\n const winScore = 5;\n\n const player = {\n x: 20,\n y: GAME_HEIGHT / 2 - paddleHeight / 2,\n width: paddleWidth,\n height: paddleHeight,\n color: '#f0f0f0',\n score: 0\n };\n\n const ai = {\n x: GAME_WIDTH - 20 - paddleWidth,\n y: GAME_HEIGHT / 2 - paddleHeight / 2,\n width: paddleWidth,\n height: paddleHeight,\n color: '#f0f0f0',\n score: 0,\n speed: 6\n };\n\n const ball = {\n x: GAME_WIDTH / 2,\n y: GAME_HEIGHT / 2,\n radius: ballSize,\n speed: 8,\n dx: 5,\n dy: 5,\n color: '#f0f0f0'\n };\n\n // Initialisation\n function resize() {\n // Calculer le ratio pour que le canvas tienne dans l'écran tout en gardant le ratio 4:3\n const windowRatio = window.innerWidth / window.innerHeight;\n const gameRatio = GAME_WIDTH / GAME_HEIGHT;\n\n let finalWidth, finalHeight;\n\n if (windowRatio > gameRatio) {\n finalHeight = window.innerHeight;\n finalWidth = finalHeight * gameRatio;\n } else {\n finalWidth = window.innerWidth;\n finalHeight = finalWidth / gameRatio;\n }\n\n canvas.width = GAME_WIDTH;\n canvas.height = GAME_HEIGHT;\n \n // CSS pour l'affichage\n canvas.style.width = `${finalWidth}px`;\n canvas.style.height = `${finalHeight}px`;\n\n scaleRatio = finalWidth / GAME_WIDTH;\n }\n\n window.addEventListener('resize', resize);\n resize();\n\n // Contrôles\n let targetY = GAME_HEIGHT / 2;\n\n function handleInput(y) {\n // Convertir la position de la souris/doigt en coordonnées jeu\n const rect = canvas.getBoundingClientRect();\n const scaleY = GAME_HEIGHT / rect.height;\n const relativeY = (y - rect.top) * scaleY;\n \n targetY = relativeY - paddleHeight / 2;\n }\n\n // Souris\n document.addEventListener('mousemove', (e) => {\n if (gameState === 'PLAYING') {\n handleInput(e.clientY);\n }\n });\n\n // Tactile\n document.addEventListener('touchmove', (e) => {\n if (gameState === 'PLAYING') {\n e.preventDefault(); // Empêcher le scroll\n handleInput(e.touches[0].clientY);\n }\n }, { passive: false });\n\n document.addEventListener('touchstart', (e) => {\n if (gameState === 'PLAYING') {\n handleInput(e.touches[0].clientY);\n }\n }, { passive: false });\n\n // Logique du jeu\n function resetBall() {\n ball.x = GAME_WIDTH / 2;\n ball.y = GAME_HEIGHT / 2;\n ball.speed = 8;\n // Direction aléatoire\n ball.dx = (Math.random() > 0.5 ? 1 : -1) * ball.speed;\n ball.dy = (Math.random() * 2 - 1) * ball.speed;\n }\n\n function update() {\n if (gameState !== 'PLAYING') return;\n\n // Mouvement Joueur (Lerp pour fluidité)\n player.y += (targetY - player.y) * 0.2;\n\n // Limites Joueur\n if (player.y < 0) player.y = 0;\n if (player.y + player.height > GAME_HEIGHT) player.y = GAME_HEIGHT - player.height;\n\n // Mouvement IA (Simple suivi avec retard)\n const aiCenter = ai.y + ai.height / 2;\n if (aiCenter < ball.y - 10) {\n ai.y += ai.speed;\n } else if (aiCenter > ball.y + 10) {\n ai.y -= ai.speed;\n }\n // Limites IA\n if (ai.y < 0) ai.y = 0;\n if (ai.y + ai.height > GAME_HEIGHT) ai.y = GAME_HEIGHT - ai.height;\n\n // Mouvement Balle\n ball.x += ball.dx;\n ball.y += ball.dy;\n\n // Collisions Murs (Haut/Bas)\n if (ball.y - ball.radius < 0 || ball.y + ball.radius > GAME_HEIGHT) {\n ball.dy *= -1;\n }\n\n // Collisions Raquettes\n // Joueur\n if (ball.x - ball.radius < player.x + player.width && \n ball.y > player.y && \n ball.y < player.y + player.height) {\n \n // Renvoyer\n ball.dx = Math.abs(ball.dx); // Force vers la droite\n \n // Ajouter de l'effet (angle) selon l'impact\n let collidePoint = ball.y - (player.y + player.height/2);\n collidePoint = collidePoint / (player.height/2);\n ball.dy = collidePoint * 10;\n \n // Accélérer légèrement\n increaseSpeed();\n }\n\n // IA\n if (ball.x + ball.radius > ai.x && \n ball.y > ai.y && \n ball.y < ai.y + ai.height) {\n \n ball.dx = -Math.abs(ball.dx); // Force vers la gauche\n \n let collidePoint = ball.y - (ai.y + ai.height/2);\n collidePoint = collidePoint / (ai.height/2);\n ball.dy = collidePoint * 10;\n\n increaseSpeed();\n }\n\n // Points\n if (ball.x < 0) {\n ai.score++;\n scoreAIEl.textContent = ai.score;\n checkWin();\n resetBall();\n } else if (ball.x > GAME_WIDTH) {\n player.score++;\n scorePlayerEl.textContent = player.score;\n checkWin();\n resetBall();\n }\n }\n\n function increaseSpeed() {\n if (ball.speed < 18) {\n ball.speed += 0.5;\n // Normaliser le vecteur vitesse\n const angle = Math.atan2(ball.dy, ball.dx);\n ball.dx = Math.cos(angle) * ball.speed;\n ball.dy = Math.sin(angle) * ball.speed;\n }\n }\n\n function checkWin() {\n if (player.score >= winScore || ai.score >= winScore) {\n endGame(player.score >= winScore);\n }\n }\n\n function draw() {\n // Fond\n ctx.fillStyle = '#000';\n ctx.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\n\n // Ligne médiane\n ctx.strokeStyle = '#333';\n ctx.setLineDash([10, 15]);\n ctx.lineWidth = 4;\n ctx.beginPath();\n ctx.moveTo(GAME_WIDTH / 2, 0);\n ctx.lineTo(GAME_WIDTH / 2, GAME_HEIGHT);\n ctx.stroke();\n ctx.setLineDash([]);\n\n // Raquettes\n ctx.fillStyle = player.color;\n ctx.fillRect(player.x, player.y, player.width, player.height);\n \n ctx.fillStyle = ai.color;\n ctx.fillRect(ai.x, ai.y, ai.width, ai.height);\n\n // Balle\n ctx.fillStyle = ball.color;\n ctx.beginPath();\n ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2);\n ctx.fill();\n \n // Effet de lueur sur la balle\n ctx.shadowBlur = 15;\n ctx.shadowColor = ball.color;\n ctx.fill();\n ctx.shadowBlur = 0;\n }\n\n function gameLoop() {\n update();\n draw();\n animationId = requestAnimationFrame(gameLoop);\n }\n\n function startGame() {\n player.score = 0;\n ai.score = 0;\n scorePlayerEl.textContent = '0';\n scoreAIEl.textContent = '0';\n resetBall();\n \n gameState = 'PLAYING';\n startScreen.classList.add('hidden');\n gameOverScreen.classList.add('hidden');\n \n if (animationId) cancelAnimationFrame(animationId);\n gameLoop();\n }\n\n function endGame(playerWon) {\n gameState = 'GAMEOVER';\n winnerText.textContent = playerWon ? \"GAGNÉ !\" : \"PERDU...\";\n winnerText.style.color = playerWon ? \"#4cd964\" : \"#ff3b30\";\n finalScoreText.textContent = `${player.score} - ${ai.score}`;\n gameOverScreen.classList.remove('hidden');\n }\n\n // Événements UI\n startBtn.addEventListener('click', startGame);\n restartBtn.addEventListener('click', startGame);\n\n // Premier rendu (statique)\n draw();\n\n </script>\n\n<!-- VTB_SIG_v1 -->\n<style>\n#__vtb_badge{position:fixed;bottom:14px;right:14px;z-index:2147483646;display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:980px;background:rgba(255,255,255,.92);color:#1d1d1f;font-family:-apple-system,BlinkMacSystemFont,system-ui,sans-serif;font-size:11px;font-weight:500;text-decoration:none;box-shadow:0 2px 12px rgba(0,0,0,.12);backdrop-filter:blur(8px);border:1px solid rgba(0,0,0,.06);transition:opacity .2s}\n#__vtb_badge:hover{opacity:.85}\n#__vtb_badge b{color:#6e56cf;font-weight:600}\nhtml[dir=\"rtl\"] #__vtb_badge{right:auto;left:14px}\n@media print{#__vtb_badge{display:none}}\n</style>\n<a id=\"__vtb_badge\" href=\"https://voxtobox.com\" target=\"_blank\" rel=\"noopener\">Cree avec <b>VoxToBox</b> beta</a>\n</body>\n</html>",
752
+ "model": "GLM 4.7",
753
+ "category": "autre",
754
+ "author": "Bg",
755
+ "shared": true,
756
+ "count": 1,
757
+ "created": 1783754023,
758
+ "last_seen": 1783754023,
759
+ "signals": {
760
+ "present_total": 0,
761
+ "present_count": 0,
762
+ "downloads": 0,
763
+ "repeats": 0,
764
+ "modifies": 0,
765
+ "visits": 0
766
+ },
767
+ "edits": [],
768
+ "shared_at": 1783754026,
769
+ "owner": "bg"
770
  }
771
  }