mirror of
https://github.com/MrEidam/PetPet.git
synced 2026-04-17 15:43:31 +00:00
Emm 2048 RESET
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"liveServer.settings.port": 5501
|
||||
}
|
||||
@@ -9,9 +9,9 @@
|
||||
<title>2048</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>2048</h1>
|
||||
<h2>Score: <span id="score">0</span></h2>
|
||||
<h1>Score: <span id="score">0</span></h1>
|
||||
<div id="board"></div>
|
||||
<button id="reset" onclick="reset()"></button>
|
||||
<a href="../" id="home"></a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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();*/
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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: '';
|
||||
|
||||
Reference in New Issue
Block a user