diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c778385..a8daa51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: ./build.sh otf woff2 cp dist/*.woff2 site/ pyftsubset dist/wapuro-mincho.woff2 --text-file=site/index.html --output-file=site/wapuro-mincho.subset.woff2 --flavor=woff2 + python src/catalog.py >site/catalog.html - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 8faeb79..f5c3152 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .venv/ dist/*.otf dist/*.woff2 +site/catalog.html diff --git a/site/catalog.js b/site/catalog.js new file mode 100644 index 0000000..919889e --- /dev/null +++ b/site/catalog.js @@ -0,0 +1,35 @@ +const $ = document.querySelector.bind(document); + +const popup = $('#popup'); + +document.addEventListener('click', (event) => { + if (popup.classList.contains('show')) { + popup.classList.remove('show'); + } + const target = event.target; + if (target.tagName !== 'TD' || target.classList.contains('blank')) return; + const text = target.textContent; + const unicode = [...text].map((c) => + `U+${c.codePointAt(0).toString(16).padStart(4, 0).toUpperCase()}`).join(' '); + $('#popup-glyph').textContent = text; + document.getElementById('popup-info-jis').textContent = target.dataset.jis; + document.getElementById('popup-info-unicode').textContent = unicode; + popup.classList.add('show'); + popup.style.top = event.pageY - popup.offsetHeight / 2 + 'px'; + popup.style.left = event.pageX - popup.offsetWidth / 2 + 'px'; + $('#copy-icon').hidden = false; + $('#copied-icon').hidden = true; +}); + +document.addEventListener('keydown', (event) => { + if (event.key === 'Escape') { + popup.classList.remove('show'); + } +}); + +$('#copy-button').addEventListener('click', async (event) => { + event.stopPropagation(); + await navigator.clipboard.writeText($('#popup-glyph').textContent); + $('#copy-icon').hidden = true; + $('#copied-icon').hidden = false; +}); diff --git a/site/index.html b/site/index.html index f02a0d8..4ffc0c1 100644 --- a/site/index.html +++ b/site/index.html @@ -70,7 +70,8 @@
JIS X 0213:2004の第1〜第3水準漢字と非漢字 8,797字のうち、単一のUnicodeコードポイントで表せない25字を除いた計8,772字を収録しています。
+JIS X 0213:2004が規定する第1〜第4水準漢字と非漢字、全11,233字を収録しています。
+縦書きにも対応しています。また、当時のワープロ文書でよく使われていた縦倍角・横倍角バージョンも付属しています。
面 | +区 | +点 | + {% for i in range(10) %} +{{ i }} | + {% endfor %} +|
---|---|---|---|---|
{{ tbl.plane }} | +{{ tbl.row }} | + {% endif %} +{{ y }}0 | + {% for x in range(10) %} + {% if tbl.table[y * 10 + x] is none %} ++ {% else %} + | {{ tbl.table[y * 10 + x] }} | + {% endif %} + {% endfor %} +