Skip to content

Commit

Permalink
Change title to Map of Japan
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbarbosa committed Dec 23, 2023
1 parent 7512806 commit 2f26844
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
12 changes: 12 additions & 0 deletions data/dict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const dict = {
japan: {
ja: ['日', '本'],
furigana: ['に', 'ほん'],
en: 'Japan',
},
mapOfJapan: {
ja: ['日', '本', 'の', '地', '図'],
furigana: ['に', 'ほん', '', 'ち', 'ず'],
en: 'Map of Japan',
}
}
10 changes: 8 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="ja">

<head>
<title>日本 (Japan)</title>
<title>日本の地図 (Map of Japan)</title>
<meta name="keywords" content="日本, 日本の地域, 都道府県, 地図, 北海道, 東北, 関東, 中部, 関西, 中国, 四国, 九州">
<meta name="description" content="地域、都道府県、東京都の市区町村を含む日本のインタラクティブな地図。">
<meta charset="UTF-8">
Expand All @@ -22,14 +22,20 @@ <h1>
<rtc>
<rt></rt>
<rt>ほん</rt>
<rt></rt>
<rt></rt>
<rt></rt>
</rtc>
<rbc>
<rb></rb>
<rb></rb>
<rb></rb>
<rb></rb>
<rb></rb>
</rbc>
</div>
<rtc class="annotation">
<rt xml:lang="en">Japan</rt>
<rt xml:lang="en">Map of Japan</rt>
</rtc>
</ruby>
</h1>
Expand Down
5 changes: 5 additions & 0 deletions js/info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { dict } from '../data/dict.js';
import { regions } from '../data/regions.js';
import { furigana } from './furigana.js';
import { extractPrefectures, replaceSpecialCharactersWithAscii } from './utils.js';
Expand All @@ -11,6 +12,7 @@ import { extractPrefectures, replaceSpecialCharactersWithAscii } from './utils.j
export function setInfo(type, data) {
const info = document.getElementById('info');
const infoSelected = document.getElementById('info-data');
const h1 = document.querySelector('#title h1');
const h2 = document.querySelector('#title h2');
const h2Pre = document.querySelector('.h2-pre');
const h3 = document.querySelector('#title h3');
Expand All @@ -25,6 +27,8 @@ export function setInfo(type, data) {
return;
}
if (data) {
h1 && (h1.innerHTML = furigana(dict.japan));

const { name } = data;

/** @type {any[]} */
Expand Down Expand Up @@ -94,5 +98,6 @@ export function setInfo(type, data) {
} else {
info.classList.remove('active');
infoSelected.innerHTML = '';
h1 && (h1.innerHTML = furigana(dict.mapOfJapan));
}
}
2 changes: 1 addition & 1 deletion js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function setActiveData() {
if (cityData) {
setLayer('capitals');
setActiveCity(cityData);
} else {
} else if (prefectureData) {
setLayer('prefectures');
setActivePrefecture(prefectureData);
}
Expand Down
2 changes: 1 addition & 1 deletion js/map/regions.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function clearRegion() {
drawPrefectures(parseDataForPrefectures(regions));
drawCities(parseDataForCities(regions));
drawClickableArea(parseData(regions), colors);
document.title = '日本 (Japan)';
document.title = '日本の地図 (Map of Japan)';
document.location.hash = '';
}

Expand Down

0 comments on commit 2f26844

Please sign in to comment.