Skip to content

Commit

Permalink
Add color to city circle
Browse files Browse the repository at this point in the history
  • Loading branch information
popunbom committed Dec 4, 2024
1 parent 586d645 commit dcb7533
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions frontend/app/components/modules/map/map-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Town = {
name: string;
image: Image;
centerCoordinate: Coordinate;
color: string;
};

const CityObjectImages = [
Expand Down Expand Up @@ -56,10 +57,12 @@ export const TownList = [
name: "チェアタウン",
centerCoordinate: { latitude: 0, longitude: 0 },
image: { src: "/images/town.svg", width: 500, height: 500 },
color: "emerald",
},
{
name: "コシカケシティ",
centerCoordinate: { latitude: 300, longitude: 300 },
image: { src: "/images/town.svg", width: 500, height: 500 },
color: "amber",
},
] satisfies Town[];
6 changes: 3 additions & 3 deletions frontend/app/components/modules/map/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const ChairLayer: FC<{
const TownLayer = memo(function TownLayer() {
return (
<div className="flex w-full h-full absolute top-0 left-0 select-none">
{TownList.map(({ centerCoordinate, name, image }) => {
{TownList.map(({ centerCoordinate, name, image, color }) => {
const pos = coordinateToPos(centerCoordinate);
return (
<div
Expand All @@ -282,7 +282,7 @@ const TownLayer = memo(function TownLayer() {
>
<div
role="presentation"
className="absolute rounded-full bg-neutral-100 bg-opacity-40 border-2 border-neutral-200"
className={`absolute rounded-full bg-neutral-300 bg-opacity-40 border-4 border-${color}-500`}
style={{
width: image.width + 20,
height: image.width + 20,
Expand All @@ -300,7 +300,7 @@ const TownLayer = memo(function TownLayer() {
<div className="absolute bottom-[-54px] w-full text-center">
<Text
tagName="span"
className="px-3 py-1 bg-neutral-400 text-white rounded-md"
className={`px-3 py-1 bg-${color}-600 text-white rounded-md`}
size="sm"
>
{name}
Expand Down
1 change: 1 addition & 0 deletions frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import type { Config } from "tailwindcss";
export default {
content: ["./app/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}"],
plugins: [],
safelist: [{ pattern: /bg-.+-[56]00/ }, { pattern: /border-.+-500/ }],
} satisfies Config;

0 comments on commit dcb7533

Please sign in to comment.