MCPcopy Create free account
hub / github.com/ImGoodBai/MapGoGoGo / cellStyle

Function cellStyle

frontend/src/maps.tsx:99–134  ·  view source on GitHub ↗
(
  cellId: string,
  unlocked: Set<string>,
  mine: Set<string>,
  currentCellId?: string | null
)

Source from the content-addressed store, hash-verified

97}
98
99function cellStyle(
100 cellId: string,
101 unlocked: Set<string>,
102 mine: Set<string>,
103 currentCellId?: string | null
104) {
105 const currentCell = currentCellId === cellId;
106 if (mine.has(cellId)) {
107 return {
108 fillColor: "#f59e0b",
109 fillOpacity: currentCell ? 0.56 : 0.44,
110 strokeColor: "#2563eb",
111 strokeOpacity: currentCell ? 0.78 : 0.14,
112 strokeWeight: currentCell ? 2 : 0.6,
113 zIndex: currentCell ? 50 : 32,
114 };
115 }
116 if (unlocked.has(cellId)) {
117 return {
118 fillColor: "#f59e0b",
119 fillOpacity: currentCell ? 0.54 : 0.4,
120 strokeColor: "#2563eb",
121 strokeOpacity: currentCell ? 0.78 : 0.12,
122 strokeWeight: currentCell ? 2 : 0.5,
123 zIndex: currentCell ? 50 : 28,
124 };
125 }
126 return {
127 fillColor: "#173f36",
128 fillOpacity: 0.22,
129 strokeColor: currentCell ? "#2563eb" : "#173f36",
130 strokeOpacity: currentCell ? 0.72 : 0,
131 strokeWeight: currentCell ? 2 : 0,
132 zIndex: currentCell ? 50 : 20,
133 };
134}
135
136function normalizeRotation(value = 0) {
137 return ((value % 360) + 360) % 360;

Callers 1

AmapViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected