add tower builing game
This commit is contained in:
@@ -73,6 +73,36 @@ const GamePage: FC = () => {
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div
|
||||
style={{ direction: 'ltr' }}
|
||||
className='bg-white shadow-sm rounded-[10px] p-2 flex justify-between items-center cursor-pointer'
|
||||
onClick={() => {
|
||||
const currentPath = window.location.pathname
|
||||
const basePath = currentPath.split('/game')[0]
|
||||
router.push(`${basePath}/game/tower-builder`)
|
||||
}}
|
||||
>
|
||||
<div className='flex gap-3 items-center'>
|
||||
<Image
|
||||
src='/assets/images/tower_building_logo.webp'
|
||||
alt='Tower Builder'
|
||||
width={80}
|
||||
height={80}
|
||||
className='size-[80px] object-cover'
|
||||
/>
|
||||
|
||||
<div className='text-sm font-bold max-w-[92px]'>
|
||||
Tower Builder
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='h-8 bg-[#F2F2F2] rounded-lg px-3 flex gap-1 items-center justify-center'>
|
||||
<div className='text-xs'>اجرا کنید</div>
|
||||
<Play size='20' color='currentColor' />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
'use client'
|
||||
import { type FC, type ReactNode } from 'react'
|
||||
|
||||
interface TowerBuilderLayoutProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
const TowerBuilderLayout: FC<TowerBuilderLayoutProps> = ({ children }) => {
|
||||
return (
|
||||
<div className='h-screen w-full p-0 m-0'>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default TowerBuilderLayout
|
||||
@@ -0,0 +1,27 @@
|
||||
'use client'
|
||||
import { type FC } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { CloseCircle } from 'iconsax-react'
|
||||
|
||||
const TowerBuilderPage: FC = () => {
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<div className='fixed inset-0 w-full h-full p-0 m-0 flex items-center justify-center bg-white'>
|
||||
<button
|
||||
onClick={() => router.back()}
|
||||
className='absolute top-4 left-4 z-50 bg-white rounded-full shadow-lg p-1 hover:bg-gray-100 transition-colors'
|
||||
aria-label='بستن'
|
||||
>
|
||||
<CloseCircle size='32' color='#000' variant='Bold' />
|
||||
</button>
|
||||
<iframe
|
||||
src='/tower_game-master/index.html'
|
||||
className='w-full h-full border-0'
|
||||
title='Tower Builder Game'
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default TowerBuilderPage
|
||||
Reference in New Issue
Block a user