Skip to content

Commit

Permalink
update city and building replace
Browse files Browse the repository at this point in the history
  • Loading branch information
timcheng78 committed Jan 25, 2025
1 parent 9f8807e commit a369bde
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 26 deletions.
11 changes: 11 additions & 0 deletions src/view/Building.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @jsxImportSource hono/jsx */

import { FC } from "hono/jsx";

export const Building: FC = ({ className, src, title }) => {
return (
<div>
<img class={className} src={src} alt={title} />
</div>
);
};
63 changes: 37 additions & 26 deletions src/view/City.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,77 @@ import { FC } from "hono/jsx";

import { type CitySnapshot } from "@usecase/CitySnapshotUsecase";
import { Layout } from "./Layout";
import { css, cx } from 'hono/css'
import { Building } from "./Building";
import { css, cx } from "hono/css";

const pRelative = css`
position: relative;
`
`;

const pAbsolute = css`
position: absolute;
`
`;

const container = css`
display: flex;
width: 768px;
`
`;

const shell = css`
bottom: 33%;
left: 40%;
`
`;

const factory = css`
bottom: 46%;
left: 7%;
`
left: 7%;
`;

const hospital = css`
bottom: 46%;
right: 5%;
`
`;

const office = css`
bottom: 35%;
left: 0%;
`
`;

const people = css`
bottom: 34%;
right: 0%;
`
`;

export const City: FC<CitySnapshot> = ({ id }) => {
return (
<Layout>
<div class={cx(container, pRelative)}>
<img src="/bg.png" alt="mainCity"/>
<div class={cx(pAbsolute, shell)}>
<img src="/shell_0.png" alt="shell" />
</div>
<div class={cx(pAbsolute, factory)}>
<img src="/factory_0.png" alt="factory" />
</div>
<div class={cx(pAbsolute, hospital)}>
<img src="/hospital_0.png" alt="hospital" />
</div>
<div class={cx(pAbsolute, office)}>
<img src="/office_0.png" alt="office" />
</div>
<div class={cx(pAbsolute, people)}>
<img src="/people_0.png" alt="people" />
</div>
<img src="/bg.png" alt="baseCity" />
<Building
className={cx(pAbsolute, shell)}
src="/shell_0.png"
title="shell"
/>
<Building
className={cx(pAbsolute, factory)}
src="/factory_0.png"
title="factory"
/>
<Building
className={cx(pAbsolute, hospital)}
src="/hospital_0.png"
title="hospital"
/>
<Building
className={cx(pAbsolute, office)}
src="/office_0.png"
title="office"
/>
<Building
className={cx(pAbsolute, people)}
src="/people_0.png"
title="people"
/>
</div>
</Layout>
);
Expand Down

0 comments on commit a369bde

Please sign in to comment.