Skip to content

Commit

Permalink
o
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelDav943 committed Oct 4, 2023
1 parent 9daea13 commit b9302f5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.cards {
display: flex;
flex-wrap: wrap;

justify-content: center;
align-items: center;

Expand All @@ -28,9 +28,12 @@
border-radius: 0.1em;
}

.card .front {
.card .front {
transform: rotateY(0deg);
background-color: powderblue;
/*background-color: powderblue;*/
background-image: url('./src/assets/base.png');
background-size: contain;
color: white;
display: flex;
justify-content: center;
align-items: center;
Expand Down
7 changes: 4 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function App() {
card.classList.add("show")
return
}


if (last.card == card) return;

card.classList.add("show")
if (last.pair == pair) {
last.card.classList.add("correct")
Expand All @@ -46,7 +48,6 @@ function App() {
last = undefined
} else {
setTimeout(() => {
console.log("he")
card.classList.remove("show")
last.card.classList.remove("show")
last = undefined
Expand All @@ -64,7 +65,7 @@ function App() {
<div className='cards'>
{pairs.map((id,index) => (
<Card key={index} pair={id} onClick={spin}/>
))}
))}
</div>
</>
)
Expand Down
Binary file added src/assets/base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/assets/react.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Card.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useId } from 'react';

export default function(props) {

const current = useId()
const onClick = function(event) {
if (props.onClick) props.onClick(event, props.pair, current)
Expand Down

0 comments on commit b9302f5

Please sign in to comment.