Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Infobox style improvements

Russ Garrett7f2d0f6f6835
diff --git a/web/src/infopopup.css b/web/src/infopopup.css
index f9f0470..4c5551d 100644
--- a/web/src/infopopup.css
+++ b/web/src/infopopup.css
@@ -13,15 +13,15 @@
}
.oim-info .nameContainer {
+ border-radius: 4px 4px 0 0;
background-color: #d5ecec;
- padding: 0.5em 1.3em 0.2em 0.5em;
+ padding: 0.5em 1.3em 0.5em 0.5em;
margin: 0 -0.5em 0.5em -0.5em;
}
.oim-info h3 {
font-size: 1.3em;
- margin-top: 0px;
- margin-bottom: 5px;
+ margin: 0;
}
.oim-info h3 img {
@@ -31,18 +31,10 @@
margin-right: 0.3em;
}
-.oim-info h4::before {
- content: '(';
-}
-
-.oim-info h4::after {
- content: ')';
-}
-
.oim-info h4 {
font-weight: normal;
- margin-top: 0px;
- margin-bottom: 0px;
+ color: rgb(80, 80, 80);
+ margin: 0.1em 0 0 0;
}
table.item_info {
@@ -110,15 +102,17 @@ div.ext_link {
display: block;
height: 30px;
width: 30px;
- padding: 2px;
+ padding: 1px;
background-size: 30px 30px;
background-repeat: no-repeat;
background-position: center;
border-radius: 0.5em;
+ border: 1px transparent solid;
}
div.ext_link:hover {
background-color: #eee;
+ border: 1px solid #ddd;
}
span.voltages {
diff --git a/web/src/infopopup.ts b/web/src/infopopup.ts
index bf99daa..bc9a21c 100644
--- a/web/src/infopopup.ts
+++ b/web/src/infopopup.ts
@@ -366,7 +366,7 @@ class InfoPopup {
.addClassName('oim-info')
}
- fetch_wikidata(id: string, container: RedomElement, links_container: RedomElement) {
+ fetch_wikidata(id: string, imageContainer: RedomElement, linksContainer: RedomElement) {
fetch(`https://openinframap.org/wikidata/${id}`)
.then((response) => {
return response.json()
@@ -374,7 +374,7 @@ class InfoPopup {
.then((data) => {
if (data['thumbnail']) {
mount(
- container,
+ imageContainer,
el(
'a',
el('img.wikidata_image', {
@@ -391,7 +391,7 @@ class InfoPopup {
for (const lang of [i18next.language.split('-')[0], 'en']) {
if (data['sitelinks'][`${lang}wiki`]) {
mount(
- links_container,
+ linksContainer,
el('a', el('div.ext_link.wikipedia_link'), {
href: data['sitelinks'][`${lang}wiki`]['url'],
target: '_blank',
@@ -404,7 +404,7 @@ class InfoPopup {
if (data['sitelinks']['commonswiki']) {
mount(
- links_container,
+ linksContainer,
el('a', el('div.ext_link.commons_link'), {
href: data['sitelinks']['commonswiki']['url'],
target: '_blank',
@@ -414,7 +414,7 @@ class InfoPopup {
}
mount(
- links_container,
+ linksContainer,
el('a', el('div.ext_link.wikidata_link'), {
href: `https://wikidata.org/wiki/${id}`,
target: '_blank',