From 0bfe2d76a87ad218d5650dd44450568607a249c7 Mon Sep 17 00:00:00 2001 From: MrEidam Date: Wed, 28 Aug 2024 01:42:35 +0200 Subject: [PATCH] Emm 2048 RESET --- .gitignore | 0 .vscode/settings.json | 3 --- Games/2048/index.html | 4 ++-- Games/2048/main.js | 19 +++++++++++++++++-- Games/2048/style.css | 12 +++++++++++- Games/style.css | 1 + 6 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .gitignore delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 6f3a291..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "liveServer.settings.port": 5501 -} \ No newline at end of file diff --git a/Games/2048/index.html b/Games/2048/index.html index aa5bc59..ea28277 100644 --- a/Games/2048/index.html +++ b/Games/2048/index.html @@ -9,9 +9,9 @@ 2048 -

2048

-

Score: 0

+

Score: 0

+ \ No newline at end of file diff --git a/Games/2048/main.js b/Games/2048/main.js index 9f8c272..2666427 100644 --- a/Games/2048/main.js +++ b/Games/2048/main.js @@ -1,7 +1,13 @@ var board; +const newBoard = [ + [0,0,0,0], + [0,0,0,0], + [0,0,0,0], + [0,0,0,0], +]; var score = 0; -var rows = 4; -var columns = 4; +const rows = 4; +const columns = 4; let startX, startY, endX, endY; window.onload = function(){ @@ -216,4 +222,13 @@ function handleSwipe(){ document.getElementById("score").innerText = score; } } +} +async function reset(){ + document.getElementById("board").innerHTML = ''; + setGame(); + score = 0; + document.querySelector('#score').innerText = '0'; + /*board = newBoard; + setTwo(); + setTwo();*/ } \ No newline at end of file diff --git a/Games/2048/style.css b/Games/2048/style.css index c245568..23e10f5 100644 --- a/Games/2048/style.css +++ b/Games/2048/style.css @@ -29,6 +29,17 @@ body{ background: #555; } +#reset{ + position: fixed; + left: 0; + bottom: 0; + height: 50px; + width: 50px; + border-radius: 0 25px 0 0; + background: #d55; + border: none; +} + #board{ width: 372px; height: 372px; @@ -36,7 +47,6 @@ body{ background: #cdc1d5; border: 6px solid #bbada0; - margin: 0 auto; display: flex; flex-wrap: wrap; } diff --git a/Games/style.css b/Games/style.css index c2354a5..890c6fa 100644 --- a/Games/style.css +++ b/Games/style.css @@ -28,6 +28,7 @@ body{ pointer-events: none; clip-path: polygon(48% 2%, 60% 18%, 77% 10%, 86% 14%, 91% 30%, 82% 36%, 73% 41%, 81% 51%, 90% 55%, 94% 63%, 95% 82%, 94% 86%, 81% 94%, 65% 90%, 55% 82%, 45% 85%, 25% 100%, 23% 100%, 5% 92%, 1% 82%, 0% 70%, 6% 68%, 14% 61%, 19% 60%, 25% 61%, 29% 53%, 23% 48%, 12% 48%, 6% 34%, 6% 20%, 8% 12%, 16% 5%, 22% 13%, 26% 18%, 30% 13%, 34% 6%, 40% 3%); animation: rgb 5s linear infinite; + transition: .15s; } #blob::before{ content: '';