Skip to content

Commit 1347639

Browse files
committed
style: show selected region
1 parent b221bfc commit 1347639

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
}
4545
.region {
4646
padding: 0.5rem;
47+
transition: color 0.2s;
48+
}
49+
.region-selected {
50+
color: #2060ae;
4751
}
4852
</style>
4953
</head>

index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ function fillRegions(filter: string | null) {
4949
el.append(document.createTextNode(reg.region.data.name))
5050
el.classList.add('region')
5151
el.onclick = () => {
52+
for(const other of document.querySelectorAll('.region-selected')) {
53+
other.classList.remove('region-selected')
54+
}
55+
el.classList.add('region-selected')
5256
showRegion(reg.key, reg.region)
5357
}
5458
regionsEl.append(el)

0 commit comments

Comments
 (0)