Skip to content

Commit

Permalink
告一段落
Browse files Browse the repository at this point in the history
  • Loading branch information
hesic73 committed May 2, 2024
1 parent 92e55c3 commit 4da65a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# 2048
# [2048](https://hesic73.github.io/2048/)

React + Tailwind CSS

## Features

## TODO
- Auto Saving
- Animations for tile movement, spawning, and when you score
- Support for keyboard navigation and swiping on mobile devices

- 成功失败显示

## Limitations

- cannot handle overlapping score addition animations correctly (or maybe I can).

## Reference

Expand Down
14 changes: 13 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,19 @@ function App() {
<div className='flex flex-col min-h-screen bg-background_color'>
<div className="flex-1 mx-auto w-72 xl:w-[28rem]">
<Header score={score} bestScore={bestScore} OnNewGame={reset}></Header>
<Board tiles={tiles}></Board>
<div className={`relative ${gameState !== GameState.IN_PROGRESS ? 'opacity-50' : ''}`}>
<Board tiles={tiles} />
{gameState === GameState.FAILED && (
<div className="absolute inset-0 flex justify-center items-center">
<span className="text-[#776e65] font-bold text-5xl xl:text-7xl z-20">FAILURE</span>
</div>
)}
{gameState === GameState.WIN && (
<div className="absolute inset-0 flex justify-center items-center">
<span className="text-[#776e65] font-bold text-5xl xl:text-7xl z-20">WINNING</span>
</div>
)}
</div>
</div>
</div>
</MobileSwiper>
Expand Down

0 comments on commit 4da65a1

Please sign in to comment.