Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Static specimen site for Kureedo, served at https://kureedo.mkpo.li on Cloudflare Workers (static assets only, no worker script).
Deploy with `bunx wrangler deploy` from this directory; `public/fonts/` and `public/images/` are copies of `../fonts/` and `../docs/images/`, and `KureedoKanji-Subset.woff2` is `pyftsubset ../fonts/KureedoFull-Regular.ttf --unicodes=U+5B50,U+4E95 --flavor=woff2 --layout-features=''` (the 子 and 井 of the comparison row).
`public/sponsor/` holds the two portrait crops used by the Sponsor pill and dialog in `public/index.html`; `public/brand/kofi-symbol.svg` is the official Ko-fi mark on the dialog's tip button.
`public/sponsor/` holds the two portrait crops used by the Sponsor pill and dialog in `public/index.html`; `public/brand/kofi-symbol.svg` is the official Ko-fi mark on the dialog's tip button. `public/brand/kureedo.svg` and `public/brand/genzui.svg` are the logos listed in the site select that the logo opens; their order and links are in the inline script at the end of `public/index.html`.
The custom domain is declared in `wrangler.jsonc`, so the DNS record is created on deploy.

After a release: update the version, sizes and asset URLs in the download block of `public/index.html` (`gh release view --json tagName,assets`), copy the new webfont into `public/fonts/` (the "latest" alias) and into a new `public/vX.Y.Z/` folder, add `public/vX.Y.Z/kureedo.css` pinned to that folder, point `public/kureedo.css` and the snippets in the ウェブフォント配信 section at the new version, add the `/vX.Y.Z/*` block to `public/_headers`, and regenerate the glyph grids (one per Unicode block, cells Klee One lacks marked) with `../.venv/bin/python scripts/glyphs.py` (it rewrites the block between the `glyphs:start` and `glyphs:end` markers).
Expand Down
1 change: 1 addition & 0 deletions site/public/brand/genzui.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions site/public/brand/kureedo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 131 additions & 4 deletions site/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@
.topnav.show { transform: none; }
.topnav .in { max-width: 72rem; margin: 0 auto; padding: .5rem clamp(16px, 3vw, 2.5rem); display: flex; align-items: center; gap: 1rem 1.5rem; overflow-x: auto; }
.topnav .brand { font-size: 1.1rem; margin-right: auto; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topnav a:not(.brand):not(.tag) { font-size: .75rem; letter-spacing: .18em; color: var(--muted); text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.topnav a:not(.brand):hover { color: var(--accent); }
.topnav .in > a:not(.brand):not(.tag) { font-size: .75rem; letter-spacing: .18em; color: var(--muted); text-decoration: none; text-transform: uppercase; white-space: nowrap; }
.topnav .in > a:not(.brand):hover { color: var(--accent); }
.topnav .tag { padding: .2em .6em; }
@media (prefers-reduced-motion: reduce) { .topnav { transition: none; } }

Expand Down Expand Up @@ -515,6 +515,38 @@
.sponsor-tip { transition: transform .18s ease, box-shadow .18s ease; }
.sponsor-tip:hover { transform: translateY(-1px); box-shadow: 0 8px 22px var(--tip-glow-hover); }
}
/* Site select: the logo opens a menu of the sibling fonts. The menu is a popover, so it sits above the sticky nav and its scroll box. */
.wordmark a { color: inherit; text-decoration: none; }
.site-select { display: inline-block; }
.site-select-trigger {
display: inline-flex; align-items: center; gap: .3em; margin: 0; padding: 0; border: 0; background: none;
color: inherit; font: inherit; letter-spacing: inherit; line-height: inherit; text-align: start; white-space: nowrap; cursor: pointer;
}
.site-select-trigger:hover { color: var(--accent); }
.site-select-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.site-select-chev { flex: none; width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; transition: transform .15s ease; }
.wordmark .site-select-chev { width: clamp(1.1rem, 2.2vw, 1.6rem); height: clamp(1.1rem, 2.2vw, 1.6rem); margin-top: .5em; color: var(--muted); }
.site-select-trigger[aria-expanded="true"] .site-select-chev { transform: rotate(180deg); }
@media (max-width: 400px) { .wordmark .site-select-trigger { gap: .1em; } .wordmark .site-select-trigger small { margin-left: 0; } }
.site-select-menu {
position: fixed; inset: auto; margin: 0; padding: .35rem; min-width: 15rem; max-width: calc(100vw - 16px);
border: 1px solid var(--ink); background: var(--panel); color: var(--ink); box-shadow: 6px 6px 0 var(--shadow);
font-size: 1rem; line-height: 1.4; letter-spacing: 0; text-transform: none; text-align: start;
}
.site-select-menu:popover-open { display: flex; flex-direction: column; }
.site-select-menu a { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; color: var(--ink); text-decoration: none; }
.site-select-menu a:hover, .site-select-menu a:focus-visible { background: var(--well); color: var(--accent); outline: none; }
.site-select-menu a:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.site-select-menu img { flex: none; width: 28px; height: 28px; }
.site-select-name { flex: 1; min-width: 0; }
.site-select-name small { margin-inline-start: .6em; font-size: .72em; letter-spacing: .1em; color: var(--muted); }
.site-select-tick { flex: none; width: 1rem; height: 1rem; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; visibility: hidden; }
.site-select-menu a[aria-current="true"] .site-select-tick { visibility: visible; }
.site-select-menu hr { margin: .35rem .2rem; border: 0; border-top: 1px solid var(--rule); }
.site-select-menu a.more { font-size: .9rem; }
.site-select-menu a.more span[lang="en"] { display: block; font-size: .78rem; color: var(--muted); }
.site-select-menu a.more svg { flex: none; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
@media (prefers-reduced-motion: reduce) { .site-select-chev { transition: none; } }
@keyframes sponsor-beat { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(1.18); } 86% { transform: scale(.96); } 93% { transform: scale(1.1); } }
@keyframes sponsor-bounce { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-2px) scale(1.18) rotate(-8deg); } }
@keyframes sponsor-twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: .9; transform: scale(1); } }
Expand All @@ -524,7 +556,7 @@
<body>
<nav class="topnav" id="topnav" aria-label="ページ内">
<div class="in">
<a class="brand" href="#top">Kureedo</a>
<a class="brand" href="#top" data-site-select="kureedo">Kureedo</a>
<a href="#tester">試し書き</a>
<a href="#glyphs">収録文字</a>
<a href="#usage">使い方</a>
Expand All @@ -536,7 +568,7 @@
<main id="top">
<header class="masthead">
<div class="mast-row">
<h1 class="wordmark">Kureedo<small>クレード</small></h1>
<h1 class="wordmark"><a href="/" data-site-select="kureedo">Kureedo<small>クレード</small></a></h1>
<div class="mast-actions">
<button type="button" class="sponsor" aria-label="スポンサー Sponsor" aria-haspopup="dialog" aria-controls="sponsor-dialog"><span class="sponsor-face" aria-hidden="true"><img src="/sponsor/sponsor-face.webp" alt="" width="24" height="24"><svg viewBox="0 0 24 24"><path d="M12 21s-8.5-5.1-8.5-11.3A4.7 4.7 0 0 1 12 6.9a4.7 4.7 0 0 1 8.5 2.8C20.5 15.9 12 21 12 21Z"/></svg></span><span class="sponsor-label">Sponsor</span></button>
<button id="theme" class="tag" type="button" aria-label="配色を切り替える Toggle light and dark" title="明/暗"><span class="sun" aria-hidden="true">☀</span><span class="moon" aria-hidden="true">☾</span> <span>明/暗</span></button>
Expand Down Expand Up @@ -1180,6 +1212,101 @@ <h2 id="licence"><span class="ja">ライセンス</span><span>Licence</span><spa
<p class="sponsor-thanks">Kureedoをご利用いただきありがとうございます💗<span class="sponsor-en" lang="en">Thank you for using Kureedo 💗</span></p>
</div>
</dialog>
<script>
/* The logo links are upgraded here to a button that opens the menu of sibling fonts. Without
script they stay plain links. */
(function () {
var SITES = [
{ id: "kureedo", href: "https://kureedo.mkpo.li/", logo: "/brand/kureedo.svg", name: "Kureedo", sub: "クレード" },
{ id: "genzui", href: "https://genzui.mkpo.li/", logo: "/brand/genzui.svg", name: "源萃", sub: "GenZui" }
];
var LABEL = "サイト\u3000Sites";
var MORE_HREF = "https://scripts.mkpo.li/ja/";
var NS = "http://www.w3.org/2000/svg";
function el(tag, props, kids) {
var n = document.createElement(tag);
Object.keys(props || {}).forEach(function (k) { n.setAttribute(k, props[k]); });
(kids || []).forEach(function (c) { n.append(c); });
return n;
}
function icon(cls, d) {
var s = document.createElementNS(NS, "svg");
s.setAttribute("viewBox", "0 0 24 24"); s.setAttribute("aria-hidden", "true"); s.setAttribute("class", cls);
var p = document.createElementNS(NS, "path"); p.setAttribute("d", d); s.append(p);
return s;
}
var CHEVRON = "M5 9l7 7 7-7", TICK = "M4 12.5l5 5L20 6.5", ARROW = "M7 17L17 7M9 7h8v8";
var open = null;
function upgrade(link) {
var current = link.getAttribute("data-site-select");
var trigger = el("button", { type: "button", "class": "site-select-trigger", "aria-haspopup": "menu", "aria-expanded": "false", "aria-label": "Kureedo: " + LABEL });
while (link.firstChild) trigger.append(link.firstChild);
trigger.append(icon("site-select-chev", CHEVRON));
var menu = el("div", { "class": "site-select-menu", role: "menu", popover: "manual", "aria-label": LABEL });
var items = SITES.map(function (site) {
var here = site.id === current;
var a = el("a", { role: "menuitem", tabindex: "-1", href: here ? link.getAttribute("href") : site.href }, [
el("img", { src: site.logo, alt: "", width: "28", height: "28" }),
el("span", { "class": "site-select-name" }, [site.name, el("small", {}, [site.sub])]),
icon("site-select-tick", TICK)
]);
if (here) a.setAttribute("aria-current", "true");
menu.append(a);
return a;
});
menu.append(el("hr", { role: "separator" }));
var more = el("a", { role: "menuitem", tabindex: "-1", "class": "more", href: MORE_HREF }, [
el("span", { "class": "site-select-name" }, ["他の文字プロジェクト", el("span", { lang: "en" }, ["More writing-system projects"])]),
icon("", ARROW)
]);
menu.append(more);
items.push(more);
var wrap = el("span", { "class": link.className ? link.className + " site-select" : "site-select" }, [trigger, menu]);
link.replaceWith(wrap);

function isOpen() { return menu.matches(":popover-open"); }
function place() {
var r = trigger.getBoundingClientRect(), w = menu.offsetWidth, gutter = 8;
menu.style.left = Math.max(gutter, Math.min(r.left, window.innerWidth - w - gutter)) + "px";
menu.style.top = (r.bottom + 8) + "px";
}
function show() {
if (open && open !== close) open();
menu.showPopover(); trigger.setAttribute("aria-expanded", "true"); place(); open = close;
items[SITES.map(function (s) { return s.id; }).indexOf(current)].focus({ preventScroll: true });
}
function close(back) {
if (!isOpen()) return;
menu.hidePopover(); trigger.setAttribute("aria-expanded", "false"); open = null;
if (back === true) trigger.focus({ preventScroll: true });
}
trigger.addEventListener("click", function () { isOpen() ? close() : show(); });
trigger.addEventListener("keydown", function (e) {
if (e.key === "ArrowDown" && !isOpen()) { e.preventDefault(); show(); }
});
menu.addEventListener("keydown", function (e) {
e.stopPropagation();
var i = items.indexOf(document.activeElement), n = items.length;
if (e.key === "ArrowDown") i = (i + 1) % n;
else if (e.key === "ArrowUp") i = (i - 1 + n) % n;
else if (e.key === "Home") i = 0;
else if (e.key === "End") i = n - 1;
else if (e.key === " ") { e.preventDefault(); if (i >= 0) items[i].click(); return; }
else if (e.key === "Escape") { e.preventDefault(); close(true); return; }
else if (e.key === "Tab") { close(true); return; }
else return;
e.preventDefault(); items[i].focus({ preventScroll: true });
});
menu.addEventListener("click", function (e) { if (e.target.closest("a")) close(); });
document.addEventListener("pointerdown", function (e) { if (isOpen() && !wrap.contains(e.target)) close(); });
var width = window.innerWidth, y = window.scrollY;
window.addEventListener("resize", function () { if (window.innerWidth !== width) close(); width = window.innerWidth; });
window.addEventListener("scroll", function () { if (Math.abs(window.scrollY - y) > 1) close(); y = window.scrollY; }, { passive: true });
}
if (!HTMLElement.prototype.showPopover) return;
document.querySelectorAll("a[data-site-select]").forEach(upgrade);
})();
</script>
<script>
(function () {
var root = document.documentElement;
Expand Down
Loading