Skip to content

Commit 3ae9746

Browse files
committed
Add brands (SolBar) with placeholder image
1 parent 57a4c0d commit 3ae9746

3 files changed

Lines changed: 92 additions & 30 deletions

File tree

src/brands.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,75 @@
3131
- name: RaiYodDoy
3232
image: /images/raiyoddoy.jpg
3333
province: cmi
34+
- name: Shan
35+
name_th: ฉาน
36+
image: /images/placeholder.png
37+
province: pre
38+
- name: Lung Nid ลุงนิด
39+
name_th: ลุงนิด
40+
image: /images/placeholder.png
41+
province: cri
42+
- name: Ozzo
43+
name_th: อ๊ดโซ๊ะ
44+
image: /images/placeholder.png
45+
province: lpn
46+
- name: Kirikhan
47+
name_th: คีรีขาล
48+
image: /images/placeholder.png
49+
province: pyo
50+
- name: สุราขาวม้าแก้วมังกร
51+
name_th:
52+
image: /images/placeholder.png
53+
province: utd
54+
- name: Mor
55+
name_th: เหม๊าะ
56+
image: /images/placeholder.png
57+
province: nan
58+
- name: MORKA
59+
name_th:
60+
image: /images/placeholder.png
61+
province: nan
62+
- name: Zebra Road
63+
name_th: ทางม้าลาย
64+
image: /images/placeholder.png
65+
province: cmi
66+
- name: Assa Dong
67+
name_th:
68+
image: /images/placeholder.png
69+
province: nan
70+
- name: Hopster Spirits
71+
name_th:
72+
image: /images/placeholder.png
73+
province: cri
74+
- name: Chaeson
75+
name_th: แจ้ซ้อน
76+
image: /images/placeholder.png
77+
province: lpg
78+
- name: Kosapan
79+
name_th: โกษาปาน
80+
image: /images/placeholder.png
81+
province: nbi
82+
- name: Summer Beach
83+
name_th:
84+
image: /images/placeholder.png
85+
province: cbi
86+
- name: White Shark
87+
name_th: ฉลามขาว
88+
image: /images/placeholder.png
89+
province: cbi
90+
- name: Sangvein
91+
name_th: สังเวียน
92+
image: /images/placeholder.png
93+
province: spb
94+
- name: Sod Chaeng
95+
name_th: ซอดแจ้ง
96+
image: /images/placeholder.png
97+
province: ubn
98+
- name: Onson
99+
name_th: ออนซอน
100+
image: /images/placeholder.png
101+
province: snk
102+
- name: Granmonte
103+
name_th:
104+
image: /images/placeholder.png
105+
province: ubn

src/components/Map.svelte

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -143,41 +143,31 @@
143143
.on('tick', simulationUpdate);
144144
145145
panzoomInstance = panzoom(svg, {
146-
onClick: (e) => {
147-
e.preventDefault();
148-
149-
// Handle only path elements
150-
151-
const el = e.target as SVGPathElement;
152-
153-
if (el.tagName !== 'path') return;
154-
155-
// alert(`You clicked: ${el.getAttribute('name')}`);
156-
157-
// const bounds = el.getBoundingClientRect();
158-
const bounds = el.getBBox();
159-
160-
const midX = bounds.x + bounds.width / 2;
161-
const midY = bounds.y + bounds.height / 2;
162-
163-
console.log(midX, midY);
164-
}
146+
// onClick: (e) => {
147+
// e.preventDefault();
148+
// // Handle only path elements
149+
// const el = e.target as SVGPathElement;
150+
// if (el.tagName !== 'path') return;
151+
// // const bounds = el.getBBox();
152+
// // const midX = bounds.x + bounds.width / 2;
153+
// // const midY = bounds.y + bounds.height / 2;
154+
// // console.log(midX, midY);
155+
// }
165156
});
166157
167-
console.log(imgEl);
168-
let data: Record<string, { x: number; y: number }> = {};
169-
document.querySelectorAll<SVGPathElement>('#map path').forEach((path) => {
170-
// Get middle point of each path
171-
const bounds = path.getBBox();
172-
const midX = bounds.x + bounds.width / 2;
173-
const midY = bounds.y + bounds.height / 2;
158+
// let data: Record<string, { x: number; y: number }> = {};
159+
// document.querySelectorAll<SVGPathElement>('#map path').forEach((path) => {
160+
// // Get middle point of each path
161+
// const bounds = path.getBBox();
162+
// const midX = bounds.x + bounds.width / 2;
163+
// const midY = bounds.y + bounds.height / 2;
174164
175-
console.log(path.getAttribute('name'), midX, midY);
165+
// console.log(path.getAttribute('name'), midX, midY);
176166
177-
// data[path.getAttribute('id')!] = { x: midX, y: midY, w: bounds.width, h: bounds.height };
178-
});
167+
// // data[path.getAttribute('id')!] = { x: midX, y: midY, w: bounds.width, h: bounds.height };
168+
// });
179169
180-
console.log({ data });
170+
// console.log({ data });
181171
182172
setTimeout(() => {
183173
simulation.stop();

static/images/placeholder.png

999 Bytes
Loading

0 commit comments

Comments
 (0)