Skip to content

Commit

Permalink
use border
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Oct 19, 2024
1 parent ed3c9ef commit 16a3a9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
7 changes: 2 additions & 5 deletions app/play/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,12 @@ export default function PlayPage() {
className={cn(
"flex flex-col h-full relative",
resMap.get(map._id)
? "bg-green-500"
? "border-green-500"
: resMap.has(map._id)
? "bg-red-500"
? "border-red-500"
: "",
)}
>
{resMap.get(map._id) && (
<StarFilledIcon className="absolute top-3 right-3 w-9 h-9 -rotate-45 text-yellow-500" />
)}
<CardHeader>
<CardTitle className="text-xl font-semibold text-center">
Night #{map.level}
Expand Down
29 changes: 17 additions & 12 deletions components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export function getCellImage(cell: string) {
alt="Zombie"
className="w-full h-full"
style={{
width: '100%',
height: '100%',
position: 'relative',
top: '-20px',
left: '4px',
width: "100%",
height: "100%",
position: "relative",
top: "-20px",
left: "4px",
}}
/>
);
Expand All @@ -24,9 +24,9 @@ export function getCellImage(cell: string) {
alt="Player"
className="w-full h-full"
style={{
position: 'relative',
top: '-20px',
left: '4px',
position: "relative",
top: "-20px",
left: "4px",
}}
/>
);
Expand All @@ -43,9 +43,9 @@ export function getCellImage(cell: string) {
alt="Block"
className="w-full h-full"
style={{
position: 'relative',
top: '0px',
left: '0px',
position: "relative",
top: "0px",
left: "0px",
}}
/>
);
Expand All @@ -55,7 +55,12 @@ export function getCellImage(cell: string) {

export function Map({ map, size = 64 }: { map: string[][]; size?: number }) {
return (
<div className="relative" style={{ backgroundImage: 'url(/map_tiles.svg)', backgroundSize: '128px', backgroundPosition: 'bottom left' }}>
<div className="relative">
<img
src="/map.png"
alt="Background Map"
className="absolute inset-0 w-full h-full object-cover opacity-50"
/>
<div className="relative z-10 test">
{map.map((row, y) => (
<div key={y} className="flex">
Expand Down

0 comments on commit 16a3a9e

Please sign in to comment.