Skip to content

Commit

Permalink
fix github pages relative path problem
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyijie committed Nov 8, 2023
1 parent d041b0f commit 8e92079
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Context from '@/components/Context'
import Board from '@/components/Board'
import { fallDownTetromino, moveDownTetromino, moveLeftTetromino, moveRightTetromino, predictTetromino, randomTetromino, rotateTetromino } from '@/lib/tetris'
import Info from '@/components/Info'
import Head from 'next/head'

var audio

Expand All @@ -22,7 +23,7 @@ export default function () {
mainRef.current.focus()

if (!audio) {
audio = new Audio('/tetris.mp3')
audio = new Audio('tetris.mp3')
}

let clear
Expand Down Expand Up @@ -133,6 +134,10 @@ export default function () {

return (
<Context.Provider value={{ currentTetromino, predictedTetromino, nextTetromino, tetrominoes, newGame, time, fallDown, rotate, down, left, right, next, gameOver, setGameOver, score, eliminatedLines }}>
<Head>
<title>Tetris</title>
<link rel="icon" type="image/x-icon" href="favicon.ico"></link>
</Head>
<main ref={mainRef} className='w-full h-screen focus:outline-none flex gap-8 items-center justify-center' tabIndex={1} onKeyDown={onKeyDown}>
<Operation />
<Board />
Expand Down

0 comments on commit 8e92079

Please sign in to comment.