Compare commits
2 Commits
3bc6bf39a6
...
ec6c46fe11
| Author | SHA1 | Date | |
|---|---|---|---|
| ec6c46fe11 | |||
| 8591a5aea9 |
@ -18,7 +18,6 @@ body {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 14px;
|
||||
|
||||
background: rgba(255, 255, 255, 0.45);
|
||||
border-bottom: 2px solid rgba(255, 255, 255, 0.6);
|
||||
backdrop-filter: blur(14px);
|
||||
@ -55,20 +54,20 @@ body {
|
||||
|
||||
box-shadow:
|
||||
0 3px 6px rgba(0,0,0,0.20),
|
||||
inset 0 0 6px rgba(255,255,255,0.6);
|
||||
inset 0 0 6px rgba(255,255,255,0.6);
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
|
||||
.gameboard {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 120px);
|
||||
gap: 18px;
|
||||
grid-template-columns: repeat(4, 100px); /* 4 kolom */
|
||||
grid-template-rows: repeat(3, 120px); /* 3 baris */
|
||||
justify-content: center;
|
||||
margin: 30px auto;
|
||||
gap: 15px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.card {
|
||||
@ -118,18 +117,15 @@ body {
|
||||
filter: drop-shadow(0 3px 4px rgba(0,0,0,0.45));
|
||||
}
|
||||
|
||||
/* HOVER EFFECT */
|
||||
.card:not(.flipped):hover .front {
|
||||
transform: scale(1.05);
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
/* FLIP ANIMATION */
|
||||
.card.flipped .inner {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
/* MATCHED GLOW */
|
||||
.card.matched .front,
|
||||
.card.matched .back {
|
||||
border-color: #7affd6;
|
||||
@ -140,7 +136,7 @@ body {
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.gameboard {
|
||||
grid-template-columns: repeat(4, 90px);
|
||||
grid-template-columns: repeat(3, 90px);
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
@ -153,9 +149,8 @@ body {
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<header class="topbar">
|
||||
<button class="back-btn" onclick="history.back()">←</button>
|
||||
<button class="back-btn" onclick="window.location.href='mainboard.html'">←</button>
|
||||
|
||||
<div class="right-info">
|
||||
<div class="pill"><span class="icon">⏱</span><span id="timer">60</span>s</div>
|
||||
@ -167,9 +162,14 @@ body {
|
||||
<div id="game-board" class="gameboard"></div>
|
||||
|
||||
<script>
|
||||
|
||||
const images = [
|
||||
"alpukat.jpg", "anggur.jpg", "apel.jpg", "buah naga.jpg", "jambu.jpg",
|
||||
"jeruk.jpg", "lemon.jpg", "nanas.jpg", "pisang.jpg", "semangka.jpg"
|
||||
"asset/alpukat.jpg",
|
||||
"asset/anggur.jpg",
|
||||
"asset/apel.jpg",
|
||||
"asset/buah naga.jpg",
|
||||
"asset/jambu.jpg",
|
||||
"asset/jeruk.jpg"
|
||||
];
|
||||
|
||||
let cards = [...images, ...images];
|
||||
@ -190,9 +190,6 @@ let moves = 0;
|
||||
let score = 0;
|
||||
let countdown;
|
||||
|
||||
/* ========================
|
||||
START TIMER
|
||||
======================== */
|
||||
function startTimer() {
|
||||
timerStarted = true;
|
||||
|
||||
@ -207,9 +204,6 @@ function startTimer() {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
/* ========================
|
||||
FLIP LOGIC
|
||||
======================== */
|
||||
function flipCard(card) {
|
||||
if (!timerStarted) startTimer();
|
||||
|
||||
@ -240,7 +234,6 @@ function flipCard(card) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function startGame() {
|
||||
const board = document.getElementById("game-board");
|
||||
board.innerHTML = "";
|
||||
@ -273,5 +266,6 @@ function startGame() {
|
||||
|
||||
startGame();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user